summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/generic/FAQ-en/Makefile
blob: 1345d541131fa71e9825a0d837d7548d43790abb (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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
# define variables WEB, WEB_BETA, CGI_BIN, HOME_DIR, CTAN_HOME, CTAN_ROOT
include locations.mk

# list of subdocuments of gather-faqbody
include subdocuments.mk

BODY	= gather-faqbody.tex filectan.tex dirctan.tex $(SUBDOCS)
MACROS	= faq.cls faq.sty
CONFIGS	= archive.cfg
CMFONTS	= cmz
PATCH   = newfaq-patch.tex add-general.tex add-hammond.tex
MAKEF	= Makefile

HTML_TAR = FAQ-html.tar.gz

LATEX	= latex
PDFLATEX = pdflatex

CTAN_HOME = help/uk-tex-faq

#h
#hThe main targets of this Makefile are
#h	release		build a distribution
#h
#h	patch		build latest patched version
#h
#h	ctan		install distribution on CTAN
#h			(to be run on the CTAN machine)
#h	web		install files required for web access
#h			(must be run on the machine that hosts
#h			the CGI script)
#h	web-index	web access files, just (dir|file)ctan
#h	web-beta	as web, except beta distribution
#h
#h	inst-perl	install texfaq2html and sanitize.pl
#h			in the cgi-bin directory
#h	inst-perl-beta	ditto, for texfaq2html-beta, sanitize-beta
#h	inst-perl-gamma	ditto, for texfaq2html-gamma
#h
#h	html		make html files in html/
#h	html-gamma	make html files in html, copy for -gamma tests

help:;	@sed -n 's/^#h//p' < $(MAKEF)

release: all html-tar
all:	newfaq.pdf letterfaq.pdf

# did have faqfont.cfg in here, but that caused problems, since it
# typically doesn't exist...

# pdf generation has to be done one a different base file name because
# of incompatibilities in the .aux and .toc files
newfaq.pdf: newfaq.tex $(BODY) $(MACROS) $(CONFIGS)
	ln -sf newfaq.tex ./pdf-newfaq.tex
	rm -f faqfont.cfg
	while ( \
	  $(PDFLATEX) \\def\\Status{1} \\input pdf-newfaq ; \
	  grep "Rerun to get cross" pdf-newfaq.log > /dev/null ) do true ; \
        done
	thumbpdf pdf-newfaq
	$(PDFLATEX) \\def\\Status{1} \\input pdf-newfaq
	mv pdf-newfaq.pdf newfaq.pdf
	rm pdf-newfaq.tex

letterfaq.pdf: letterfaq.tex $(BODY) $(MACROS) $(CONFIGS)
	ln -sf letterfaq.tex ./pdf-letterfaq.tex
	rm -f faqfont.cfg
	while ( \
	  $(PDFLATEX) \\def\\Status{1} \\input pdf-letterfaq ; \
	  grep "Rerun to get cross" pdf-letterfaq.log > /dev/null ) do true ; \
        done
	thumbpdf pdf-letterfaq
	$(PDFLATEX) \\def\\Status{1} \\input pdf-letterfaq
	mv pdf-letterfaq.pdf letterfaq.pdf
	rm pdf-letterfaq.tex

patch:	newfaq-patch

newfaq-patch: newfaq-patch.pdf newfaq-patch.ps

patch.pdf: newfaq-patch.pdf

newfaq-patch.pdf: $(PATCH) $(BODY) $(MACROS) $(CONFIGS)
	./find-add-files
	ln -sf newfaq-patch.tex ./pdf-newfaq-patch.tex
	rm -f faqfont.cfg
	while ( \
	  $(PDFLATEX) \\def\\Status{1} \\input pdf-newfaq-patch ; \
	  grep "Rerun to get cross" pdf-newfaq-patch.log > /dev/null ) do true ; \
        done
	thumbpdf pdf-newfaq-patch
	$(PDFLATEX) \\def\\Status{1} \\input pdf-newfaq-patch
	mv pdf-newfaq-patch.pdf newfaq-patch.pdf
	ln -sf newfaq-patch.pdf patch.pdf
	rm pdf-newfaq-patch.tex

patch.dvi: newfaq-patch.dvi

newfaq-patch.dvi: $(PATCH) $(BODY) $(MACROS) $(CONFIGS)
	./find-add-files
	while ( \
	  $(LATEX) newfaq-patch ; \
	  grep "Rerun to get cross" newfaq-patch.log > /dev/null ) do true ; \
        done
	ln -sf newfaq-patch.dvi patch.dvi

newfaq.aux: newfaq.dvi

newfaq.dvi: newfaq.tex $(BODY) $(MACROS) $(CONFIGS)
	echo $(LATEX)
	while ( \
	  $(LATEX) newfaq ; \
	  grep "Rerun to get cross" newfaq.log > /dev/null ) do true ; \
        done

letterfaq.dvi: letterfaq.tex $(BODY) $(MACROS) $(CONFIGS)
	while ( \
	  $(LATEX) letterfaq ; \
	  grep "Rerun to get cross" letterfaq.log > /dev/null ) do true ; \
        done

newfaq-cm.dvi: newfaq.tex $(BODY) $(MACROS) $(CONFIGS)
	ln -sf faqfont.cfg.cmfonts faqfont.cfg
	ln -sf newfaq.tex newfaq-cm.tex
	while ( \
	  $(LATEX) newfaq-cm ; \
	  grep "Rerun to get cross" newfaq-cm.log > /dev/null ) do true ; \
        done
	rm faqfont.cfg newfaq-cm.tex

letterfaq-cm.dvi: letterfaq.tex $(BODY) $(MACROS) $(CONFIGS)
	ln -sf faqfont.cfg.cmfonts faqfont.cfg
	ln -sf letterfaq.tex letterfaq-cm.tex
	while ( \
	  $(LATEX) letterfaq-cm ; \
	  grep "Rerun to get cross" letterfaq-cm.log > /dev/null ) do true ; \
        done
	rm faqfont.cfg letterfaq-cm.tex

$(HTML_TAR):
	tar czvf $(HTML_TAR) html/*

ctan:	$(HTML_TAR)
	(cd $(CTAN_ROOT)/$(CTAN_HOME); \
	 really -u ctan make -f /home/rf/tex/faq/Makefile.CTAN)

# faqbody for all the webbery stuff
faqbody.tex:	$(SUBDOCS) gather-faqbody.tex
	./build-faqbody

web: $(WEB)/dirctan.tex $(WEB)/filectan.tex $(WEB)/faqbody.tex $(WEB)/newfaq.aux $(WEB)/archive.list

web-index: $(WEB)/dirctan.tex $(WEB)/filectan.tex

$(WEB)/dirctan.tex: dirctan.tex
$(WEB)/filectan.tex: filectan.tex
$(WEB)/faqbody.tex: faqbody.tex
$(WEB)/newfaq.aux: newfaq.aux
$(WEB)/archive.list: archive.list
$(WEB)/aliasquestion.list: aliasquestion.list
$(WEB)/label-to-file.pl: label-to-file.pl

$(WEB)/dirctan.tex $(WEB)/filectan.tex $(WEB)/faqbody.tex $(WEB)/newfaq.aux $(WEB)/archive.list $(WEB)/aliasquestion.list $(WEB)/label-to-file.pl:
	if [ -f $@ ]; then	\
	  chmod 644 $@; 	\
	  cp -p $< $@-t;	\
	  mv $@-t $@;		\
	else			\
	  cp -p $< $@;		\
	fi
	chmod 444 $@

web-beta: $(WEB_BETA)/dirctan.tex $(WEB_BETA)/filectan.tex $(WEB_BETA)/faqbody.tex $(WEB_BETA)/newfaq.aux $(WEB_BETA)/archive.list $(WEB_BETA)/aliasquestion.list $(WEB_BETA)/label-to-file.pl

$(WEB_BETA)/dirctan.tex: dirctan.tex
$(WEB_BETA)/filectan.tex: filectan.tex
$(WEB_BETA)/faqbody.tex: faqbody.tex
$(WEB_BETA)/newfaq.aux: newfaq.aux
$(WEB_BETA)/archive.list: archive.list
$(WEB_BETA)/aliasquestion.list: aliasquestion.list
$(WEB_BETA)/label-to-file.pl: label-to-file.pl

$(WEB_BETA)/dirctan.tex $(WEB_BETA)/filectan.tex $(WEB_BETA)/faqbody.tex $(WEB_BETA)/newfaq.aux $(WEB_BETA)/archive.list $(WEB_BETA)/aliasquestion.list $(WEB_BETA)/label-to-file.pl:
	if [ -f $@ ]; then	\
	  chmod 644 $@;		\
	  cp -p $< $@-t;	\
	  mv $@-t $@;		\
	else			\
	  cp -p $< $@;		\
	fi
	chmod 444 $@

inst-perl: $(CGI_BIN)/texfaq2html $(CGI_BIN)/sanitize.pl
inst-perl-beta: $(CGI_BIN)/texfaq2html-beta $(CGI_BIN)/sanitize-beta.pl
inst-perl-gamma: $(CGI_BIN)/texfaq2html-gamma

$(CGI_BIN)/texfaq2html: $(HOME_DIR)/texfaq2html
$(CGI_BIN)/texfaq2html-beta: $(HOME_DIR)/texfaq2html-beta
$(CGI_BIN)/texfaq2html-gamma: $(HOME_DIR)/texfaq2html-gamma
$(CGI_BIN)/sanitize.pl: $(HOME_DIR)/sanitize.pl
$(CGI_BIN)/sanitize-beta.pl: $(HOME_DIR)/sanitize-beta.pl

$(CGI_BIN)/texfaq2html $(CGI_BIN)/texfaq2html-beta $(CGI_BIN)/texfaq2html-gamma $(CGI_BIN)/sanitize.pl $(CGI_BIN)/sanitize-beta.pl:
#	co -l $@
	cp -p $? $@
#	ci -u -m"automatic check-in" $@

html:	$(HTMLDIR)/index.html

$(HTMLDIR)/index.html: $(BODY) newfaq.aux faqbody.tex
	./texfaq2file

html-tar: html
	tar czf FAQ-html.tar.gz $(HTMLDIREL)/

html-gamma:	$(HTMLDIR_GAMMA)/index.html

$(HTMLDIR_GAMMA)/index.html: $(BODY) newfaq.aux faqbody.tex
	./texfaq2file -2 -w
	cp -p $(HTMLDIR_GAMMA)/* $(GAMMADIR)/

clean:
	rm -f *.pdf *.dvi *.log *.bak *.toc *.out *.lab *.tpt *.png
	rm -f *.aux html/*.html html_gamma/*.html htmltext/*.txt
	rm -f pdf-newfaq*.tex comment.cut additions.tex aliasquestion.list
	rm -f faqbody.tex FAQ-html.tar.gz