]> hydra-www.ietfng.org Git - mcv-academic/commitdiff
Add makefile to example
authoradin <adin@ic.unicamp.br>
Wed, 31 Aug 2016 13:37:11 +0000 (10:37 -0300)
committeradin <adin@ic.unicamp.br>
Wed, 31 Aug 2016 13:37:11 +0000 (10:37 -0300)
example/Makefile [new file with mode: 0644]

diff --git a/example/Makefile b/example/Makefile
new file mode 100644 (file)
index 0000000..66fcc43
--- /dev/null
@@ -0,0 +1,33 @@
+# Our languages
+LANGS = en es
+
+# Default source options
+NAME = example
+SOURCE = $(NAME: %=%.tex)
+DETAILS = true
+
+# Rules
+all: $(LANGS)
+
+# Default make to build these rules instead of files in case they exist
+.PHONY: all clean veryclean $(LANGS)
+
+# we need to clean before compiling a new language
+$(LANGS): clean        
+       # compile the language
+       $(eval INPUT="\def\defaultlang{\selectshortlanguage{$@}\details$(DETAILS)}\input{$(SOURCE)}")
+       pdflatex -interaction=nonstopmode $(INPUT) -jobname=$(NAME) || true
+       pdflatex -interaction=nonstopmode $(INPUT) -jobname=$(NAME) 
+       biber $(NAME)
+       pdflatex -interaction=nonstopmode $(INPUT) -jobname=$(NAME) || true
+       pdflatex -interaction=nonstopmode $(INPUT) -jobname=$(NAME) 
+       # if it finishes move the file to the correct name
+       mv $(NAME).pdf $(NAME)-$@.pdf
+
+
+# ignoramos los errores con -
+clean:
+       rm *.log *.aux *.out *.blg *.bbl *.run.xml *.bcf || true
+
+veryclean: clean
+       rm *.pdf || true
\ No newline at end of file