1 | # Configuration variables
|
---|
2 |
|
---|
3 | Build = build
|
---|
4 | Pictures = pictures
|
---|
5 | Programs = programs
|
---|
6 |
|
---|
7 | LaTMac = ../../LaTeXmacros
|
---|
8 | BibRep = ../../bibliography
|
---|
9 |
|
---|
10 | TeXSRC = ${wildcard *.tex}
|
---|
11 | PicSRC = ${notdir ${wildcard ${Pictures}/*.png}} ${notdir ${wildcard ${Pictures}/*.fig}}
|
---|
12 | PicSRC := ${PicSRC:.fig=.pdf} # substitute ".fig" with ".pdf"
|
---|
13 | GraphSRC = ${notdir ${wildcard ${Pictures}/*.dat}}
|
---|
14 | GraphSRC := ${GraphSRC:.dat=.pdf} # substitute ".dat" with ".pdf"
|
---|
15 | DemoPgmSRC = ${notdir ${wildcard ${Programs}/*-demo.cfa}}
|
---|
16 | PgmSRC = ${notdir ${wildcard ${Programs}/*}}
|
---|
17 | RunPgmSRC = ${notdir ${wildcard ${Programs}/*.run.*}}
|
---|
18 | BibSRC = ${wildcard *.bib}
|
---|
19 |
|
---|
20 | TeXLIB = .:${LaTMac}:${Build}: # common latex macros
|
---|
21 | BibLIB = .:${BibRep}: # common citation repository
|
---|
22 |
|
---|
23 | #MAKEFLAGS = --no-print-directory # --silent
|
---|
24 | VPATH = ${Build} ${Pictures} ${Programs} # extra search path for file names used in document
|
---|
25 |
|
---|
26 | DOCUMENT = uw-ethesis.pdf
|
---|
27 | BASE = ${basename ${DOCUMENT}} # remove suffix
|
---|
28 |
|
---|
29 | RunPgmExe = ${addprefix ${Build}/,${basename ${basename ${RunPgmSRC}}}}
|
---|
30 | RunPgmOut = ${RunPgmExe:%=%.out}
|
---|
31 | DemoPgmExe = ${addprefix ${Build}/,${basename ${basename ${DemoPgmSRC}}}}
|
---|
32 | DemoPgmOut = ${DemoPgmExe:%=%.out}
|
---|
33 |
|
---|
34 | # Commands
|
---|
35 |
|
---|
36 | LaTeX = TEXINPUTS=${TeXLIB} && export TEXINPUTS && pdflatex -halt-on-error -output-directory=${Build}
|
---|
37 | BibTeX = BIBINPUTS=${BibLIB} && export BIBINPUTS && bibtex
|
---|
38 | CFA = cfa -O0 -g
|
---|
39 | CC = gcc -O0 -g
|
---|
40 | CXX = g++-11 --std=c++20 -O0 -g
|
---|
41 |
|
---|
42 | # Rules and Recipes
|
---|
43 |
|
---|
44 | .PHONY : all clean # not file names
|
---|
45 | .SECONDARY:
|
---|
46 | #.PRECIOUS : ${Build}/% # don't delete intermediates
|
---|
47 | .ONESHELL :
|
---|
48 |
|
---|
49 | all : ${DOCUMENT}
|
---|
50 |
|
---|
51 | clean :
|
---|
52 | @rm -frv ${DOCUMENT} ${Build}
|
---|
53 |
|
---|
54 | # File Dependencies
|
---|
55 |
|
---|
56 | ${DOCUMENT}: ${TeXSRC} $(RunPgmOut) ${DemoPgmOut} ${GraphSRC} ${PicSRC} ${BibSRC} ${BibRep}/pl.bib ${LaTMac}/common.tex Makefile | ${Build}
|
---|
57 | echo ${PicSRC}
|
---|
58 | echo ${GraphSRC}
|
---|
59 | ${LaTeX} ${BASE}
|
---|
60 | ${BibTeX} ${Build}/${BASE}
|
---|
61 | ${LaTeX} ${BASE}
|
---|
62 | # if needed, run latex again to get citations
|
---|
63 | if fgrep -s "LaTeX Warning: Citation" ${basename $@}.log ; then ${LaTeX} ${BASE} ; fi
|
---|
64 | # ${Glossary} ${Build}/${BASE}
|
---|
65 | # ${LaTeX} ${BASE}
|
---|
66 | cp ${Build}/$@ $@
|
---|
67 |
|
---|
68 | ${Build}:
|
---|
69 | mkdir -p $@
|
---|
70 |
|
---|
71 | ${Build}/%-demo: ${Programs}/%-demo.cfa | ${Build}
|
---|
72 | ${CFA} $< -o $@
|
---|
73 |
|
---|
74 | ${Build}/%: ${Programs}/%-demo.cfa | ${Build}
|
---|
75 | ${CFA} $< -o $@
|
---|
76 |
|
---|
77 | ${Build}/%: ${Programs}/%.run.cfa | ${Build} # cfa cannot handle pipe
|
---|
78 | sed -f ${Programs}/sedcmd $< > ${Build}/tmp.cfa; ${CFA} ${Build}/tmp.cfa -o $@
|
---|
79 |
|
---|
80 | ${Build}/%: ${Programs}/%.run.c | ${Build}
|
---|
81 | sed -f ${Programs}/sedcmd $< | ${CC} -x c -I ${Programs} -o $@ -
|
---|
82 |
|
---|
83 | ${Build}/%: ${Programs}/%.run.cpp | ${Build}
|
---|
84 | sed -f ${Programs}/sedcmd $< | ${CXX} -x c++ -I ${Programs} -o $@ -
|
---|
85 |
|
---|
86 | ${Build}/%.out: ${Build}/% | ${Build}
|
---|
87 | $< > $@
|
---|
88 |
|
---|
89 | string-graph-peq-cppemu.pdf: string-graph-peq-cppemu.dat plot-peq-cppemu.gp | ${Build}
|
---|
90 | gnuplot plot-peq-cppemu.gp
|
---|
91 |
|
---|
92 | string-graph-peq-sharing.pdf: string-graph-peq-sharing.dat plot-peq-sharing.gp | ${Build}
|
---|
93 | gnuplot plot-peq-sharing.gp
|
---|
94 |
|
---|
95 | string-graph-pta-sharing.pdf: string-graph-pta-sharing.dat plot-pta-sharing.gp | ${Build}
|
---|
96 | gnuplot plot-pta-sharing.gp
|
---|
97 |
|
---|
98 | string-graph-pbv.pdf: string-graph-pbv.dat plot-pbv.gp | ${Build}
|
---|
99 | gnuplot plot-pbv.gp
|
---|
100 |
|
---|
101 | string-graph-allocn.pdf: string-graph-allocn.dat plot-allocn.gp | ${Build}
|
---|
102 | gnuplot plot-allocn.gp
|
---|
103 |
|
---|
104 | %.pdf: %.fig | ${Build}
|
---|
105 | fig2dev -L pdf $< > ${Build}/$@
|
---|
106 |
|
---|
107 | #-include ${Build}/*.d
|
---|