From 6bb9ac565268c31b705ffb53f85eb34c62f6abe9 Mon Sep 17 00:00:00 2001 From: Frank Ueberschar Date: Wed, 15 May 2019 12:37:01 +0200 Subject: [PATCH] docs: prepared Makefile --- docs/manuals/en/new_main_reference/Makefile | 160 ++++++-------------- 1 file changed, 50 insertions(+), 110 deletions(-) diff --git a/docs/manuals/en/new_main_reference/Makefile b/docs/manuals/en/new_main_reference/Makefile index 2915f4dbaa4..b54f16fe46b 100644 --- a/docs/manuals/en/new_main_reference/Makefile +++ b/docs/manuals/en/new_main_reference/Makefile @@ -1,4 +1,10 @@ +MKDIR=mkdir -p +BAREOS_DIR=../../../../../bareos-master/b/systemtests/sbin/bareos-dir +BAREOS_SD=../../../../../bareos-master/b/systemtests/sbin/bareos-sd +BAREOS_FD=../../../../../bareos-master/b/systemtests/sbin/bareos-fd +BCONSOLE=../../../../../bareos-master/b/systemtests/bin/bconsole +BAREOS_TRAY_MONITOR=../../../../../bareos-master/b/core/src/qt-tray-monitor/bareos-tray-monitor GENERATED = include/autogenerated/bareos-dir-*.rst.inc \ include/autogenerated/bareos-sd-*.rst.inc \ @@ -6,7 +12,7 @@ GENERATED = include/autogenerated/bareos-dir-*.rst.inc \ include/autogenerated/bconsole-*.rst.inc \ include/autogenerated/bareos-tray-monitor-*.rst.inc -GENERATED_RESOURCE_DESCRIPTIONS=../../scripts/generate-resoure-descriptions.py --sphinx +GENERATE_RESOURCE_DESCRIPTIONS=../../scripts/generate-resoure-descriptions.py --sphinx # You can set these variables from the command line. @@ -16,138 +22,72 @@ SPHINXPROJ = BareosMainReference SOURCEDIR = source BUILDDIR = BareosMainReference -#nothing: - -# Put it first so that "make" without argument is like "make help". -all: sphinx - -convert: $(GENERATED) copy pre latexpand split pandoc post1 post2 presphinx sphinx +all: $(GENERATED) sphinx include/autogenerated/bareos-dir-*.rst.inc: autogenerated/bareos-dir-config-schema.json # generates all director-resource files - $(GENERATED_RESOURCE_DESCRIPTIONS) autogenerated/bareos-dir-config-schema.json + $(GENERATE_RESOURCE_DESCRIPTIONS) autogenerated/bareos-dir-config-schema.json include/autogenerated/bareos-sd-*.rst.inc: autogenerated/bareos-sd-config-schema.json # generates all storage daemon resource files - $(GENERATED_RESOURCE_DESCRIPTIONS) autogenerated/bareos-sd-config-schema.json + $(GENERATE_RESOURCE_DESCRIPTIONS) autogenerated/bareos-sd-config-schema.json include/autogenerated/bareos-fd-*.rst.inc: autogenerated/bareos-fd-config-schema.json # generates all file daemon resource files - $(GENERATED_RESOURCE_DESCRIPTIONS) autogenerated/bareos-fd-config-schema.json + $(GENERATE_RESOURCE_DESCRIPTIONS) autogenerated/bareos-fd-config-schema.json include/autogenerated/bconsole-*.rst.inc: autogenerated/bconsole-config-schema.json # generates all bconsole resource files - $(GENERATED_RESOURCE_DESCRIPTIONS) autogenerated/bconsole-config-schema.json + $(GENERATE_RESOURCE_DESCRIPTIONS) autogenerated/bconsole-config-schema.json include/autogenerated/bareos-tray-monitor-*.rst.inc: autogenerated/bareos-tray-monitor-config-schema.json # generates all tray-monitor resource files - $(GENERATED_RESOURCE_DESCRIPTIONS) autogenerated/bareos-tray-monitor-config-schema.json - -autogenerated: $(GENERATED) + $(GENERATE_RESOURCE_DESCRIPTIONS) autogenerated/bareos-tray-monitor-config-schema.json + +autogenerated/bareos-dir-config-schema.json: + $(MKDIR) autogenerated/ + # generate config-schema file. + # Test if creation succeeded, if yes, redirect output to a json file. + $(BAREOS_DIR) -xs >/dev/null && \ + $(BAREOS_DIR) -xs > autogenerated/bareos-dir-config-schema.json; + +autogenerated/bareos-sd-config-schema.json: + $(MKDIR) autogenerated/ + # generate config-schema file. + # Test if creation succeeded, if yes, redirect output to a json file. + $(BAREOS_SD) -xs >/dev/null && \ + $(BAREOS_SD) -xs > autogenerated/bareos-sd-config-schema.json; + +autogenerated/bareos-fd-config-schema.json: + $(MKDIR) autogenerated/ + # generate config-schema file. + # Test if creation succeeded, if yes, redirect output to a json file. + $(BAREOS_FD) -xs >/dev/null && \ + $(BAREOS_FD) -xs > autogenerated/bareos-fd-config-schema.json; + +autogenerated/bconsole-config-schema.json: + $(MKDIR) autogenerated/ + # generate config-schema file. + # Test if creation succeeded, if yes, redirect output to a json file. + $(BCONSOLE) -xs >/dev/null && \ + $(BCONSOLE) -xs > autogenerated/bconsole-config-schema.json; + +autogenerated/bareos-tray-monitor-config-schema.json: + $(MKDIR) autogenerated/ + # generate config-schema file. + # Test if creation succeeded, if yes, redirect output to a json file. + $(BAREOS_TRAY_MONITOR) -xs >/dev/null && \ + $(BAREOS_TRAY_MONITOR) -xs > autogenerated/bareos-tray-monitor-config-schema.json; -copy: - # IN: ../main/**.tex - # OUT: source/** - mkdir -p source/include/config/ - cp -a ../main/*.txt source/include/ - cp -a ../main/config/*.conf source/include/config/ - mkdir -p source/include/autogenerated/ - cp -a ../main/autogenerated/*-resource-*-description.rst.inc source/include/autogenerated/ - - -pre: - # IN: ../main/**.tex - # OUT: build/pre/**.tex - rm -rf build/pre - mkdir -p build/pre - ./pre_conversion_changes.sh - -latexpand: - # IN: build/pre/**.tex - # OUT: build/latexpand/bareos-manual-main-reference.tex - mkdir -p build/latexpand - cd build/pre && latexpand --keep-comments bareos-manual-main-reference.tex > ../latexpand/bareos-manual-main-reference.tex - -split: - # IN: build/latexpand/bareos-manual-main-reference.tex - # ../main/*resource-*-definitions.tex - # OUT: build/split/index.rst - # build/split/**.tex - rm -rf build/split - mkdir -p build/split - ./split.py build/latexpand/bareos-manual-main-reference.tex build/split/ - #cp -a ../main/*resource-*-definitions.tex build/split/ - -# pandoc-single: build/latexpand/bareos-manual-main-reference.tex -# # IN: build/latexpand/bareos-manual-main-reference.tex -# # OUT: build/pandoc/bareos-manual-main-reference.rst -# mkdir -p build/pandoc -# pandoc --verbose --columns=500 -f latex+raw_tex --top-level-division=part -t rst build/latexpand/bareos-manual-main-reference.tex -o build/pandoc/bareos-manual-main-reference.rst - -# post1: -# # IN: build/pandoc/bareos-manual-main-reference.rst -# # OUT: build/post/bareos-manual-main-reference.rst -# # build/config-directive-description/*.tex -# # DURATION: 30m (before: 130m) -# mkdir -p build/post1 -# mkdir -p build/config-directive-description -# cat build/pandoc/bareos-manual-main-reference.rst | ./latex-scan.py --standalone > build/post1/bareos-manual-main-reference.rst 2> build/post1/bareos-manual-main-reference.rst.latex-scan.log - -pandoc: - # IN: build/split/**.tex - # OUT: build/pandoc/**.rst - rm -rf build/pandoc - mkdir -p build/pandoc - ./pandoc.sh - - -post1: - # IN: build/pandoc/**.rst - # OUT: build/post1/**.rst - # build/config-directive-description/*.tex - rm -rf build/post1 - mkdir -p build/post1 - mkdir -p build/config-directive-description - ./post1.sh - cp -a build/split/index.rst build/post1 - -post2: - # DEPENDS: latex-scan.py on main/*resource-*-definitions.tex - # IN: build/config-directive-description/*.tex - # OUT: build/post2/config-directive-description/*.rst.inc - ./post2.sh - -# rstsplit: build/post1/bareos-manual-main-reference.rst -# # IN: build/post1/bareos-manual-main-reference.rst.inc -# # OUT: build/rst-split/**.rst -# rm -rf build/rst-split/ -# mkdir -p build/rst-split/ -# #ln -sf ../../../main/autogenerated -# ./rst-split.py build/post1/bareos-manual-main-reference.rst build/rst-split/ - -presphinx: - rsync -a --include '*/' --include '*.rst' --exclude '*' build/post1/. "$(SOURCEDIR)" - rsync -a build/post2/. "$(SOURCEDIR)" +autogenerated: $(GENERATED) sphinx: #sphinx-versioning -l source/conf.py build docs/manuals/en/new_main_reference/source/ docs/manuals/en/new_main_reference/BareosMainReference/ @$(SPHINXBUILD) -M html "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) #@$(SPHINXBUILD) -M latexpdf "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) -help: - @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) - -check: - @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) - clean: rm -rf build/* rm -rf BareosMainReference/* + rm -rf autogenerated/* - -.PHONY: help Makefile - -# Catch-all target: route all unknown targets to Sphinx using the new -# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). -#%: Makefile -# @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)