aboutsummaryrefslogtreecommitdiff
path: root/Makefile.common
blob: cf57b5d0cbc5bda61a09eee1d8d942351ac7cf84 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
### Makefile.common --- -*- mode: makefile -*-
#
# This file defines common settings for all test cases
#
# Time-stamp: <2024-02-17 11:07:10 ax006ho>
#
# (c) 2013- Jobst Hoffmann
#
# This file is distributed under the terms of the LaTeX Project Public
# License from CTAN archives in directory  macros/latex/base/lppl.txt.
# Either version 1.3c or, at your option, any later version.

# remember:
# $<: first element of list of dependees
# $^: list of (all) dependees
# $@: target

EMPTY  :=
SPACE  := $(EMPTY) $(EMPTY)
COMMA  := ,

# comma separated list of basenames - no spaces in between the list
# allowed

BASENAMES = $(subst $(SPACE),$(COMMA),${SOURCES:.tex=})
ifneq (,$(findstring $(COMMA), ${BASENAMES}))
	BASENAMES := {$(BASENAMES)}
else
	BASENAMES := $(BASENAMES)
endif

.PHONY: all echo

.SUFFIXES: .pdf .tex

all: ${SOURCES:.tex=.pdf}

LATEX = pdflatex
# to put the files from the development tree to the first position to be searched
TEXINPUTS := .:../../../:`kpsewhich -var-value=TEXINPUTS`

VPATH = .:../../../:${HOME}/texmf/tex/latex/listings:../../languages/c:../../languages/fortran:

## Clean targets
clean:
	-rm -f  *~ ${BASENAMES}.{aux,synctex.gz,lof,log,lol,lot,tmp,toc}
	-rm -f ${BASENAMES}.{idx,ind,glg,glo,gls,ilg,out}
	-rm -f ${BASENAMES}.{bbl,bcf,blg,brf,run.xml}

clean-results:
	-rm -f ${BASENAMES}.{pdf,sty}

realclean:  clean clean-results

## Documentation target
help::
	$(info )
	$(info make [all]	executes all tests in the current directory)
	$(info )
	$(info make <file name>)
	$(info $(EMPTY)		executes the test case given by <file name>)
	$(info )
	$(info make help	shows this help)
	$(info )
	$(info make clean	removes all intermediate files created by a LaTeX run)
	$(info )
	$(info make clean-results)
	$(info $(EMPTY)		removes .sty, and .pdf files)
	$(info )
	$(info make realclean)
	$(info $(EMPTY)		performs clean and clean-results)
	$(info )
	@echo ""					# prevents message "nothing to do ..."

%.pdf: %.tex
	TEXINPUTS=${TEXINPUTS} $(LATEX) $(<)

### Makefile.common ends here ---

Return to:

Send suggestions and report system problems to the System administrator.