source: doc/theses/mike_brooks_MMath/Makefile @ 1803d4d

ast-experimental
Last change on this file since 1803d4d was 5717495, checked in by Michael Brooks <mlbrooks@…>, 20 months ago

Start of the linked-list chapter.

  • Property mode set to 100644
File size: 2.0 KB
RevLine 
[bbf6a180]1# Configuration variables
[8e819a9]2
[bbf6a180]3Build = build
4Pictures = pictures
5Programs = programs
[8e819a9]6
[bbf6a180]7TeXSRC = ${wildcard *.tex}
8PicSRC = ${notdir ${wildcard ${Pictures}/*.png}}
9DemoSRC = ${notdir ${wildcard ${Programs}/*-demo.cfa}}
[5717495]10PgmSRC = ${notdir ${wildcard ${Programs}/*}}
11RunPgmSRC = ${notdir ${wildcard ${Programs}/*.run.*}}
[bbf6a180]12BibSRC = ${wildcard *.bib}
[8e819a9]13
[bbf6a180]14TeXLIB = .:../../LaTeXmacros:${Build}:          # common latex macros
15BibLIB = .:../../bibliography                   # common citation repository
[8e819a9]16
[5717495]17#MAKEFLAGS = --no-print-directory # --silent
[bbf6a180]18VPATH = ${Build} ${Pictures} ${Programs} # extra search path for file names used in document
[8e819a9]19
[bbf6a180]20DOCUMENT = uw-ethesis.pdf
21BASE = ${basename ${DOCUMENT}}                  # remove suffix
[8e819a9]22
[5717495]23DemoTex = ${DemoSRC:%.cfa=${Build}/%.tex} 
24RunPgmExe = ${addprefix ${Build}/,${basename ${basename ${RunPgmSRC}}}}
25RunPgmOut = ${RunPgmExe:%=%.out}
26
[bbf6a180]27# Commands
[8e819a9]28
[bbf6a180]29LaTeX = TEXINPUTS=${TeXLIB} && export TEXINPUTS && pdflatex -halt-on-error -output-directory=${Build}
30BibTeX = BIBINPUTS=${BibLIB} && export BIBINPUTS && bibtex
[5717495]31CFA = cfa -O0 -g
32CC  = gcc -O0 -g
33CXX = g++-11 --std=c++20 -O0 -g
[8e819a9]34
[bbf6a180]35# Rules and Recipes
[8e819a9]36
[5717495]37.PHONY : all fragments_ran clean                        # not file names
38.PRECIOUS : ${Build}/% ${Build}/%-demo      # don't delete intermediates
[bbf6a180]39.ONESHELL :
[8e819a9]40
[5717495]41all : fragments_ran ${DOCUMENT}
42
43fragments_ran : $(RunPgmOut)
[8e819a9]44
45clean :
[bbf6a180]46        @rm -frv ${DOCUMENT} ${Build}
47
48# File Dependencies
49
[5717495]50%.pdf : ${TeXSRC} ${DemoTex} ${PicSRC} ${PgmSRC} ${BibSRC} Makefile | ${Build}
[bbf6a180]51        ${LaTeX} ${BASE}
52        ${BibTeX} ${Build}/${BASE}
53        ${LaTeX} ${BASE}
54        # if needed, run latex again to get citations
55        if fgrep -s "LaTeX Warning: Citation" ${basename $@}.log ; then ${LaTeX} ${BASE} ; fi
56#       ${Glossary} ${Build}/${BASE}
57#       ${LaTeX} ${BASE}
[8e819a9]58        cp ${Build}/$@ $@
59
60${Build}:
[bbf6a180]61        mkdir -p $@
62
63%-demo.tex: %-demo | ${Build}
[5717495]64        $< > $@
65
66${Build}/%-demo: ${Programs}/%-demo.cfa | ${Build}
67        ${CFA} $< -o $@
68
69${Build}/%: ${Programs}/%.run.cfa | ${Build}
70        ${CFA} $< -o $@
71
72${Build}/%: ${Programs}/%.run.c | ${Build}
73        ${CC}  $< -o $@
74
75${Build}/%: ${Programs}/%.run.cpp | ${Build}
76        ${CXX} -MMD $< -o $@
[bbf6a180]77
[5717495]78${Build}/%.out: ${Build}/% | ${Build}
79        $< > $@
[8e819a9]80
[5717495]81-include ${Build}/*.d
Note: See TracBrowser for help on using the repository browser.