File: Makefile

package info (click to toggle)
remstats 1.00a4-8woody1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 4,576 kB
  • ctags: 1,020
  • sloc: perl: 11,706; ansic: 2,776; makefile: 944; sh: 869
file content (263 lines) | stat: -rw-r--r-- 9,908 bytes parent folder | download
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
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
# Makefile - for remstats documentation

.SUFFIXES:
.SUFFIXES: .pod .html .txt $(SUFFIXES)
HTML = \
	alerter.html alert-cgi.html alert-email.html alert-monitor.html \
	alert-winpopup.html availability-report.html availability-report-cgi.html \
	check-config.html cgis.html cleanup.html \
	collectors.html config-tools.html cookies.html configuration.html \
	configfile-alert-destination-map.html configfile-alert-template-map.html \
	configfile-alert-templates.html configfile-availability.html \
	configfile-customgraphs.html \
	configfile-html.html configfile-links.html configfile-remotepings.html \
	configfile-general.html configfile-groups.html configfile-host-templates.html \
	configfile-times.html configfile-colors.html configfile-archives.html \
	configfile-tools.html configfile-scripts.html configfile-alerts.html \
	configfile-oids.html configfile-rrds.html configfile-hosts.html \
	configfile-views.html configfile-view-templates.html \
	conventions.html \
	convert-config-links.html dataimage-cgi.html datapage-cgi.html \
	datapage-alert-writer.html \
	datapage-interfaces.html datapage-inventory.html datapage-status.html \
	do-traceroutes.html genindex.html genmenu.html graph-paths.html \
	graph-cgi.html \
	graph-writer.html htmlpod.html index.html install.html \
	install-servers.html install-webserver.html install-user.html \
	log-collector.html log-event-cgi.html log-server.html misc.html \
	monitors.html multiping.html new-config.html new-ping-hosts.html \
	new-port-hosts.html new-snmp-hosts.html new-unix-hosts.html \
	nt-discover.html nt-status-collector.html nt-status-server.html pagemakers.html \
	ping-cgi.html ping-collector.html ping-monitor.html podhtml.html \
	podlatex.html podpdf.html port-collector.html private.html \
	remoteping-collector.html remoteping-server.html remstats-monitor.html \
	required.html rrd-report.html run-remstats.html servers.html \
	showlog-cgi.html snmp-collector.html snmp-route-collector.html \
	snmp-showif.html snmpif-description-updater.html snmpif-setspeed.html \
	split-config.html thanks.html topology-monitor.html tools.html \
	topics.html traceroute.html traceroute-cgi.html \
	unix-status-collector.html unix-status-server.html updater.html \
	view-writer.html whois-cgi.html \
	bugs.html done.html todo.html releasenotes.html faq.html 
TEXT = \
	alerter.txt alert-cgi.txt alert-email.txt alert-monitor.txt alert-winpopup.txt \
	availability-report.txt availability-report-cgi.txt \
	check-config.txt cgis.txt cleanup.txt collectors.txt config-tools.txt \
	cookies.txt configuration.txt configfile-alert-template-map.txt \
	configfile-alert-destination-map.txt configfile-alert-templates.txt \
	configfile-availability.txt \
	configfile-customgraphs.txt configfile-html.txt configfile-links.txt \
	configfile-remotepings.txt configfile-host-templates.txt \
	configfile-general.txt configfile-groups.txt configfile-times.txt \
	configfile-colors.txt \
	configfile-archives.txt configfile-tools.txt configfile-scripts.txt \
	configfile-alerts.txt configfile-oids.txt configfile-rrds.txt \
	configfile-hosts.txt configfile-views.txt configfile-view-templates.txt \
	conventions.txt \
	convert-config-links.txt dataimage-cgi.txt datapage-cgi.txt datapage-alert-writer.txt \
	datapage-interfaces.txt datapage-inventory.txt datapage-status.txt \
	do-traceroutes.txt genindex.txt \
	genmenu.txt graph-paths.txt graph-cgi.txt graph-writer.txt \
	htmlpod.txtindex.txt install.txt install-servers.txt \
	install-webserver.txt install-user.txt log-collector.txt \
	log-event-cgi.txt log-server.txt \
	misc.txt monitors.txt multiping.txt new-config.txt new-ping-hosts.txt \
	new-port-hosts.txt new-snmp-hosts.txt new-unix-hosts.txt \
	nt-discover.txt nt-status-collector.txt nt-status-server.txt \
	pagemakers.txt ping-cgi.txt ping-collector.txt ping-monitor.txt \
	podhtml.txt podlatex.txt podpdf.txt port-collector.txt private.txt \
	remoteping-collector.txt \
	remoteping-server.txt remstats-monitor.txt required.txt \
	rrd-report.txt run-remstats.txt servers.txt showlog-cgi.txt \
	snmp-collector.txt snmp-route-collector.txt snmp-showif.txt \
	snmpif-description-updater.txt snmpif-setspeed.txt split-config.txt \
	thanks.txt topology-monitor.txt tools.txt topics.txt \
	traceroute.txt traceroute-cgi.txt \
	unix-status-collector.txt \
	unix-status-server.txt updater.txt view-writer.txt whois-cgi.txt \
	bugs.txt install.txt todo.txt releasenotes.txt faq.txt
