summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/exframe/exfsermk.mak
blob: af8b29063e491d483e1933a5cb8ce1bfcc2ca427 (plain)
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
MAIN = exfserm
SOURCE = exfser
PROBLEM = exfserp
SCRIPT = exfsermk.sh
MAKEFILE = exfsermk.mak
TARGETLIST = Problems Solutions
SHEETNUM = 01 02 03 aa
PREREQS = $(MAIN).tex
SOURCES = $(SHEETNUM:%=$(SOURCE)%.tex)
SHEETS = $(foreach trg,$(TARGETLIST),$(trg).pdf $(SHEETNUM:%=$(trg)%.pdf))
TARGETS = $(foreach trg,$(TARGETLIST),$(trg).pdf)
GENFILES = $(foreach trg,$(TARGETLIST),$(trg).tex $(SHEETNUM:%=$(trg)%.tex))
BAKFILES = $(SOURCES) $(MAIN).tex $(MAKEFILE) $(SCRIPT) $(PROBLEM)*

default: sheets ;
sheets: $(SHEETS) ;
main: $(TARGETS) ;
sheet%: $(foreach trg,$(TARGETLIST),$(trg)%.pdf) ;
all: main sheets ;
sources: $(GENFILES) ;

$(TARGETS): $(SOURCES) $(PREREQS)
	bash ./$(SCRIPT) $@
$(word 1,$(TARGETLIST))%.pdf: $(SOURCE)%.tex $(PREREQS)
	bash ./$(SCRIPT) $@
$(word 2,$(TARGETLIST))%.pdf: $(SOURCE)%.tex $(PREREQS)
	bash ./$(SCRIPT) $@
$(GENFILES):
	bash ./$(SCRIPT) $@

touch:
	touch $(MAIN).tex
clean:
	rm -f $(SHEETNUM:%=$(SOURCE)%.aux)
	rm -f $(SHEETNUM:%=$(SOURCE)%.log)
	rm -f $(foreach trg,$(TARGETLIST),$(SHEETNUM:%=$(trg)%.log) $(trg).log)
	rm -f $(patsubst %,$(MAIN)%,.aux .log .out .toc)
	rm -f $(patsubst %,$(MAIN)%,.mp .mpx -*.mps -tmp.log -tmp.mp -tmp.mpx)
	rm -f mpxerr.tex mpxerr.log mpxerr.dvi texput.log
	rm -f $(patsubst %,$(PROBLEM)*%,.aux .log .mp .mpx -*.mps)
	rm -f $(patsubst %,$(PROBLEM)*%,-tmp.log -tmp.mp -tmp.mpx)
clean-bak:
	rm -f $(BAKFILES:%=%~) $(BAKFILES:%=%.bak)
clean-all:  clean
	rm -f $(SHEETS) $(TARGETS)
	rm -f $(SHEETNUM:%=$(SOURCE)%.pdf) $(MAIN).pdf
	rm -f $(foreach trg,$(TARGETLIST),$(SHEETNUM:%=$(trg)%.tex) $(trg).tex)
	rm -f $(PROBLEM)*.pdf