# plots: plots : pythonplots gnuplots # python plots: PYFILES=$(wildcard *.py) PYFILES := $(filter-out dattomat.py, $(PYFILES)) PYPDFFILES=$(PYFILES:.py=.pdf) pythonplots : $(PYPDFFILES) $(PYPDFFILES) : %.pdf: %.py ../../plotstyle.py PYTHONPATH="../../" python3 $< cleanpythonplots : rm -f $(PYPDFFILES) # gnuplot plots: GPTFILES=$(wildcard *.gpt) GPTTEXFILES=$(GPTFILES:.gpt=.tex) gnuplots : $(GPTTEXFILES) $(GPTTEXFILES) : %.tex: %.gpt whitestyles.gp gnuplot whitestyles.gp $< epstopdf $*.eps cleangnuplots : rm -f $(GPTTEXFILES) # script: chapter : $(BASENAME)-chapter.pdf $(BASENAME)-chapter.pdf : $(BASENAME)-chapter.tex $(BASENAME).tex $(wildcard $(BASENAME).aux) $(PYPDFFILES) $(GPTTEXFILES) ../../header.tex if test -f $(BASENAME).aux; then \ CHAPTER=$$(( $$(sed -n -e '/contentsline {chapter}/{s/.*numberline {\([0123456789]*\)}.*/\1/; p; q}' $(BASENAME).aux) - 1 )); \ PAGE=$$(sed -n -e '/contentsline {chapter}/{s/.*numberline {.*}.*}{\(.*\)}{chapter.*/\1/; p; q}' $(BASENAME).aux); \ fi; \ { echo $${PAGE:=1}; echo $${CHAPTER:=0}; } | pdflatex -interaction=scrollmode $< | tee /dev/stderr | fgrep -q "Rerun to get cross-references right" && { echo $${PAGE:=1}; echo $${CHAPTER:=0}; } | pdflatex -interaction=scrollmode $< || true watchchapter : while true; do ! make -q chapter && make chapter; sleep 0.5; done cleantex: rm -f *~ rm -f $(BASENAME).aux $(BASENAME).log *.idx rm -f $(BASENAME)-chapter.aux $(BASENAME)-chapter.log $(BASENAME)-chapter.out $(BASENAME)-chapter.idx $(BASENAME)-chapter-solutions.tex $(BASENAME)-solutions.tex cleanplots: cleanpythonplots cleangnuplots cleanchapter : cleanplots cleantex cleanallchapter : cleanchapter rm -f $(BASENAME)-chapter.pdf