source: doc/theses/mike_brooks_MMath/Makefile

Last change on this file was eb0d9b7, checked in by Michael Brooks <mlbrooks@…>, 2 weeks 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
RevLine 
[bbf6a180]1# Configuration variables
[8e819a9]2
[bbf6a180]3Build = build
[f85de47]4
5Benchmarks = benchmarks
[bbf6a180]6Pictures = pictures
[f85de47]7Plots = plots
[bbf6a180]8Programs = programs
[8e819a9]9
[297b796]10LaTMac = ../../LaTeXmacros
11BibRep = ../../bibliography
12
[eb0d9b7]13strip-top-dir = $(foreach p,$1,$(patsubst %/,%,$(subst $(firstword $(subst /, ,$(p)))/,, $(p))))
14
15.SUFFIXES: # disable make built-in rules
16
[bbf6a180]17TeXSRC = ${wildcard *.tex}
[a7d93cb]18PicSRC = ${notdir ${wildcard ${Pictures}/*.png}} ${notdir ${wildcard ${Pictures}/*.fig}}
[873e96c]19PicSRC := ${PicSRC:.fig=.pdf} # substitute ".fig" with ".pdf"
[f85de47]20PlotSRC = ${notdir ${wildcard ${Plots}/*.gp}}
[873e96c]21PlotSRC := ${addprefix ${Build}/plot-,${PlotSRC:.gp=.pdf}} # substitute ".gp" with ".pdf"
[489d3ba]22DemoPgmSRC = ${notdir ${wildcard ${Programs}/*-demo.cfa}}
[5717495]23PgmSRC = ${notdir ${wildcard ${Programs}/*}}
24RunPgmSRC = ${notdir ${wildcard ${Programs}/*.run.*}}
[eb0d9b7]25NondemoPgmSRC = ${call strip-top-dir,${wildcard ${Programs}/*/*.c*}}
[bbf6a180]26BibSRC = ${wildcard *.bib}
[8e819a9]27
[297b796]28TeXLIB = .:${LaTMac}:${Build}: # common latex macros
29BibLIB = .:${BibRep}: # common citation repository
[8e819a9]30
[5717495]31#MAKEFLAGS = --no-print-directory # --silent
[bbf6a180]32VPATH = ${Build} ${Pictures} ${Programs} # extra search path for file names used in document
[8e819a9]33
[bbf6a180]34DOCUMENT = uw-ethesis.pdf
35BASE = ${basename ${DOCUMENT}} # remove suffix
[8e819a9]36
[5717495]37RunPgmExe = ${addprefix ${Build}/,${basename ${basename ${RunPgmSRC}}}}
38RunPgmOut = ${RunPgmExe:%=%.out}
[489d3ba]39DemoPgmExe = ${addprefix ${Build}/,${basename ${basename ${DemoPgmSRC}}}}
40DemoPgmOut = ${DemoPgmExe:%=%.out}
[5717495]41
[bbf6a180]42# Commands
[8e819a9]43
[bbf6a180]44LaTeX = TEXINPUTS=${TeXLIB} && export TEXINPUTS && pdflatex -halt-on-error -output-directory=${Build}
45BibTeX = BIBINPUTS=${BibLIB} && export BIBINPUTS && bibtex
[5717495]46CFA = cfa -O0 -g
47CC = gcc -O0 -g
48CXX = g++-11 --std=c++20 -O0 -g
[8e819a9]49
[bbf6a180]50# Rules and Recipes
[8e819a9]51
[873e96c]52.PHONY : all clean # not file names
[489d3ba]53.SECONDARY:
54#.PRECIOUS : ${Build}/% # don't delete intermediates
[bbf6a180]55.ONESHELL :
[8e819a9]56
[489d3ba]57all : ${DOCUMENT}
[8e819a9]58
59clean :
[bbf6a180]60 @rm -frv ${DOCUMENT} ${Build}
61
62# File Dependencies
63
[eb0d9b7]64${DOCUMENT}: ${TeXSRC} $(RunPgmOut) ${DemoPgmOut} ${NondemoPgmSRC} ${PlotSRC} ${PicSRC} ${BibSRC} ${BibRep}/pl.bib ${LaTMac}/common.tex Makefile | ${Build}
[a7d93cb]65 echo ${PicSRC}
[f85de47]66 echo ${GraphSRC_OLD}
[bbf6a180]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}
[8e819a9]74 cp ${Build}/$@ $@
75
76${Build}:
[bbf6a180]77 mkdir -p $@
78
[5717495]79${Build}/%-demo: ${Programs}/%-demo.cfa | ${Build}
80 ${CFA} $< -o $@
81
[489d3ba]82${Build}/%: ${Programs}/%-demo.cfa | ${Build}
83 ${CFA} $< -o $@
84
[873e96c]85${Build}/%: ${Programs}/%.run.cfa | ${Build} # cfa cannot handle pipe
[b64d0f4]86 sed -f ${Programs}/sedcmd $< > ${Build}/tmp.cfa; ${CFA} ${Build}/tmp.cfa -o $@
[5717495]87
88${Build}/%: ${Programs}/%.run.c | ${Build}
[b64d0f4]89 sed -f ${Programs}/sedcmd $< | ${CC} -x c -I ${Programs} -o $@ -
[5717495]90
91${Build}/%: ${Programs}/%.run.cpp | ${Build}
[b64d0f4]92 sed -f ${Programs}/sedcmd $< | ${CXX} -x c++ -I ${Programs} -o $@ -
[bbf6a180]93
[5717495]94${Build}/%.out: ${Build}/% | ${Build}
95 $< > $@
[8e819a9]96
[a7d93cb]97%.pdf: %.fig | ${Build}
98 fig2dev -L pdf $< > ${Build}/$@
99
[2410424]100-include $(Plots)/*.d
[f85de47]101
[16a843b]102${Build}/plot-%.dat: ${Plots}/%.py ${Plots}/common.py ${Plots}/ListCommon.py ${Plots}/%.py.INPUTS | ${Build}
[f85de47]103 python3 $< > $@
104
105${Build}/plot-%.pdf: ${Plots}/%.gp ${Plots}/%.gp.INPUTS | ${Build}
106 gnuplot $<
107
[a7d93cb]108#-include ${Build}/*.d
[16a843b]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.