source: doc/theses/mike_brooks_MMath/Makefile @ 048dde4

Last change on this file since 048dde4 was 048dde4, checked in by Michael Brooks <mlbrooks@…>, 3 days ago

Rough-in gnuplot for "allocn" string graph

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