SPECIALHTML = bugs.html install.html todo.html releasenotes.html faq.html
SPECIALTEXT = ../BUGS ../CHANGES.old ../INSTALL ../TODO ../RELEASENOTES ../FAQ
EXTRA = topindex.html
TARGETS = $(HTML) $(SPECIALTEXT) $(EXTRA)

EVERYTHING_NEEDS = Makefile HEADER.pod HEADER2.pod FOOTER.pod fixup.config ../fixup \
	../htmlfixup ../podhtml

.pod.html: Makefile HEADER.pod HEADER2.pod FOOTER.pod fixup.config ../fixup ../htmlfixup ../podhtml ../genmenu MENU
	@echo ""
	../genmenu $* MENU >$*.tmpmenu
	cat HEADER.pod $*.tmpmenu HEADER2.pod $*.pod FOOTER.pod >$*.tmp1
	../fixup $*.tmp1 >$*.tmp2
	../htmlfixup $*.pod $*.tmp2 >$*.tmp3
	../podhtml $*.tmp3 >$@
	@-rm -f $*.tmp*

.pod.txt: Makefile HEADER.pod HEADER2.pod FOOTER.pod fixup.config ../fixup ../htmlfixup ../podhtml
	@echo ""
	cat HEADER.pod $*.pod FOOTER.pod >$*.tmp1
	../fixup $*.tmp1 >$*.tmp2
	pod2text $*.tmp2 >$@
	@-rm -f $*.tmp*

#--------------------------------------------------------------------- main ---
default: all

all: all-begin VERSION BESTAVAILABLEVERSION $(TARGETS)

all-begin:
	@echo ""
	@echo "=== making docs ==="

book: book.tex book.dvi book.ps book.pdf
	echo >book "placeholder for make"

install: all
	@echo ""
	@echo "=== installing html ==="
	[ -d /home/remstats/html ] || ../makeadir remstats remstats 755 /home/remstats/html
	[ -d /home/remstats/html/release ] || ../makeadir remstats remstats 755 /home/remstats/html/release
	[ -d /home/remstats/html/release/src ] || ../makeadir remstats remstats 755 /home/remstats/html/release/src
	cp $(HTML) $(EXTRA) /home/remstats/html/release
	cp $(SPECIALTEXT) $(SPECIALHTML) /home/remstats/html/release/src

#--------------------------------------------------------------------- misc ---
../BUGS: $(EVERYTHING_NEEDS) bugs.txt
	@echo ""
	cp bugs.txt ../BUGS

../CHANGES.old: changes.old
	@echo ""
	cp changes.old ../CHANGES.old

../FAQ: $(EVERYTHING_NEEDS) faq.txt
	@echo ""
	cp faq.txt ../FAQ

../INSTALL: $(EVERYTHING_NEEDS) install.txt
	@echo ""
	cp install.txt ../INSTALL

../RELEASENOTES: $(EVERYTHING_NEEDS) releasenotes.txt
	@echo ""
	cp releasenotes.txt ../RELEASENOTES

../TODO: $(EVERYTHING_NEEDS) todo.txt
	@echo ""
	cp todo.txt ../TODO

topindex.html: $(EVERYTHING_NEEDS) topindex.html.in
	@echo ""
	../fixup topindex.html.in >topindex.html

