makeで現在のTeXファイル、make allで全バージョンのTeXファイルをそれぞれ処理するよう仕様変更
[makefiles.git] / latex_mk / test / toc / Makefile
1 TEXTARGETS := toc.pdf
2
3 CMP := cmp -s
4 DIFF := diff
5 PATCH := patch
6
7 .PHONY: all 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
16 toc_1.pdf: rebase
17         @$(ECHO) '---------- $@: $^ ----------'
18         @$(MAKE) -s toc.pdf
19         @$(CP) -v toc.pdf $@
20
21 toc_2.pdf: update
22         @$(ECHO) '---------- $@: $^ ----------'
23         @$(MAKE) -s toc.pdf
24         @$(CP) -v toc.pdf $@
25
26 update: toc.tex.6th.patch
27         @$(PATCH) <$<
28
29 toc.tex.6th.patch:
30         @$(MAKE) -s rebase
31         @$(DIFF) -u toc.tex toc.tex.6th >$@ || exit 0
32
33 rebase:
34         $(CMP) toc.tex.5th toc.tex || $(CP) -v toc.tex.5th toc.tex
35
36 include latex.mk
37
38 clean: tex-clean
39
40 distclean: rebase tex-distclean
41         $(RM) *.patch
42         $(RM) toc_*.pdf