Small optimization in Makefile regarding mk_exec target.
Warning, cannot access the index:
_darcs/index: opening of '_darcs/index' failed: permission denied (Permission denied)
diff -rN -u old-bii_scripts/Makefile new-bii_scripts/Makefile
--- old-bii_scripts/Makefile 2022-11-28 23:35:23.139783679 +0100
+++ new-bii_scripts/Makefile 2022-11-28 23:35:23.139783679 +0100
@@ -655,14 +655,21 @@
build: build_shared build_scripts build_perl_libs build_python_libs build_html
-# also makes all scripts executable:
$(SETENV):
mkdir -p $(LOCAL_BUILD_DIR)
echo "export PERL5LIB=$$(readlink -e $(PERLLIB_SRC_DIR)):$$PERL5LIB" > $@
echo "export PYTHONPATH=$$(readlink -e $(PYTHONLIB_SRC_DIR)):$$PYTHONPATH" >> $@
- chmod u+x $(SCRIPT_SRC_DIR)/*
-mk_exec:
+# Ensure that all files in "bin" directory executable and can be run when file
+# $(SETENV) is sourced, this is meeded to create the online help.
+#
+# Since "mk_exec" is a phony target this done once for each make run where
+# "mk_exec" is in one of the dependencies.
+#
+# All this is meeded since darcs cannot store file permissions. If a user does
+# "darcs pull" in this project it may be that a new script is added to the
+# "bin" directory with it's executable flag not set.
+mk_exec: $(SETENV)
chmod u+x $(SCRIPT_SRC_DIR)/*
# build shared files ........................................
@@ -724,7 +731,7 @@
# build documentation from plain text files
build_html_txt_doc: $(_HTML_DOCTXT_TXT_BUILD_LIST) $(_HTML_RST_TXT_BUILD_LIST)
-$(_HTML_DOCTXT_TXT_BUILD_LIST): $(HTML_BUILD_DIR)/%.html: $(DOC_TXT_SRC_DIR)/%.txt $(SETENV) | $(HTML_BUILD_DIR) mk_exec
+$(_HTML_DOCTXT_TXT_BUILD_LIST): $(HTML_BUILD_DIR)/%.html: $(DOC_TXT_SRC_DIR)/%.txt | $(HTML_BUILD_DIR) mk_exec
. $(SETENV) && $(SCRIPT_SRC_DIR)/makeDocTxt.pl --css ../$(CSS_SRC_FILE) $< $@
$(_HTML_RST_TXT_BUILD_LIST): $(HTML_BUILD_DIR)/%.html: $(DOC_TXT_SRC_DIR)/%.rst | $(HTML_BUILD_DIR)
@@ -762,37 +769,37 @@
$(_HTML_PLAINTXT_H_PY_SCRIPT_BUILD_LIST) \
$(_HTML_PLAINTXT_PL_SCRIPT_BUILD_LIST)
-$(_HTML_PLAINTXT_SCRIPT_BUILD_LIST): $(SCRIPT_HTML_BUILD_DIR)/%.html: $(SCRIPT_SRC_DIR)/% $(SETENV) | $(SCRIPT_HTML_BUILD_DIR) mk_exec
+$(_HTML_PLAINTXT_SCRIPT_BUILD_LIST): $(SCRIPT_HTML_BUILD_DIR)/%.html: $(SCRIPT_SRC_DIR)/% | $(SCRIPT_HTML_BUILD_DIR) mk_exec
@echo "<PRE>" > $@
(. $(SETENV) && $< 2>&1; true) >> $@
@echo "</PRE>" >> $@
-$(_HTML_PLAINTXT_H_SCRIPT_BUILD_LIST): $(SCRIPT_HTML_BUILD_DIR)/%.html: $(SCRIPT_SRC_DIR)/% $(SETENV) | $(SCRIPT_HTML_BUILD_DIR) mk_exec
+$(_HTML_PLAINTXT_H_SCRIPT_BUILD_LIST): $(SCRIPT_HTML_BUILD_DIR)/%.html: $(SCRIPT_SRC_DIR)/% | $(SCRIPT_HTML_BUILD_DIR) mk_exec
@echo "<PRE>" > $@
(. $(SETENV) && $< -h 2>&1; true) >> $@
@echo "</PRE>" >> $@
-$(_HTML_PLAINTXT_HELP_SCRIPT_BUILD_LIST): $(SCRIPT_HTML_BUILD_DIR)/%.html: $(SCRIPT_SRC_DIR)/% $(SETENV) | $(SCRIPT_HTML_BUILD_DIR) mk_exec
+$(_HTML_PLAINTXT_HELP_SCRIPT_BUILD_LIST): $(SCRIPT_HTML_BUILD_DIR)/%.html: $(SCRIPT_SRC_DIR)/% | $(SCRIPT_HTML_BUILD_DIR) mk_exec
@echo "<PRE>" > $@
(. $(SETENV) && $< --help 2>&1; true) >> $@
@echo "</PRE>" >> $@
-$(_HTML_PLAINTXT_H_P_SCRIPT_BUILD_LIST): $(SCRIPT_HTML_BUILD_DIR)/%.html: $(SCRIPT_SRC_DIR)/%.p $(SETENV) | $(SCRIPT_HTML_BUILD_DIR) mk_exec
+$(_HTML_PLAINTXT_H_P_SCRIPT_BUILD_LIST): $(SCRIPT_HTML_BUILD_DIR)/%.html: $(SCRIPT_SRC_DIR)/%.p | $(SCRIPT_HTML_BUILD_DIR) mk_exec
@echo "<PRE>" > $@
(. $(SETENV) && $< -h 2>&1; true) >> $@
@echo "</PRE>" >> $@
-$(_HTML_PLAINTXT_H_PL_SCRIPT_BUILD_LIST): $(SCRIPT_HTML_BUILD_DIR)/%.html: $(SCRIPT_SRC_DIR)/%.pl $(SETENV) | $(SCRIPT_HTML_BUILD_DIR) mk_exec
+$(_HTML_PLAINTXT_H_PL_SCRIPT_BUILD_LIST): $(SCRIPT_HTML_BUILD_DIR)/%.html: $(SCRIPT_SRC_DIR)/%.pl | $(SCRIPT_HTML_BUILD_DIR) mk_exec
@echo "<PRE>" > $@
(. $(SETENV) && $< -h 2>&1; true) >> $@
@echo "</PRE>" >> $@
-$(_HTML_PLAINTXT_H_PY_SCRIPT_BUILD_LIST): $(SCRIPT_HTML_BUILD_DIR)/%.html: $(SCRIPT_SRC_DIR)/%.py $(SETENV) | $(SCRIPT_HTML_BUILD_DIR) mk_exec
+$(_HTML_PLAINTXT_H_PY_SCRIPT_BUILD_LIST): $(SCRIPT_HTML_BUILD_DIR)/%.html: $(SCRIPT_SRC_DIR)/%.py | $(SCRIPT_HTML_BUILD_DIR) mk_exec
@echo "<PRE>" > $@
(. $(SETENV) && $< -h 2>>$(ERRLOG); true) >> $@
@echo "</PRE>" >> $@
-$(_HTML_PLAINTXT_PL_SCRIPT_BUILD_LIST): $(SCRIPT_HTML_BUILD_DIR)/%.html: $(SCRIPT_SRC_DIR)/%.pl $(SETENV) | $(SCRIPT_HTML_BUILD_DIR) mk_exec
+$(_HTML_PLAINTXT_PL_SCRIPT_BUILD_LIST): $(SCRIPT_HTML_BUILD_DIR)/%.html: $(SCRIPT_SRC_DIR)/%.pl | $(SCRIPT_HTML_BUILD_DIR) mk_exec
@echo "<PRE>" > $@
(. $(SETENV) && $< 2>&1; true) >> $@
@echo "</PRE>" >> $@
@@ -803,7 +810,7 @@
tt:
echo $(_HTML_RST_SCRIPT_BUILD_LIST)
-$(_HTML_RST_SCRIPT_BUILD_LIST): $(SCRIPT_HTML_BUILD_DIR)/%.html: $(SCRIPT_SRC_DIR)/% $(SETENV) | $(SCRIPT_HTML_BUILD_DIR) mk_exec
+$(_HTML_RST_SCRIPT_BUILD_LIST): $(SCRIPT_HTML_BUILD_DIR)/%.html: $(SCRIPT_SRC_DIR)/% | $(SCRIPT_HTML_BUILD_DIR) mk_exec
ifeq (1,$(DOCUTILS_AVAILABLE))
(. $(SETENV) && $< --doc 2>>$(ERRLOG); true) | \
rst2html --stylesheet-path=$(DOC_HTML_SRC_DIR)/$(CSS_SRC_FILE) > $@
@@ -813,7 +820,7 @@
@echo "</PRE>" >> $@
endif
-$(_HTML_RST_PY_SCRIPT_BUILD_LIST): $(SCRIPT_HTML_BUILD_DIR)/%.html: $(SCRIPT_SRC_DIR)/%.py $(SETENV) | $(SCRIPT_HTML_BUILD_DIR) mk_exec
+$(_HTML_RST_PY_SCRIPT_BUILD_LIST): $(SCRIPT_HTML_BUILD_DIR)/%.html: $(SCRIPT_SRC_DIR)/%.py | $(SCRIPT_HTML_BUILD_DIR) mk_exec
ifeq (1,$(DOCUTILS_AVAILABLE))
. $(SETENV) && $< --doc | \
rst2html --stylesheet-path=$(DOC_HTML_SRC_DIR)/$(CSS_SRC_FILE) > $@
@@ -826,7 +833,7 @@
build_html_script_doctxt: $(_HTML_DOCTXT_SCRIPT_BUILD_LIST)
-$(_HTML_DOCTXT_SCRIPT_BUILD_LIST): $(SCRIPT_HTML_BUILD_DIR)/%.html: $(SCRIPT_SRC_DIR)/%.pl $(SETENV) | $(SCRIPT_HTML_BUILD_DIR) mk_exec
+$(_HTML_DOCTXT_SCRIPT_BUILD_LIST): $(SCRIPT_HTML_BUILD_DIR)/%.html: $(SCRIPT_SRC_DIR)/%.pl | $(SCRIPT_HTML_BUILD_DIR) mk_exec
. $(SETENV) && $(SCRIPT_SRC_DIR)/makeDocPerl.pl $< $@.tmp
. $(SETENV) && $(SCRIPT_SRC_DIR)/makeDocTxt.pl --css ../$(CSS_SRC_FILE) $@.tmp $@
rm -f $@.tmp
@@ -843,7 +850,7 @@
build_html_perllib_doctxt: $(_HTML_DOCTXT_PERLLIB_BUILD_LIST)
-$(_HTML_DOCTXT_PERLLIB_BUILD_LIST): $(PERLLIB_HTML_BUILD_DIR)/%.html: $(PERLLIB_SRC_DIR)/%.pm $(SETENV) | $(PERLLIB_HTML_BUILD_DIR) mk_exec
+$(_HTML_DOCTXT_PERLLIB_BUILD_LIST): $(PERLLIB_HTML_BUILD_DIR)/%.html: $(PERLLIB_SRC_DIR)/%.pm | $(PERLLIB_HTML_BUILD_DIR) mk_exec
. $(SETENV) && $(SCRIPT_SRC_DIR)/makeDocPerl.pl $< $@.tmp
. $(SETENV) && $(SCRIPT_SRC_DIR)/makeDocTxt.pl --css ../$(CSS_SRC_FILE) $@.tmp $@
rm -f $@.tmp
@@ -857,10 +864,10 @@
$(_HTML_PYDOC_PYTHON2LIB_BUILD_LIST) \
$(_HTML_PYDOC_PYTHON3LIB_BUILD_LIST)
-$(_HTML_PYDOC_PYTHON2LIB_BUILD_LIST): $(PYTHONLIB_HTML_BUILD_DIR)/%.html: $(PYTHONLIB_SRC_DIR)/%.py $(SETENV) | $(PYTHONLIB_HTML_BUILD_DIR) mk_exec
+$(_HTML_PYDOC_PYTHON2LIB_BUILD_LIST): $(PYTHONLIB_HTML_BUILD_DIR)/%.html: $(PYTHONLIB_SRC_DIR)/%.py | $(PYTHONLIB_HTML_BUILD_DIR) mk_exec
. $(SETENV) && top=$$(pwd) && mkdir -p $(@D) && cd $(@D) && $(PYDOC2) -w $$top/$< 2>>$$top/$(ERRLOG)
-$(_HTML_PYDOC_PYTHON3LIB_BUILD_LIST): $(PYTHONLIB_HTML_BUILD_DIR)/%.html: $(PYTHONLIB_SRC_DIR)/%.py $(SETENV) | $(PYTHONLIB_HTML_BUILD_DIR) mk_exec
+$(_HTML_PYDOC_PYTHON3LIB_BUILD_LIST): $(PYTHONLIB_HTML_BUILD_DIR)/%.html: $(PYTHONLIB_SRC_DIR)/%.py | $(PYTHONLIB_HTML_BUILD_DIR) mk_exec
. $(SETENV) && top=$$(pwd) && mkdir -p $(@D) && cd $(@D) && $(PYDOC3) -w $$top/$< 2>>$$top/$(ERRLOG)
# create build directories ..................................
patch afad17c548446e0c7f71768af897dda896aab220
Author: Goetz Pfeiffer <Goetz.Pfeiffer@helmholtz-berlin.de>
Date: Fri Jun 25 13:47:26 CEST 2021
* Small optimization in Makefile regarding mk_exec target.
Now mk_exec depends on $(SETENV), so there is no need to have $(SETENV) as
dependency at all places when mk_exec is a dependency.
Also a detailed comment was added at the definition of "mk_exec"