-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
42 lines (39 loc) Β· 833 Bytes
/
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
# compile
VIEWER = zathura
ENGINE = -lualatex
EXEC = latexmk
# files
SRC = main
SRCCN = main-cn
OUTPUTDIR = public
DISTDIR = dist
# ref
TARGETTEXFILE = $(SRC).tex
TARGETTEXFILECN = $(SRCCN).tex
OUTPUTPDFFILE = $(OUTPUTDIR)/$(SRC).pdf
OUTPUTPDFFILECN = $(OUTPUTDIR)/$(SRCCN).pdf
# PDFLANGCN="true"
update:
-rm -rf $(DISTDIR) && mkdir $(DISTDIR)
# en
$(EXEC) $(ENGINE) $(TARGETTEXFILE)
-cp $(OUTPUTPDFFILE) $(DISTDIR)
ifeq ($(PDFLANGCN), "true")
$(EXEC) $(ENGINE) $(TARGETTEXFILECN)
-cp $(OUTPUTPDFFILECN) $(DISTDIR)
@echo "π Generated extra cn pdf"
else
@echo "π Didable generate cn pdf"
endif
@echo "π Generated en pdf"
view:
$(VIEWER) $(OUTPUTPDFFILE)
view-cn:
ifeq ($(PDFLANGCN), "true")
$(VIEWER) $(OUTPUTPDFFILECN)
else
@echo "π The cn pdf not updated"
endif
.PHONY: clean
clean:
-rm -rf $(OUTPUTDIR)