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