-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
59 lines (52 loc) · 1.39 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
TEX = pdflatex
FILE1 = BDDs-Aula1
FILE2 = BDDs-Aula2
OUTPUT_DIR = output
TEXMFOUTPUT = $(OUTPUT_DIR)
FORMAT ?= full
# Definition of basic commands according to the operating system.
$(info Target platform: $(OS))
ifeq ($(OS),Windows_NT)
RM=del /s/q
MD=mkdir
SEP=\\
CP=copy
else
RM=rm -rf
MD=mkdir -p
SEP=/
CP=cp
endif
ifeq ($(FORMAT),wide)
ASPECTRATIO1 = "\def\classopts{,aspectratio=169}\input{" $(FILE1) "}"
ASPECTRATIO2 = "\def\classopts{,aspectratio=169}\input{" $(FILE2) "}"
JOBNAME1 = $(FILE1)-wide
JOBNAME2 = $(FILE2)-wide
else
ASPECTRATIO1 = ""
ASPECTRATIO2 = ""
JOBNAME1 = $(FILE1)-full
JOBNAME2 = $(FILE2)-full
endif
all: aula1 aula2
aula1: $(FILE1).tex
ifeq ($(OS),Windows_NT)
if not exist $(OUTPUT_DIR) $(MD) $(OUTPUT_DIR)
else
$(MD) $(OUTPUT_DIR)
endif
$(TEX) $(ASPECTRATIO1) -job-name=$(JOBNAME1) -output-directory $(OUTPUT_DIR) $(FILE1).tex
aula2: $(FILE2).tex
ifeq ($(OS),Windows_NT)
if not exist $(OUTPUT_DIR) $(MD) $(OUTPUT_DIR)
else
$(MD) $(OUTPUT_DIR)
endif
$(TEX) $(ASPECTRATIO2) -job-name=$(JOBNAME2) -output-directory $(OUTPUT_DIR) $(FILE2).tex
clean:
$(RM) $(OUTPUT_DIR)$(SEP)*.aux $(OUTPUT_DIR)$(SEP)*.log\
$(OUTPUT_DIR)$(SEP)*.toc $(OUTPUT_DIR)$(SEP)*.out\
$(OUTPUT_DIR)$(SEP)*.blg $(OUTPUT_DIR)$(SEP)*.bbl\
$(OUTPUT_DIR)$(SEP)*.nav $(OUTPUT_DIR)$(SEP)*.snm
clean_all: clean
$(RM) $(OUTPUT_DIR)$(SEP)*.pdf