Skip to content

Commit

Permalink
config: reworked the Makefile for two main build targets
Browse files Browse the repository at this point in the history
- all
- all-rebuild-json
  • Loading branch information
franku committed May 16, 2019
1 parent 20ceeaf commit 99cc224
Showing 1 changed file with 55 additions and 34 deletions.
89 changes: 55 additions & 34 deletions docs/manuals/Makefile
@@ -1,19 +1,26 @@
#
# manuals makefile
#

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 \
AUTOGENERATED_RESOURCE_DESCRIPTION_RST_FILES = 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

GENERATE_RESOURCE_DESCRIPTIONS=./scripts/generate-resoure-descriptions.py --sphinx
AUTOGENERATED_RESOURCE_DESCRIPTION_JSON_FILES = autogenerated/bareos-dir-config-schema.json \
autogenerated/bareos-sd-config-schema.json \
autogenerated/bareos-fd-config-schema.json \
autogenerated/bconsole-config-schema.json \
autogenerated/bareos-tray-monitor-config-schema.json

GENERATE_RESOURCE_DESCRIPTIONS_FROM_JSON_FILES=./scripts/generate-resoure-descriptions.py --sphinx

# You can set these variables from the command line.
SPHINXOPTS =
Expand All @@ -22,70 +29,84 @@ SPHINXPROJ = BareosMainReference
SOURCEDIR = source
BUILDDIR = BareosMainReference

all: $(GENERATED) sphinx
all: $(AUTOGENERATED_RESOURCE_DESCRIPTION_RST_FILES)
make sphinx
make check-json-files-for-changes

all-rebuild-json:
make clean clean-json-files
make all

include/autogenerated/bareos-dir-*.rst.inc: autogenerated/bareos-dir-config-schema.json
# generates all director-resource files
$(GENERATE_RESOURCE_DESCRIPTIONS) autogenerated/bareos-dir-config-schema.json
@# generates all director-resource files
$(GENERATE_RESOURCE_DESCRIPTIONS_FROM_JSON_FILES) autogenerated/bareos-dir-config-schema.json

include/autogenerated/bareos-sd-*.rst.inc: autogenerated/bareos-sd-config-schema.json
# generates all storage daemon resource files
$(GENERATE_RESOURCE_DESCRIPTIONS) autogenerated/bareos-sd-config-schema.json
@# generates all storage daemon resource files
$(GENERATE_RESOURCE_DESCRIPTIONS_FROM_JSON_FILES) autogenerated/bareos-sd-config-schema.json

include/autogenerated/bareos-fd-*.rst.inc: autogenerated/bareos-fd-config-schema.json
# generates all file daemon resource files
$(GENERATE_RESOURCE_DESCRIPTIONS) autogenerated/bareos-fd-config-schema.json
@# generates all file daemon resource files
$(GENERATE_RESOURCE_DESCRIPTIONS_FROM_JSON_FILES) autogenerated/bareos-fd-config-schema.json

include/autogenerated/bconsole-*.rst.inc: autogenerated/bconsole-config-schema.json
# generates all bconsole resource files
$(GENERATE_RESOURCE_DESCRIPTIONS) autogenerated/bconsole-config-schema.json
@# generates all bconsole resource files
$(GENERATE_RESOURCE_DESCRIPTIONS_FROM_JSON_FILES) 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
$(GENERATE_RESOURCE_DESCRIPTIONS) autogenerated/bareos-tray-monitor-config-schema.json
@# generates all tray-monitor resource files
$(GENERATE_RESOURCE_DESCRIPTIONS_FROM_JSON_FILES) autogenerated/bareos-tray-monitor-config-schema.json

autogenerated/bareos-dir-config-schema.json:
# generate config-schema file.
# Test if creation succeeded, if yes, redirect output to a json file.
@# generate config-schema file.
@# Test if creation succeeded, if yes, redirect output to a json file.
@test -f "$(BAREOS_DIR)" || (echo "\"$(BAREOS_DIR)\" does not exist"; exit 1)
$(BAREOS_DIR) -xs >/dev/null && \
$(BAREOS_DIR) -xs > autogenerated/bareos-dir-config-schema.json;

autogenerated/bareos-sd-config-schema.json:
# generate config-schema file.
# Test if creation succeeded, if yes, redirect output to a json file.
@# generate config-schema file.
@# Test if creation succeeded, if yes, redirect output to a json file.
@test -f "$(BAREOS_SD)" || (echo "\"$(BAREOS_SD)\" does not exist"; exit 1)
$(BAREOS_SD) -xs >/dev/null && \
$(BAREOS_SD) -xs > autogenerated/bareos-sd-config-schema.json;

autogenerated/bareos-fd-config-schema.json:
# generate config-schema file.
# Test if creation succeeded, if yes, redirect output to a json file.
@# generate config-schema file.
@# Test if creation succeeded, if yes, redirect output to a json file.
@test -f "$(BAREOS_FD)" || (echo "\"$(BAREOS_FD)\" does not exist"; exit 1)
$(BAREOS_FD) -xs >/dev/null && \
$(BAREOS_FD) -xs > autogenerated/bareos-fd-config-schema.json;

autogenerated/bconsole-config-schema.json:
# generate config-schema file.
# Test if creation succeeded, if yes, redirect output to a json file.
@# generate config-schema file.
@# Test if creation succeeded, if yes, redirect output to a json file.
@test -f "$(BCONSOLE)" || (echo "\"$(BCONSOLE)\" does not exist"; exit 1)
$(BCONSOLE) -xs >/dev/null && \
$(BCONSOLE) -xs > autogenerated/bconsole-config-schema.json;

autogenerated/bareos-tray-monitor-config-schema.json:
# generate config-schema file.
# Test if creation succeeded, if yes, redirect output to a json file.
@# generate config-schema file.
@# Test if creation succeeded, if yes, redirect output to a json file.
@test -f "$(BAREOS_TRAY_MONITOR)" || (echo "\"$(BAREOS_TRAY_MONITOR)\" does not exist"; exit 1)
$(BAREOS_TRAY_MONITOR) -xs >/dev/null && \
$(BAREOS_TRAY_MONITOR) -xs > autogenerated/bareos-tray-monitor-config-schema.json;

autogenerated: $(GENERATED)

autogenerated-json:
rm -rf autogenerated/*.json
make autogenerated
@git diff --quiet source/include/autogenerated/ || echo "!!! *** Attention, config directive has changed *** !!!"

sphinx:
@$(SPHINXBUILD) -M html "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

check-json-files-for-changes:
@git diff --quiet source/include/autogenerated/ || echo "!!! *** Attention, config directive has changed *** !!!"

clean:
rm -rf build/*
rm -rf BareosMainReference/*
rm -rf autogenerated/*.rst.inc
rm -rf BareosMainReference
rm -rf autogenerated/*.rst.inc #this does not reset the json files

clean-json-files:
rm -rf autogenerated/*.json

distclean:
make clean
rm -f source/_extensions/*.pyc
git checkout -f source/include/autogenerated #this will reset the json files

0 comments on commit 99cc224

Please sign in to comment.