source: doc/theses/mike_brooks_MMath/Makefile

Last change on this file was eb0d9b7, checked in by Michael Brooks <mlbrooks@…>, 4 hours ago

Improve libcfa-array's bound-check removal and write that thesis section.

The libcfa change adds a more performant alternative for a subset of multidimensional indexing cases that were already functionally correct.
That the new alternative is more performant is not shown in the test suite.
There is an associated new high-performance option for passing an array-or-slice to a function.
The added test cases cover those options.

The added in-thesis demos rely on the new more-performant alternative for multidimensional indexing.

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