[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} |
---|
| 11 | PicSRC = ${notdir ${wildcard ${Pictures}/*.png}} |
---|
[489d3ba] | 12 | DemoPgmSRC = ${notdir ${wildcard ${Programs}/*-demo.cfa}} |
---|
[5717495] | 13 | PgmSRC = ${notdir ${wildcard ${Programs}/*}} |
---|
| 14 | RunPgmSRC = ${notdir ${wildcard ${Programs}/*.run.*}} |
---|
[bbf6a180] | 15 | BibSRC = ${wildcard *.bib} |
---|
[8e819a9] | 16 | |
---|
[297b796] | 17 | TeXLIB = .:${LaTMac}:${Build}: # common latex macros |
---|
| 18 | BibLIB = .:${BibRep}: # common citation repository |
---|
[8e819a9] | 19 | |
---|
[5717495] | 20 | #MAKEFLAGS = --no-print-directory # --silent |
---|
[bbf6a180] | 21 | VPATH = ${Build} ${Pictures} ${Programs} # extra search path for file names used in document |
---|
[8e819a9] | 22 | |
---|
[bbf6a180] | 23 | DOCUMENT = uw-ethesis.pdf |
---|
| 24 | BASE = ${basename ${DOCUMENT}} # remove suffix |
---|
[8e819a9] | 25 | |
---|
[5717495] | 26 | RunPgmExe = ${addprefix ${Build}/,${basename ${basename ${RunPgmSRC}}}} |
---|
| 27 | RunPgmOut = ${RunPgmExe:%=%.out} |
---|
[489d3ba] | 28 | DemoPgmExe = ${addprefix ${Build}/,${basename ${basename ${DemoPgmSRC}}}} |
---|
| 29 | DemoPgmOut = ${DemoPgmExe:%=%.out} |
---|
[5717495] | 30 | |
---|
[bbf6a180] | 31 | # Commands |
---|
[8e819a9] | 32 | |
---|
[bbf6a180] | 33 | LaTeX = TEXINPUTS=${TeXLIB} && export TEXINPUTS && pdflatex -halt-on-error -output-directory=${Build} |
---|
| 34 | BibTeX = BIBINPUTS=${BibLIB} && export BIBINPUTS && bibtex |
---|
[5717495] | 35 | CFA = cfa -O0 -g |
---|
| 36 | CC = gcc -O0 -g |
---|
| 37 | CXX = g++-11 --std=c++20 -O0 -g |
---|
[8e819a9] | 38 | |
---|
[bbf6a180] | 39 | # Rules and Recipes |
---|
[8e819a9] | 40 | |
---|
[489d3ba] | 41 | .PHONY : all clean # not file names |
---|
| 42 | .SECONDARY: |
---|
| 43 | #.PRECIOUS : ${Build}/% # don't delete intermediates |
---|
[bbf6a180] | 44 | .ONESHELL : |
---|
[8e819a9] | 45 | |
---|
[489d3ba] | 46 | all : ${DOCUMENT} |
---|
[8e819a9] | 47 | |
---|
| 48 | clean : |
---|
[bbf6a180] | 49 | @rm -frv ${DOCUMENT} ${Build} |
---|
| 50 | |
---|
| 51 | # File Dependencies |
---|
| 52 | |
---|
[489d3ba] | 53 | %.pdf : ${TeXSRC} $(RunPgmOut) ${DemoPgmOut} ${PicSRC} ${BibSRC} ${BibRep}/pl.bib ${LaTMac}/common.tex Makefile | ${Build} |
---|
[bbf6a180] | 54 | ${LaTeX} ${BASE} |
---|
| 55 | ${BibTeX} ${Build}/${BASE} |
---|
| 56 | ${LaTeX} ${BASE} |
---|
| 57 | # if needed, run latex again to get citations |
---|
| 58 | if fgrep -s "LaTeX Warning: Citation" ${basename $@}.log ; then ${LaTeX} ${BASE} ; fi |
---|
| 59 | # ${Glossary} ${Build}/${BASE} |
---|
| 60 | # ${LaTeX} ${BASE} |
---|
[8e819a9] | 61 | cp ${Build}/$@ $@ |
---|
| 62 | |
---|
| 63 | ${Build}: |
---|
[bbf6a180] | 64 | mkdir -p $@ |
---|
| 65 | |
---|
[5717495] | 66 | ${Build}/%-demo: ${Programs}/%-demo.cfa | ${Build} |
---|
| 67 | ${CFA} $< -o $@ |
---|
| 68 | |
---|
[489d3ba] | 69 | ${Build}/%: ${Programs}/%-demo.cfa | ${Build} |
---|
| 70 | ${CFA} $< -o $@ |
---|
| 71 | |
---|
[b64d0f4] | 72 | ${Build}/%: ${Programs}/%.run.cfa | ${Build} # cfa cannot handle pipe |
---|
| 73 | sed -f ${Programs}/sedcmd $< > ${Build}/tmp.cfa; ${CFA} ${Build}/tmp.cfa -o $@ |
---|
[5717495] | 74 | |
---|
| 75 | ${Build}/%: ${Programs}/%.run.c | ${Build} |
---|
[b64d0f4] | 76 | sed -f ${Programs}/sedcmd $< | ${CC} -x c -I ${Programs} -o $@ - |
---|
[5717495] | 77 | |
---|
| 78 | ${Build}/%: ${Programs}/%.run.cpp | ${Build} |
---|
[b64d0f4] | 79 | sed -f ${Programs}/sedcmd $< | ${CXX} -x c++ -I ${Programs} -o $@ - |
---|
[bbf6a180] | 80 | |
---|
[5717495] | 81 | ${Build}/%.out: ${Build}/% | ${Build} |
---|
| 82 | $< > $@ |
---|
[8e819a9] | 83 | |
---|
[5717495] | 84 | -include ${Build}/*.d |
---|