testディレクトリーをsampleに変更
[makefiles.git] / latex_mk / sample / toc / Makefile
1 TEXTARGETS := toc.pdf
2
3 CMP := cmp -s
4 DIFF := diff
5 PATCH := patch
6
7 .PHONY: all add update rebase clean distclean
8
9 $(TEXTARGETS):
10
11 all:
12         @$(MAKE) -s toc_1.pdf
13         @$(ECHO) '--------------------'
14         @$(MAKE) -s toc_2.pdf
15         @$(ECHO) '--------------------'
16         @$(MAKE) -s toc_3.pdf
17
18 toc_1.pdf: rebase
19         @$(ECHO) '---------- $@: $^ ----------'
20         @$(MAKE) -s toc.pdf
21         @$(CP) -v toc.pdf $@
22
23 toc_2.pdf: add
24         @$(ECHO) '---------- $@: $^ ----------'
25         @$(MAKE) -s toc.pdf
26         @$(CP) -v toc.pdf $@
27
28 toc_3.pdf: update
29         @$(ECHO) '---------- $@: $^ ----------'
30         @$(MAKE) -s toc.pdf
31         @$(CP) -v toc.pdf $@
32
33 add: toc.tex.5th_add.patch
34         @$(PATCH) <$<
35
36 toc.tex.5th_add.patch: rebase
37         @$(DIFF) -u toc.tex toc.tex.5th_add >$@ || exit 0
38
39 update: toc.tex.6th.patch
40         @$(PATCH) <$<
41
42 toc.tex.6th.patch: rebase
43         @$(DIFF) -u toc.tex toc.tex.6th >$@ || exit 0
44
45 rebase:
46         $(CMP) toc.tex.5th toc.tex || $(CP) -v toc.tex.5th toc.tex
47
48 include latex.mk
49
50 clean: tex-clean
51
52 distclean: rebase tex-distclean
53         $(RM) *.patch
54         $(RM) toc_*.pdf