[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}}
|
---|
| 15 | PicSRC := ${PicSRC:.fig=.pdf} # substitute ".fig" with ".pdf"
|
---|
[f85de47] | 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"
|
---|
[489d3ba] | 22 | DemoPgmSRC = ${notdir ${wildcard ${Programs}/*-demo.cfa}}
|
---|
[5717495] | 23 | PgmSRC = ${notdir ${wildcard ${Programs}/*}}
|
---|
| 24 | RunPgmSRC = ${notdir ${wildcard ${Programs}/*.run.*}}
|
---|
[bbf6a180] | 25 | BibSRC = ${wildcard *.bib}
|
---|
[8e819a9] | 26 |
|
---|
[297b796] | 27 | TeXLIB = .:${LaTMac}:${Build}: # common latex macros
|
---|
| 28 | BibLIB = .:${BibRep}: # common citation repository
|
---|
[8e819a9] | 29 |
|
---|
[5717495] | 30 | #MAKEFLAGS = --no-print-directory # --silent
|
---|
[bbf6a180] | 31 | VPATH = ${Build} ${Pictures} ${Programs} # extra search path for file names used in document
|
---|
[8e819a9] | 32 |
|
---|
[bbf6a180] | 33 | DOCUMENT = uw-ethesis.pdf
|
---|
| 34 | BASE = ${basename ${DOCUMENT}} # remove suffix
|
---|
[8e819a9] | 35 |
|
---|
[5717495] | 36 | RunPgmExe = ${addprefix ${Build}/,${basename ${basename ${RunPgmSRC}}}}
|
---|
| 37 | RunPgmOut = ${RunPgmExe:%=%.out}
|
---|
[489d3ba] | 38 | DemoPgmExe = ${addprefix ${Build}/,${basename ${basename ${DemoPgmSRC}}}}
|
---|
| 39 | DemoPgmOut = ${DemoPgmExe:%=%.out}
|
---|
[5717495] | 40 |
|
---|
[bbf6a180] | 41 | # Commands
|
---|
[8e819a9] | 42 |
|
---|
[bbf6a180] | 43 | LaTeX = TEXINPUTS=${TeXLIB} && export TEXINPUTS && pdflatex -halt-on-error -output-directory=${Build}
|
---|
| 44 | BibTeX = BIBINPUTS=${BibLIB} && export BIBINPUTS && bibtex
|
---|
[5717495] | 45 | CFA = cfa -O0 -g
|
---|
| 46 | CC = gcc -O0 -g
|
---|
| 47 | CXX = g++-11 --std=c++20 -O0 -g
|
---|
[8e819a9] | 48 |
|
---|
[bbf6a180] | 49 | # Rules and Recipes
|
---|
[8e819a9] | 50 |
|
---|
[f85de47] | 51 | .PHONY : all clean # not file names
|
---|
[489d3ba] | 52 | .SECONDARY:
|
---|
| 53 | #.PRECIOUS : ${Build}/% # don't delete intermediates
|
---|
[bbf6a180] | 54 | .ONESHELL :
|
---|
[8e819a9] | 55 |
|
---|
[489d3ba] | 56 | all : ${DOCUMENT}
|
---|
[8e819a9] | 57 |
|
---|
| 58 | clean :
|
---|
[bbf6a180] | 59 | @rm -frv ${DOCUMENT} ${Build}
|
---|
| 60 |
|
---|
| 61 | # File Dependencies
|
---|
| 62 |
|
---|
[f85de47] | 63 | ${DOCUMENT}: ${TeXSRC} $(RunPgmOut) ${DemoPgmOut} ${GraphSRC_OLD} ${PlotSRC} ${PicSRC} ${BibSRC} ${BibRep}/pl.bib ${LaTMac}/common.tex Makefile | ${Build}
|
---|
[a7d93cb] | 64 | echo ${PicSRC}
|
---|
[f85de47] | 65 | echo ${GraphSRC_OLD}
|
---|
[bbf6a180] | 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}
|
---|
[8e819a9] | 73 | cp ${Build}/$@ $@
|
---|
| 74 |
|
---|
| 75 | ${Build}:
|
---|
[bbf6a180] | 76 | mkdir -p $@
|
---|
| 77 |
|
---|
[5717495] | 78 | ${Build}/%-demo: ${Programs}/%-demo.cfa | ${Build}
|
---|
| 79 | ${CFA} $< -o $@
|
---|
| 80 |
|
---|
[489d3ba] | 81 | ${Build}/%: ${Programs}/%-demo.cfa | ${Build}
|
---|
| 82 | ${CFA} $< -o $@
|
---|
| 83 |
|
---|
[b64d0f4] | 84 | ${Build}/%: ${Programs}/%.run.cfa | ${Build} # cfa cannot handle pipe
|
---|
| 85 | sed -f ${Programs}/sedcmd $< > ${Build}/tmp.cfa; ${CFA} ${Build}/tmp.cfa -o $@
|
---|
[5717495] | 86 |
|
---|
| 87 | ${Build}/%: ${Programs}/%.run.c | ${Build}
|
---|
[b64d0f4] | 88 | sed -f ${Programs}/sedcmd $< | ${CC} -x c -I ${Programs} -o $@ -
|
---|
[5717495] | 89 |
|
---|
| 90 | ${Build}/%: ${Programs}/%.run.cpp | ${Build}
|
---|
[b64d0f4] | 91 | sed -f ${Programs}/sedcmd $< | ${CXX} -x c++ -I ${Programs} -o $@ -
|
---|
[bbf6a180] | 92 |
|
---|
[5717495] | 93 | ${Build}/%.out: ${Build}/% | ${Build}
|
---|
| 94 | $< > $@
|
---|
[8e819a9] | 95 |
|
---|
[b1c220a] | 96 | string-graph-peq-sharing.pdf: string-graph-peq-sharing.dat plot-peq-sharing.gp | ${Build}
|
---|
| 97 | gnuplot plot-peq-sharing.gp
|
---|
[a7d93cb] | 98 |
|
---|
[07293ad] | 99 | string-graph-pta-sharing.pdf: string-graph-pta-sharing.dat plot-pta-sharing.gp | ${Build}
|
---|
[a7d93cb] | 100 | gnuplot plot-pta-sharing.gp
|
---|
| 101 |
|
---|
[07293ad] | 102 | string-graph-pbv.pdf: string-graph-pbv.dat plot-pbv.gp | ${Build}
|
---|
[a7d93cb] | 103 | gnuplot plot-pbv.gp
|
---|
| 104 |
|
---|
[07293ad] | 105 | string-graph-allocn.pdf: string-graph-allocn.dat plot-allocn.gp | ${Build}
|
---|
[048dde4] | 106 | gnuplot plot-allocn.gp
|
---|
| 107 |
|
---|
[a7d93cb] | 108 | %.pdf: %.fig | ${Build}
|
---|
| 109 | fig2dev -L pdf $< > ${Build}/$@
|
---|
| 110 |
|
---|
[f85de47] | 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 |
|
---|
[a7d93cb] | 120 | #-include ${Build}/*.d
|
---|