blob: b6b663f2aa28483a770935cfddef8baf1fe7b967 (
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
|
# $Id: Makefile 628 2007-07-10 20:32:06Z martin $
PACKAGE=svn-multi
PACKFILES = ${PACKAGE}.dtx ${PACKAGE}.ins ${PACKAGE}.pdf svn-multi-pl.dtx svn-multi.pl example_main.tex \
example_chap1.tex example.pdf Makefile README group_example.tex
TEXAUX = *.aux *.log *.glo *.ind *.idx *.out *.svn *.svx *.svt *.toc *.ilg *.gls *.hd
TESTDIR = tests
TESTS = $(patsubst %.tex,%,$(subst ${TESTDIR}/,,$(wildcard ${TESTDIR}/test?.tex ${TESTDIR}/test??.tex))) # look for all test*.tex file names and remove the '.tex'
TESTARGS = -output-directory ${TESTDIR}
INSGENERATED = ${PACKAGE}.sty svnkw.sty svn-multi.pl
GENERATED = ${INSGENERATED} ${PACKAGE}.pdf svn-multi-pl.pdf example.pdf group_example.pdf group_example_*.tex ${PACKAGE}.zip ${PACKAGE}.tar.gz ${TESTDIR}/test*.pdf
ZIPFILE = ${PACKAGE}-${ZIPVERSION}.zip
LATEX_OPTIONS = -interaction=batchmode
LATEX = pdflatex ${LATEX_OPTIONS}
RED = \033[01;31m
GREEN = \033[01;32m
WHITE = \033[00m
.PHONY: all doc package clean fullclean example testclean ${TESTS}
all: package doc example
new: fullclean all
doc: ${PACKAGE}.pdf svn-multi-pl.pdf
package: ${PACKAGE}.sty ${PACKAGE}.pl
%.pdf: %.dtx
${LATEX} $*.dtx
${LATEX} $*.dtx
-makeindex -s gind.ist -o $*.ind $*.idx
-makeindex -s gglo.ist -o $*.gls $*.glo
${LATEX} $*.dtx
${LATEX} $*.dtx
%.pdf: %.eps
epstopdf $<
%.eps: %.dia
dia -t eps -e $@ $<
${PACKAGE}.pdf:
${INSGENERATED}: *.dtx ${PACKAGE}.ins
yes | latex ${PACKAGE}.ins
@-chmod +x *.pl
clean:
rm -f ${TEXAUX} $(addprefix ${TESTDIR}/, ${TEXAUX})
fullclean:
rm -f ${TEXAUX} $(addprefix ${TESTDIR}/, ${TEXAUX}) ${GENERATED} *~ *.backup
example: example.pdf gexample
example.pdf: example_main.tex example_chap1.tex ${PACKAGE}.sty
${LATEX} $<
perl ./svn-multi.pl $<
${LATEX} $<
mv example_main.pdf $@
gexample: group_example.pdf
group_example.pdf: group_example.tex svn-multi.sty
${RM} $(addprefix group_example, ${TEXAUX}) group_example_*.tex
${LATEX} $<
${LATEX} $<
perl svn-multi.pl group_example
${LATEX} $<
${LATEX} $<
${LATEX} $<
zip: fullclean package doc example tests ${ZIPFILE}
${PACKAGE}.zip: zip
zip: ZIPVERSION=$(shell grep 'Package: svn-multi ' svn-multi.log | \
sed -e 's/.*Package: svn-multi ....\/..\/..\s\+\(v\S\+\).*/\1/')
${ZIPFILE}: ${PACKFILES}
grep -q '\* Checksum passed \*' svn-multi.log
grep -q '\* Checksum passed \*' svn-multi-pl.log
-pdfopt ${PACKAGE}.pdf opt_${PACKAGE}.pdf && mv opt_${PACKAGE}.pdf ${PACKAGE}.pdf
zip ${ZIPFILE} ${PACKFILES}
@echo
@echo "ZIP file ${ZIPFILE} created!"
tar.gz: ${PACKAGE}.tar.gz
${PACKAGE}.tar.gz:
tar -czf $@ ${PACKFILES}
# Make sure TeX finds the input files in TESTDIR
tests ${TESTS}: export TEXINPUTS:=${TEXINPUTS}:${TESTDIR}
tests ${TESTS}: LATEX_OPTIONS=
testclean:
@${RM} $(foreach ext, aux log out pdf svn svx, tests/test*.${ext})
tests: package testclean
@echo "Running tests: ${TESTS}:"
@${MAKE} -e -i --no-print-directory ${TESTS} \
TESTARGS="-interaction=batchmode -output-directory=${TESTDIR}"\
TESTPLOPT="-q"\
> /dev/null
${TESTS}: % : ${TESTDIR}/%.tex package testclean
@-${LATEX} -interaction=nonstopmode ${TESTARGS} $< 1>/dev/null 2>/dev/null
@if test -e ${TESTDIR}/$*.svn; then perl ./svn-multi.pl ${TESTDIR}/$* 1>/dev/null ; fi
@if (${LATEX} ${TESTARGS} $< && (test ! -e ${TESTDIR}/$*.pl || ${TESTDIR}/$*.pl ${TESTPLOPT})); \
then /bin/echo -e "${GREEN}$@ succeeded${WHITE}" >&2; \
else /bin/echo -e "${RED}$@ failed!!!!!!${WHITE}" >&2; fi
|