diff options
Diffstat (limited to 'reproduce/analysis/make')
-rw-r--r-- | reproduce/analysis/make/initialize.mk | 49 | ||||
-rw-r--r-- | reproduce/analysis/make/paper.mk | 49 | ||||
-rw-r--r-- | reproduce/analysis/make/prepare.mk | 2 | ||||
-rw-r--r-- | reproduce/analysis/make/top-make.mk | 6 | ||||
-rw-r--r-- | reproduce/analysis/make/top-prepare.mk | 8 |
5 files changed, 72 insertions, 42 deletions
diff --git a/reproduce/analysis/make/initialize.mk b/reproduce/analysis/make/initialize.mk index 92e5eff..b57b3a9 100644 --- a/reproduce/analysis/make/initialize.mk +++ b/reproduce/analysis/make/initialize.mk @@ -41,7 +41,7 @@ bsdir=$(BDIR)/software # Derived directories (the locks directory can be shared with software # which already has this directory.). texdir = $(badir)/tex -lockdir = $(bsdir)/locks +lockdir = $(badir)/.locks indir = $(badir)/inputs prepdir = $(badir)/prepare mtexdir = $(texdir)/macros @@ -73,7 +73,7 @@ pconfdir = reproduce/analysis/config ifeq (x$(project-phase),xprepare) $(prepdir):; mkdir $@ else --include $(bsdir)/preparation-done.mk +-include $(badir)/preparation-done.mk ifeq (x$(include-prepare-results),xyes) -include $(prepdir)/*.mk $(prepdir)/*.conf endif @@ -265,16 +265,8 @@ clean: # executing 'build'. rm -f *.aux *.log *.synctex *.auxlock *.dvi *.out *.run.xml *.bcf -# Delete all the built outputs except the dependency programs. We'll -# use Bash's extended options builtin ('shopt') to enable "extended -# glob" (for listing of files). It allows extended features like -# ignoring the listing of a file with '!()' that we are using -# afterwards. - shopt -s extglob - rm -rf $(texdir)/macros/!(dependencies.tex|dependencies-bib.tex|hardware-parameters.tex) - rm -rf $(badir)/!(tex) $(texdir)/!(macros|$(texbtopdir)) - rm -rf $(texdir)/build/!(tikz) $(texdir)/build/tikz/* - rm -rf $(bsdir)/preparation-done.mk +# Delete the full 'badir' (containing all analysis outputs). + rm -rf $(badir) distclean: clean # Without cleaning the Git hooks, we won't be able to easily commit @@ -285,7 +277,7 @@ distclean: clean # 'rm' program. So for this recipe, we'll use the host system's 'rm', # not our own. $$sys_rm -rf $(BDIR) - $$sys_rm -f .local .build $(pconfdir)/LOCAL.conf + $$sys_rm -f .local .build @@ -329,12 +321,11 @@ $(project-package-contents): paper.pdf | $(texdir) paper.tex > $$dir/paper.tex # Copy ONLY the version-controlled files in 'reproduce' and -# 'tex/src'. This is important because files like 'LOCAL.conf' (in -# 'reproduce/software/config') should not be archived, they contain -# information about the host computer and are irrelevant for -# others. Also some project authors may have temporary files here -# that are not under version control and thus shouldn't be archived -# (although this is bad practice, but that is up to the user). +# 'tex/src'. This is important because the git commit hash goes in +# the tarball name (should correspond to it) and some project authors +# may have temporary files here that are not under version control +# and thus shouldn't be archived (although this is bad practice, but +# that is up to the user). # # To keep the sub-directory structure, we are packaging the files # with Tar, piping it, and unpacking it in the archive directory. So @@ -362,17 +353,20 @@ $(project-package-contents): paper.pdf | $(texdir) rm -rf $$dir/tex/build/build* # If the project has any PDFs in its 'tex/tikz' directory (TiKZ or -# PGFPlots was used to generate them), copy them too. +# PGFPlots was used to generate them), copy them too. Note that in +# the main project source, 'tex/tikz' is just a symbolic link to +# 'tex/build/tikz'. But inside the tarball we do not want to have +# symbolic links and they should be independent. if ls tex/tikz/*.pdf &> /dev/null; then cp tex/tikz/*.pdf $$dir/tex/tikz fi # When submitting to places like arXiv, they will just run LaTeX once -# and won't run 'biber'. So we need to also keep the '.bbl' file into -# the distributing tarball. However, BibLaTeX is particularly -# sensitive to versioning (a '.bbl' file has to be read by the same -# BibLaTeX version that created it). This is hard to do with -# non-up-to-date places like arXiv. Therefore, we thus just copy the +# and won't run 'biber' or 'biblatex'. So we need to also keep the +# '.bbl' file into the distributing tarball. However, BibLaTeX is +# particularly sensitive to versioning (a '.bbl' file has to be read +# by the same BibLaTeX version that created it). This is hard to do +# with non-up-to-date places like arXiv. Therefore, we just copy the # whole of BibLaTeX's source (the version we are using) into the top # tarball directory. In this way, arXiv's LaTeX engine will use the # same BibLaTeX version to interpret the '.bbl' file. TIP: you can @@ -521,7 +515,10 @@ $(inputdatasets): $(indir)/%: | $(indir) $(lockdir) # Unrecognized format. *) - echo "Maneage: 'DATABASEAUTHTYPE' format not recognized! Please see the description of this variable in 'reproduce/software/config/LOCAL.conf' for the acceptable values."; exit 1;; + printf "Maneage: 'DATABASEAUTHTYPE' format not recognized! " + printf "Please see the description of this variable in " + printf "'$(bsdir)/config/LOCAL.conf' for the acceptable " + printf "values."; exit 1;; esac fi diff --git a/reproduce/analysis/make/paper.mk b/reproduce/analysis/make/paper.mk index 66c6859..a399637 100644 --- a/reproduce/analysis/make/paper.mk +++ b/reproduce/analysis/make/paper.mk @@ -18,6 +18,7 @@ + # LaTeX macros for paper # ---------------------- # @@ -92,6 +93,38 @@ $(mtexdir)/project.tex: $(mtexdir)/verify.tex +# TeX build directory +# ------------------- +# +# If built in a group scenario, the TeX build directory must be separate +# for each member (so they can work on their relevant parts of the paper +# without conflicting with each other). +ifeq ($(strip $(maneage_group_name)),) +texbdir:=$(texdir)/build +else +texbdir:=$(texdir)/build-$(shell whoami) +endif +tikzdir:=$(texbdir)/tikz + + + + + +# Software info in TeX +# -------------------- +# +# The information of the installed software is placed in the +# '.build/software' directory (which the TeX build should not depend +# on). Therefore, we should copy those macros here in the LaTeX build +# directory, so the TeX directory is completely independent from each +# other. +$(mtexdir)/dependencies.tex: $(bsdir)/config/dependencies.tex + cp $(bsdir)/config/*.tex $(mtexdir)/ + + + + + # The bibliography # ---------------- # @@ -104,8 +137,9 @@ $(mtexdir)/project.tex: $(mtexdir)/verify.tex # recipe and the 'paper.pdf' recipe. But if 'tex/src/references.tex' hasn't # been modified, we don't want to re-build the bibliography, only the final # PDF. -$(texbdir)/paper.bbl: tex/src/references.tex $(mtexdir)/dependencies-bib.tex \ +$(texbdir)/paper.bbl: tex/src/references.tex $(mtexdir)/dependencies.tex \ | $(mtexdir)/project.tex + # If '$(mtexdir)/project.tex' is empty, don't build PDF. @macros=$$(cat $(mtexdir)/project.tex) if [ x"$$macros" != x ]; then @@ -130,12 +164,11 @@ $(texbdir)/paper.bbl: tex/src/references.tex $(mtexdir)/dependencies-bib.tex \ # for details. # # We need the modification to 'LD_LIBRARY_PATH' because we do not -# build LaTeX from source and it uses '/bin/sh' (among other -# possible system-wide things). - export LD_LIBRARY_PATH="$(sys_library_sh_path):$$LD_LIBRARY_PATH" +# build LaTeX from source and it (or its packages) may use +# '/bin/sh' (among other possible system-wide things). + export LD_LIBRARY_PATH="$(SYS_LIBRARY_SH_PATH):$$LD_LIBRARY_PATH" pdflatex -shell-escape -halt-on-error "$$p"/paper.tex biber paper - fi @@ -165,9 +198,9 @@ paper.pdf: $(mtexdir)/project.tex paper.tex $(texbdir)/paper.bbl # option '-shell-escape'. # # We need the modification to 'LD_LIBRARY_PATH' because we do not -# build LaTeX from source and it uses '/bin/sh' (among other -# possible system-wide things). - export LD_LIBRARY_PATH="$(sys_library_sh_path):$$LD_LIBRARY_PATH" +# build LaTeX from source and it (or its packages) may use +# '/bin/sh' (among other possible system-wide things). + export LD_LIBRARY_PATH="$(SYS_LIBRARY_SH_PATH):$$LD_LIBRARY_PATH" pdflatex -shell-escape -halt-on-error "$$p"/paper.tex # Come back to the top project directory and copy the built PDF diff --git a/reproduce/analysis/make/prepare.mk b/reproduce/analysis/make/prepare.mk index 2cc1187..ffb2a3c 100644 --- a/reproduce/analysis/make/prepare.mk +++ b/reproduce/analysis/make/prepare.mk @@ -25,7 +25,7 @@ # # We need to remove the 'prepare' word from the list of 'makesrc'. prepare-dep = $(filter-out prepare, $(makesrc)) -$(bsdir)/preparation-done.mk: \ +$(badir)/preparation-done.mk: \ $(foreach s, $(prepare-dep), $(mtexdir)/$(s).tex) # If you need to add preparations (mainly automatically generated diff --git a/reproduce/analysis/make/top-make.mk b/reproduce/analysis/make/top-make.mk index 2689e64..e87aed8 100644 --- a/reproduce/analysis/make/top-make.mk +++ b/reproduce/analysis/make/top-make.mk @@ -19,9 +19,9 @@ -# Load the local configuration (created after running -# './project configure'). -include reproduce/software/config/LOCAL.conf +# Load the local configuration (created after running './project +# configure'). +include .build/software/config/LOCAL.conf diff --git a/reproduce/analysis/make/top-prepare.mk b/reproduce/analysis/make/top-prepare.mk index 7d92d72..d2d1c14 100644 --- a/reproduce/analysis/make/top-prepare.mk +++ b/reproduce/analysis/make/top-prepare.mk @@ -23,9 +23,9 @@ -# Load the local configuration (created after running -# './project configure'). -include reproduce/software/config/LOCAL.conf +# Load the local configuration (created after running './project +# configure'). +include .build/software/config/LOCAL.conf @@ -36,7 +36,7 @@ include reproduce/software/config/LOCAL.conf # # See 'top-make.mk' for complete explanation. ifeq (x$(maneage_group_name),x$(GROUP-NAME)) -all: $(BDIR)/software/preparation-done.mk +all: $(BDIR)/analysis/preparation-done.mk @echo "Project preparation is complete."; else all: |