topics.html: $(EVERYTHING_NEEDS) topics.pod podhtml--rawindex ../podhtml ../genindex
	@echo ""
	../genindex -f pod podhtml--rawindex >$*.tmp1
	../genmenu $* MENU >$*.tmp2
	cat HEADER.pod $*.tmp2 HEADER2.pod $*.pod $*.tmp1 FOOTER.pod >$*.tmp3
	../fixup $*.tmp3 >$*.tmp4
	../htmlfixup $*.pod $*.tmp4 >$*.tmp5
	../podhtml $*.tmp5 >$@
	@-rm -f $*.tmp*

topics.txt: $(EVERYTHING_NEEDS) topics.pod podhtml--rawindex ../genindex
	@echo ""
	../genindex -f pod podhtml--rawindex >$*.tmp1
	cat $*.pod FOOTER.pod >$*.tmp2
	../fixup $*.tmp2 > $*.tmp3
	pod2text $*.tmp3 >$@
	@-rm -f $*.tmp*

book-header.tex: book-header.tex.in
	../fixup book-header.tex.in > book-header.tex

book-footer.tex: book-footer.tex.in
	../fixup book-footer.tex.in > book-footer.tex

book.pod: MENU *.pod
	@echo ""
	@echo "=== making book.pod ==="
	-rm -f book.pod
	-touch book.pod
	@for file in `awk '/^topics/{next} {print $$1}' MENU` ; do \
		if [ -f $$file.pod ] ; then \
			echo -n " $$file"; \
			../fixup $$file.pod > $$file.tmp ;\
			if grep '^=exec' $$file.pod >/dev/null 2>&1 ; then \
				help=`../$$file -h 2>&1` ;\
				awk -v HELP="$$help" ' \
					/^=exec/ {print HELP; next; } \
					{print} \
				' $$file.tmp > $$file.tmp3 ;\
				mv $$file.tmp3 $$file.tmp ;\
			fi ;\
			cat $$file.tmp >>book.pod ;\
			rm -f $$file.tmp ;\
		else \
			echo >&2 ">>> $$file.pod: missing; skipped" ;\
		fi \
	done
	@echo ""

book.tex: MENU book-header.tex book-footer.tex ../podlatex
	@echo ""
	@echo "=== building book.tex ==="
	@cp book-header.tex book.tex
	@for file in `awk '/^topics/{next} {print $$1}' MENU` ; do \
		echo -n " $$file"; \
		echo "%------------------------------------ $$file.pod ---" >> book.tex ;\
		if [ -f $$file.pod ] ; then \
			../fixup $$file.pod > $$file.tmp ;\
			../podlatex $$file.tmp ;\
			cat $$file.tmp.tex >> book.tex ;\
			rm -f $$file.tmp $$file.tmp.tex ;\
		else \
			echo >&2 ">>> $$file.pod: missing; skipped" ;\
		fi \
	done
	@echo ""
	@cat book-footer.tex  >>book.tex

# Have to do it twice to get the table-of-contents right
book.dvi: book.tex
	-TEX_OUTPUT=book.dvi latex '\batchmode \input book.tex'
	-TEX_OUTPUT=book.dvi latex '\batchmode \input book.tex'

xdvi: book.dvi
	xdvi book&

book.ps: book.dvi
	dvips -o book.ps book.dvi

book.pdf: ../podpdf book.pod
	../podpdf book.pod
	mv book.pod.pdf book.pdf

#------------------------------------------------------------ housekeeping ---
Makefile: Makefile.in fixup.config fixup VERSION BESTAVAILABLEVERSION
	@echo ""
	../fixup Makefile.in >Makefile

fixup.config: ../fixup.config
	@echo ".. copying fixup.config"
	cp ../fixup.config .

VERSION: ../VERSION
	@echo ".. copying VERSION"
	cp ../VERSION VERSION

BESTAVAILABLEVERSION: ../BESTAVAILABLEVERSION
	@echo ".. copying BESTAVAILABLEVERSION"
	cp ../BESTAVAILABLEVERSION BESTAVAILABLEVERSION

fixup: ../fixup fixup.config VERSION BESTAVAILABLEVERSION
	@echo ".. copying fixup"
	cp ../fixup .

clean:
	@echo ""
	rm -f $(TARGETS) $(TEXT) *.tmp? pod2html-dircache pod2html-itemcache \
		../CHANGES.old ../INSTALL podhtml--rawindex *.tex \
		book.pod book.dvi book.pdf book.ps book book.aux book.idx \
		book.ilg book.ind book.log book.toc book-index.aux book-index.dvi \
		book-index.ix book-index.log