Skip to content

Commit

Permalink
docs: prepared Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
franku committed May 15, 2019
1 parent d20997d commit 6bb9ac5
Showing 1 changed file with 50 additions and 110 deletions.
160 changes: 50 additions & 110 deletions docs/manuals/en/new_main_reference/Makefile
@@ -1,12 +1,18 @@

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 \
include/autogenerated/bareos-fd-*.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.
Expand All @@ -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)

0 comments on commit 6bb9ac5

Please sign in to comment.