diff options
-rw-r--r-- | .file-metadata | bin | 6573 -> 6573 bytes | |||
-rwxr-xr-x | project | 2 | ||||
-rw-r--r-- | reproduce/analysis/make/initialize.mk | 24 | ||||
-rw-r--r-- | reproduce/analysis/make/prepare.mk | 28 | ||||
-rw-r--r-- | reproduce/analysis/make/top-make.mk | 11 | ||||
-rw-r--r-- | reproduce/analysis/make/top-prepare.mk | 4 |
6 files changed, 51 insertions, 18 deletions
diff --git a/.file-metadata b/.file-metadata Binary files differindex f77bb41..e787ed4 100644 --- a/.file-metadata +++ b/.file-metadata @@ -377,7 +377,7 @@ case $operation in # Make sure the configure script has been completed properly # (`configuration-done.txt' exists). - if ! [ -f .build/software/preparation-done.txt ]; then + if ! [ -f .build/software/preparation-done.mk ]; then print_error_abort $operation fi diff --git a/reproduce/analysis/make/initialize.mk b/reproduce/analysis/make/initialize.mk index 918ae06..0e359c5 100644 --- a/reproduce/analysis/make/initialize.mk +++ b/reproduce/analysis/make/initialize.mk @@ -33,6 +33,7 @@ texdir = $(BDIR)/tex lockdir = $(BDIR)/locks indir = $(BDIR)/inputs +prepdir = $(BDIR)/prepare mtexdir = $(texdir)/macros bashdir = reproduce/analysis/bash pconfdir = reproduce/analysis/config @@ -45,6 +46,29 @@ gconfdir = reproduce/software/config/gnuastro +# Preparation phase +# ----------------- +# +# This Makefile is loaded both for the `prepare' phase and the `make' +# phase. But the preparation files should be dealt with differently +# (depending on the phase). In the `prepare' phase, the main directory +# should be created, and in the `make' phase, its contents should be +# loaded. +# +# If you don't need any preparation, please simply comment these lines. +ifeq (x$(project-phase),xprepare) +$(prepdir):; mkdir $@ +else +include $(BDIR)/software/preparation-done.mk +ifeq (x$(include-prepare-results),xyes) +include $(prepdir)/*.mk +endif +endif + + + + + # TeX build directory # ------------------ # diff --git a/reproduce/analysis/make/prepare.mk b/reproduce/analysis/make/prepare.mk index 3e41fa9..e194d1a 100644 --- a/reproduce/analysis/make/prepare.mk +++ b/reproduce/analysis/make/prepare.mk @@ -19,17 +19,27 @@ # Final-target # # Without this file, `./project make' won't work. -$(BDIR)/software/preparation-done.txt: +$(BDIR)/software/preparation-done.mk: # If you need to add preparations define targets above to do the - # preparations. Recall that before this file, `top-prepare.mk' - # loads `initialize.mk' and `download.mk', so you can safely assume - # everything that is defined there in this Makefile. + # preparations, then set the value below to `yes'. Recall that just + # like `./project make', before loading this file, `./project + # prepare' loads loads `initialize.mk' and `download.mk', so you + # can safely assume everything that is defined there in the + # preparation phase also. # # TIP: the targets can actually be automatically generated # Makefiles that are used by `./project make'. They can include - # variables, or actual rules. Just make sure that those Makefiles - # aren't written in the source directory! Even though they are - # Makefiles, they are automatically built, so they should be - # somewhere under $(BDIR). - @touch $@ + # variables, or automatically generated rules. Just make sure that + # those Makefiles aren't written in the source directory. Even + # though they are Makefiles, they are automatically built, so they + # don't belong in the source. `$(prepdir)' has been defined for + # this purpose (see `initialize.mk'), we recommend that you put all + # automatically generated Makefiles under this directory. In the + # `make' phase, `initialize.mk' will automatically load all the + # `*.mk' files. If you need to load your generated + # configuration-makefiles before automatically generated Makefiles + # containing rules, you can use some naming convension like + # `conf-*.mk' and `rule-*.mk', or you can put them in + # subdirectories. + @echo "include-prepare-results = no" > $@ diff --git a/reproduce/analysis/make/top-make.mk b/reproduce/analysis/make/top-make.mk index 7d20800..355604a 100644 --- a/reproduce/analysis/make/top-make.mk +++ b/reproduce/analysis/make/top-make.mk @@ -125,12 +125,11 @@ makesrc = initialize \ # 1) All the analysis configuration-Makefiles (Makefiles that only define # variables with no rules or order). # -# 2) From the software configuration-Makefiles, we only include the one -# containing software versions, just incase its necessary to -# use/report outside of the acknowledgments section of the paper. -# -# 3) Finally, we'll import all the analysis workhorse-Makefiles which +# 2) Finally, we'll import all the analysis workhorse-Makefiles which # contain rules to actually do this project's processing. +# +# But before that, we need to identify the phase for the Makefiles that are +# run both in `./project prepare' and `./project make'. +project-phase = make include reproduce/analysis/config/*.mk -include reproduce/software/config/installation/versions.mk include $(foreach s,$(makesrc), reproduce/analysis/make/$(s).mk) diff --git a/reproduce/analysis/make/top-prepare.mk b/reproduce/analysis/make/top-prepare.mk index 3353638..e03e890 100644 --- a/reproduce/analysis/make/top-prepare.mk +++ b/reproduce/analysis/make/top-prepare.mk @@ -36,7 +36,7 @@ include reproduce/software/config/installation/LOCAL.mk # # See `top-make.mk' for complete explanation. ifeq (x$(reproducible_paper_group_name),x$(GROUP-NAME)) -all: $(BDIR)/software/preparation-done.txt +all: $(BDIR)/software/preparation-done.mk @echo ""; echo "----------------" echo "Project preparation has been completed without any errors." @@ -86,6 +86,6 @@ makesrc = initialize \ # ------------------------------ # # See `top-make.mk' for complete explanation. +project-phase = prepare include reproduce/analysis/config/*.mk -include reproduce/software/config/installation/versions.mk include $(foreach s,$(makesrc), reproduce/analysis/make/$(s).mk) |