diff options
Diffstat (limited to 'reproduce/analysis/make/initialize.mk')
-rw-r--r-- | reproduce/analysis/make/initialize.mk | 36 |
1 files changed, 25 insertions, 11 deletions
diff --git a/reproduce/analysis/make/initialize.mk b/reproduce/analysis/make/initialize.mk index 7e9e938..7f0c514 100644 --- a/reproduce/analysis/make/initialize.mk +++ b/reproduce/analysis/make/initialize.mk @@ -97,11 +97,9 @@ endif # doesn't change anything. ifeq (x$(GROUP-NAME),x) texbtopdir = build -final-paper = paper.pdf else user = $(shell whoami) texbtopdir = build-$(user) -final-paper = paper-$(user).pdf endif texbdir = $(texdir)/$(texbtopdir) tikzdir = $(texbdir)/tikz @@ -139,6 +137,7 @@ curdir := $(shell echo $$(pwd)) # we are also going to overwrite 'TEXINPUTS' just before 'pdflatex'. .ONESHELL: .SHELLFLAGS = -ec +export TERM=xterm export TEXINPUTS := export CCACHE_DISABLE := 1 export PATH := $(installdir)/bin @@ -210,8 +209,11 @@ $(lockdir): | $(bsdir); mkdir $@ # Version and distribution tarball definitions -project-commit-hash := $(shell if [ -d .git ]; then \ - echo $$(git describe --dirty --always --long); else echo NOGIT; fi) +project-commit-hash := $(shell \ + if [ -d .git ]; then \ + export LD_LIBRARY_PATH="$(installdir)/lib"; \ + echo $$($(installdir)/bin/git describe --dirty --always --long); \ + else echo NOGIT; fi) project-package-name := maneaged-$(project-commit-hash) project-package-contents = $(texdir)/$(project-package-name) @@ -287,15 +289,19 @@ $(project-package-contents): paper.pdf | $(texdir) dir=$@ rm -rf $$dir mkdir $$dir + curdir=$$(pwd) # Build a small Makefile to help in automatizing the paper building # (including the bibliography). m=$$dir/Makefile echo "paper.pdf: paper.tex paper.bbl" > $$m - printf "\tpdflatex -shell-escape -halt-on-error paper\n" >> $$m + printf "\tlatex -shell-escape -halt-on-error paper\n" >> $$m + printf "\tlatex -shell-escape -halt-on-error paper\n" >> $$m + printf "\tdvips paper.dvi\n" >> $$m + printf "\tps2pdf -dNOSAFER paper.ps\n" >> $$m echo "paper.bbl: tex/src/references.tex" >> $$m - printf "\tpdflatex -shell-escape -halt-on-error paper\n" >> $$m - printf "\tbiber paper\n" >> $$m + printf "\tlatex -shell-escape -halt-on-error paper\n" >> $$m + printf "\tbibtex paper\n" >> $$m echo ".PHONY: clean" >> $$m echo "clean:" >> $$m printf "\trm -f *.aux *.auxlock *.bbl *.bcf\n" >> $$m @@ -321,7 +327,7 @@ $(project-package-contents): paper.pdf | $(texdir) # To keep the sub-directory structure, we are packaging the files # with Tar, piping it, and unpacking it in the archive directory. So # afterwards we need to come back to the current directory. - tar -c -f - $$(git ls-files reproduce tex/src) \ + tar -c -f - $$(git ls-files peer-review reproduce tex/src) \ | (cd $$dir ; tar -x -f -) cd $(curdir) @@ -335,6 +341,8 @@ $(project-package-contents): paper.pdf | $(texdir) # using Bash's extended globbing ('extglob') for excluding this # directory. shopt -s extglob + cp -r tex/img $$dir/tex/img + cp tex/tikz/*.eps $$dir/tex/tikz cp -r tex/build/!($(project-package-name)) $$dir/tex/build # Clean up the $(texdir)/build* directories in the archive (when @@ -362,8 +370,8 @@ $(project-package-contents): paper.pdf | $(texdir) # problems on the arXiv server. cp tex/build/build/paper.bbl $$dir/ tltopdir=.local/texlive/maneage/texmf-dist/tex/latex - find $$tltopdir/biblatex/ -maxdepth 1 -type f -print0 \ - | xargs -0 cp -t $$dir + #find $$tltopdir/biblatex/ -maxdepth 1 -type f -print0 \ + # | xargs -0 cp -t $$dir # Just in case the package users want to rebuild some of the figures # (manually un-comment the 'makepdf' command we commented above), @@ -375,7 +383,8 @@ $(project-package-contents): paper.pdf | $(texdir) # PROJECT SPECIFIC # ---------------- # Put any project-specific distribution steps here. - + cd $$curdir + cp tex/build/build/appendix.bbl $$dir/ # ---------------- # Clean temporary files that may have been created by text editors. @@ -514,6 +523,11 @@ $(mtexdir)/initialize.tex: | $(mtexdir) echo "\newcommand{\projectgitrepo}{$(metadata-git-repository)}" >> $@ echo "\newcommand{\projectcopyrightowner}{$(metadata-copyright-owner)}" >> $@ + # arXiv/Zenodo identifier (necessary for download link): + echo "\newcommand{\projectarxivid}{$(metadata-arxiv)}" >> $@ + v=$$(echo $(metadata-doi-zenodo) | sed -e's/\./ /g' | awk '{print $$NF}') + echo "\newcommand{\projectzenodoid}{$$v}" >> $@ + # Calculate the latest Maneage commit used to build this project: # - The project may not have the 'maneage' branch (for example # after cloning from a fork that didn't include it!). In this |