aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README-hacking.md12
-rw-r--r--reproduce/analysis/make/verify.mk16
2 files changed, 20 insertions, 8 deletions
diff --git a/README-hacking.md b/README-hacking.md
index ec6bf4e..6cd6f46 100644
--- a/README-hacking.md
+++ b/README-hacking.md
@@ -810,11 +810,13 @@ Other basic customizations
`reproduce/analysis/make/verify.mk`. The verification of all the files
is only done in one recipe. First the files that go into the
plots/figures are checked, then the LaTeX macros. Validation of the
- former (inputs to plots/figures) should be done manually. You can see
- two examples of the dummy steps (with `delete-me`). For the latter,
- you just have to update the checksums. The important thing to consider
- is that a simple checksum can be problematic because some file
- generators print their run-time date in the file (for example as
+ former (inputs to plots/figures) should be done manually. If its the
+ first time you are doing this, you can see two examples of the dummy
+ steps (with `delete-me`, you can use them if you like). These two
+ examples should be removed before you can run the project. For the
+ latter, you just have to update the checksums. The important thing to
+ consider is that a simple checksum can be problematic because some
+ file generators print their run-time date in the file (for example as
commented lines in a text table). When checking text files, this
Makefile already has this function:
`verify-txt-no-comments-leading-space`. As the name suggests, it will
diff --git a/reproduce/analysis/make/verify.mk b/reproduce/analysis/make/verify.mk
index 440ac57..1173f2c 100644
--- a/reproduce/analysis/make/verify.mk
+++ b/reproduce/analysis/make/verify.mk
@@ -23,6 +23,12 @@
# ----------------------
#
# These functions are used by the final rule in this Makefil
+verify-print-error-start = \
+ echo; \
+ echo "VERIFICATION ERROR"; \
+ echo "------------------"; \
+ echo
+
verify-print-tips = \
echo "If you are still developing your project, you can disable"; \
echo "verification by removing the value of the variable in the"; \
@@ -37,6 +43,12 @@ verify-print-tips = \
verify-txt-no-comments-leading-space = \
infile=$(strip $(1)); \
inchecksum=$(strip $(2)); \
+ if ! [ -f "$$infile" ]; then \
+ $(call verify-print-error-start); \
+ echo "The following file (that should be verified) doesn't exist:"; \
+ echo " $$infile"; \
+ echo; exit 1; \
+ fi; \
checksum=$$(sed -e 's/^[[:space:]]*//g' \
-e 's/\#.*$$//' \
-e '/^$$/d' $$infile \
@@ -45,9 +57,7 @@ verify-txt-no-comments-leading-space = \
if [ x"$$inchecksum" = x"$$checksum" ]; then \
echo "Verified: $$infile"; \
else \
- echo; \
- echo "VERIFICATION ERROR"; \
- echo "------------------"; \
+ $(call verify-print-error-start); \
$(call verify-print-tips); \
echo; \
echo "Checked file (without empty or commented lines):"; \