source: doc/theses/mike_brooks_MMath/Makefile @ 489d3ba

Last change on this file since 489d3ba was 489d3ba, checked in by Peter A. Buhr <pabuhr@…>, 43 hours ago

change how latex code generated from sharing-demo.cfa

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