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