|
1 | | -RESUME=resume_leonardo_uieda |
| 1 | +# The name of the main .tex file to build. |
| 2 | +# Other files can be included into this one. |
| 3 | +PROJECT = leonardo_uieda_cv |
2 | 4 |
|
3 | | -$(RESUME).pdf: $(RESUME).tex |
4 | | - pdflatex $< |
5 | | - #bibtex $(RESUME) |
6 | | - pdflatex $< |
7 | | - pdflatex $< |
| 5 | +# Folder with the Latex source files |
| 6 | +SRC = . |
8 | 7 |
|
9 | | -spellcheck: |
10 | | - aspell check $(RESUME).tex |
| 8 | +# Folder where the figure files are (will assume they are EPSs or PNGs) |
| 9 | +FIGS = figures |
11 | 10 |
|
12 | | -show: $(RESUME).pdf |
13 | | - evince $(RESUME).pdf & |
| 11 | +# Folder where the BibTex .bib files are |
| 12 | +BIB = . |
14 | 13 |
|
15 | | -clean: |
16 | | - rm -rf *.bbl *.blg *.aux *.out *.log $(RESUME).pdf $(RESUME).dvi |
| 14 | +# Folder where the .cls .bst and .sty style files are |
| 15 | +STYLES = $(SRC) |
| 16 | + |
| 17 | +# Folder where output will be placed |
| 18 | +OUTPUT = output |
| 19 | + |
| 20 | +### File Types (for dependencies) |
| 21 | +TEX_FILES = $(shell find $(SRC) -maxdepth 1 -name '*.tex') |
| 22 | +STY_FILES = $(shell find $(STYLES) -maxdepth 1 -name '*.sty') |
| 23 | +CLS_FILES = $(shell find $(STYLES) -maxdepth 1 -name '*.cls') |
| 24 | +BST_FILES = $(shell find $(STYLES) -maxdepth 1 -name '*.bst') |
| 25 | +EPS_FILES = $(shell find $(FIGS) -name '*.eps') |
| 26 | +PNG_FILES = $(shell find $(FIGS) -name '*.png') |
| 27 | + |
| 28 | +### Compilation Flags |
| 29 | +LATEX_FLAGS = -halt-on-error -output-directory $(OUTPUT)/ |
| 30 | + |
| 31 | +### Standard PDF Viewers |
| 32 | +UNAME := $(shell uname) |
| 33 | +ifeq ($(UNAME), Linux) |
| 34 | +PDFVIEWER = evince |
| 35 | +endif |
| 36 | +ifeq ($(UNAME), Darwin) |
| 37 | +PDFVIEWER = open |
| 38 | +endif |
| 39 | + |
| 40 | + |
| 41 | +# MAIN TARGETS |
| 42 | +############################################################################### |
| 43 | + |
| 44 | +all: $(OUTPUT)/$(PROJECT).pdf |
| 45 | + |
| 46 | +show: all |
| 47 | + @ # Redirect stdout and stderr to /dev/null for silent execution |
| 48 | + @ (${PDFVIEWER} $(OUTPUT)/$(PROJECT).pdf > /dev/null 2>&1 & ) |
| 49 | + |
| 50 | +### Clean |
| 51 | +# This target cleans the temporary files generated by the tex programs in |
| 52 | +# use. All temporary files generated by this makefile will be placed in OUTPUT |
| 53 | +# so cleanup is easy. |
| 54 | +clean:: |
| 55 | + rm -rf $(OUTPUT)/ *.aux |
| 56 | + rm -rf $(FIGS)/*-eps-converted-to.pdf |
| 57 | + |
| 58 | +$(OUTPUT)/: |
| 59 | + mkdir -p $(OUTPUT)/ |
| 60 | + |
| 61 | +$(OUTPUT)/$(PROJECT).aux: $(TEX_FILES) $(STY_FILES) $(CLS_FILES) $(PNG_FILES) $(EPS_FILES) | $(OUTPUT)/ |
| 62 | + pdflatex $(LATEX_FLAGS) $(SRC)/$(PROJECT) |
| 63 | + |
| 64 | +$(OUTPUT)/$(PROJECT).pdf: $(OUTPUT)/$(PROJECT).aux |
| 65 | + pdflatex $(LATEX_FLAGS) $(SRC)/$(PROJECT) 1>/dev/null |
0 commit comments