Debian Codegraph @

texmf-dist/doc/latex/cdpbundl/Makefile

raw
1 # makefile
2 #
3 # 2018 Feb 08
4 #
5 # Macro definitions
6 ROOT_NAME = cdpbundl
7 DTX_NAME = $(ROOT_NAME).dtx
8 INS_NAME = $(ROOT_NAME).ins
9 DOC_AUX_FIL = $(ROOT_NAME).aux $(ROOT_NAME).log \
10 $(ROOT_NAME).glo $(ROOT_NAME).gls \
11 $(ROOT_NAME).idx $(ROOT_NAME).ind \
12 $(ROOT_NAME).ilg $(ROOT_NAME).glg \
13 $(ROOT_NAME).toc $(ROOT_NAME).lof \
14 $(ROOT_NAME).hd $(ROOT_NAME).out
15 DOCUM_FILE = $(ROOT_NAME).pdf
16 CODE_FILES = letteracdp.cls \
17 articoletteracdp.cls \
18 cdpaddon.sty \
19 cdpbabel.sty \
20 *.ldf \
21 *.def \
22 cdpshues.cfg
23 #
24 LATEX = pdflatex
25 MAKEINDEX = makeindex
26
27 #
28 define GEN_FAKE_INDEX
29 @echo '\\begin{theindex}' > $(ROOT_NAME).ind
30 @echo '\\end{theindex}' >> $(ROOT_NAME).ind
31 @echo "Generating fake .ind file."
32 endef
33 #
34 define GEN_FAKE_GLOSSARY
35 @echo '\\begin{theglossary}' > $(ROOT_NAME).gls
36 @echo '\\end{theglossary}' >> $(ROOT_NAME).gls
37 @echo "Generating fake .gls file."
38 endef
39
40
41
42 .PHONY: default
43 .PHONY: code doc
44 .PHONY: clean cleandoc cleanaux cleancode cleanall
45 .PHONY: help
46
47 # Default target
48 default: doc code
49
50 # Generating the code
51 ################################################################
52 # #
53 # PLEASE NOTE THAT THE INSTALLER SCRIPT IS EXECUTED WITH #
54 # openout_any=r #
55 # #
56 ################################################################
57 code:
58 openout_any=r tex $(INS_NAME)
59
60 # Generating the documentation
61 doc: $(DOCUM_FILE)
62
63 $(DOCUM_FILE): $(DTX_NAME)
64 # Hack for getting index and glossary in the toc since first run:
65 $(GEN_FAKE_INDEX)
66 $(GEN_FAKE_GLOSSARY)
67 # We know how many runs are needed:
68 $(LATEX) $(DTX_NAME)
69 $(LATEX) $(DTX_NAME)
70 $(MAKEINDEX) -s gind.ist -t $(ROOT_NAME).ilg -o $(ROOT_NAME).ind \
71 $(ROOT_NAME).idx
72 $(MAKEINDEX) -s gglo.ist -t $(ROOT_NAME).glg -o $(ROOT_NAME).gls \
73 $(ROOT_NAME).glo
74 $(LATEX) $(DTX_NAME)
75 $(LATEX) $(DTX_NAME)
76
77 # Cleaning up: command "make clean" defaults to "make cleanall"
78 clean: cleanall
79
80 # Cleaning the code files
81 cleancode:
82 -rm $(CODE_FILES)
83
84 # Cleaning the documentation files
85 cleandoc: cleanaux
86 -rm $(DOCUM_FILE)
87
88 # Cleanng just the auxiliary files used in producing the documentation
89 cleanaux:
90 -rm $(DOC_AUX_FIL)
91
92 # Cleaning up all the generated files
93 cleanall: cleancode cleandoc
94
95 # Giving help
96 help:
97 @echo "Here is a list of the available commands:"
98 @echo
99 @echo " make"
100 @echo " Generate both the code and the documentation (see below)."
101 @echo
102 @echo " make code"
103 @echo " Generate the LaTeX sources for all the classes, packages,"
104 @echo " definition files, etc. of the C.D.P. Bundle; these files go"
105 @echo " into the LaTeX input directories."
106 @echo
107 @echo " make doc"
108 @echo " Generate the documentation (in PDF); the resulting PDF file"
109 @echo " goes into the LaTeX documentation directories (the auxiliary"
110 @echo " files may be discarded)."
111 @echo
112 @echo " make clean"
113 @echo " make cleanall"
114 @echo " These two commands are synonyms; they remove all of the"
115 @echo " generated files (both code and documentation)."
116 @echo
117 @echo " make cleancode"
118 @echo " Remove the LaTeX source files (the \"code files\")."
119 @echo
120 @echo " make cleandoc"
121 @echo " Remove the documentation, together with all the auxiliary"
122 @echo " files used to generate it."
123 @echo
124 @echo " make cleanaux"
125 @echo " Remove only the auxiliary files used to generate the"
126 @echo " documentation."
127 @echo
128 @echo " make help"
129 @echo " Print this help message."
130 @echo
131