From 65c47dfeb7ef9a8ffae7b0dc407548cb4b5d0b18 Mon Sep 17 00:00:00 2001 From: Gustav Eek Date: Wed, 12 Feb 2014 20:53:08 +0100 Subject: New makefile procedure added for 2014 The procedure consists of that a common makefile holds all crucial procedures. The makefiles in the different directories are just wrappers. This commit contains those modifications for 2014. It remains to implement the same for previous years. --- 2014/Makefile | 17 +++++++++++++ resources/Makefile-common | 64 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 81 insertions(+) create mode 100644 2014/Makefile create mode 100644 resources/Makefile-common diff --git a/2014/Makefile b/2014/Makefile new file mode 100644 index 0000000..fc286bb --- /dev/null +++ b/2014/Makefile @@ -0,0 +1,17 @@ +# Makefile for minutes of 2014 + +MINUTES = 2014-02-11-board + +common-makefile = ../resources/Makefile-common + +help: + @make -s -f $(common-makefile) help + +all: $(MINUTES) + +%: + make -f $(common-makefile) compile FILE=$* +send: + make -f $(common-makefile) send SEND_FILES="$(MINUTES)" +clean: + make -f $(common-makefile) clean diff --git a/resources/Makefile-common b/resources/Makefile-common new file mode 100644 index 0000000..9ba957f --- /dev/null +++ b/resources/Makefile-common @@ -0,0 +1,64 @@ +# This Makefile is used as common denominator for the compilation of a +# PDF file from a minutes. +# +# Commands +# +# compile: Create the pdf file +# +# Mandatory arguments +# FILE -- name of tex file without surfixes +# Optional arguments +# PREAMBLE -- path to preamble without surfixes (defaults) +# FILES_TEX -- list of dependency tex-files without surfixes +# FILES_JPG -- list of dependency jgp-images without surfixes +# +# send: Sends pdf files to server +# +# Mandatory arguments +# SEND_FILES -- list of files to send (without prefixes) +# +# clean: clears all generated files +# + +FILE = +PREAMBLE = ../preamble/preamble +FILES_TEX = +FILES_JPG = +SEND_FILES = + +input = $(FILE).tex +output = $(FILE).pdf +preamble = $(PREAMBLE).tex +files-tex = $(foreach f, $(FILES_TEX), $(f).tex) +files-jgp = $(foreach f, $(FILES_JPG), $(f).jpg) +send-files = $(foreach f, $(SEND_FILES), $(f).pdf) + +compile: $(output) + +# The most general latex compilation command +$(output): $(input) $(preamble) $(files-tex) $(files-jpg) + latex_count=5 ;\ + latex_log=$$(echo $@ | sed 's/.pdf/.log/') ;\ + pdflatex $< ;\ + while egrep -s 'Rerun (LaTeX|to get cross-references right)' $$latex_log && [ $$latex_count -gt 0 ] ;\ + do echo "Rerunning latex...." ; pdflatex $< ;\ + latex_count=`expr $$latex_count - 1`;\ + done; + +# Clean up +clean: + rm -f *.aux *.bbl *.dvi *.log *.nav *.out *.snm *.toc *~ + +# Sends to fripost.org for publication +send: + rsync -ruvp --chmod=Dugo+rx,Fugo+r $(send-files) fripost@fripost.org:fripost.org/minutes/ + +# Help +help: + @echo 'This script do not run without arguments. Run for example:' + @echo + @echo ' $ make 2014-02-13-board-notes.pdf' + @echo ' $ make all' + @echo ' $ make send' + @echo ' $ make clean' + -- cgit v1.2.3