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