File: Makefile.am

package info (click to toggle)
lyskom-server 2.1.2-13
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, wheezy
  • size: 10,384 kB
  • ctags: 5,091
  • sloc: ansic: 50,985; exp: 12,368; sh: 10,983; python: 2,927; makefile: 1,017; yacc: 465; awk: 340; lisp: 271; lex: 218; sed: 50
file content (341 lines) | stat: -rw-r--r-- 11,700 bytes parent folder | download | duplicates (7)
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
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
# $Id: Makefile.am,v 1.61 2003/08/29 12:37:16 ceder Exp $
# Copyright (C) 1998-1999, 2001-2002  Lysator Academic Computer Association.
#
# This file is part of the LysKOM server.
# 
# LysKOM is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by 
# the Free Software Foundation; either version 1, or (at your option) 
# any later version.
# 
# LysKOM is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
# for more details.
# 
# You should have received a copy of the GNU General Public License
# along with LysKOM; see the file COPYING.  If not, write to
# Lysator, c/o ISY, Linkoping University, S-581 83 Linkoping, SWEDEN,
# or the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, 
# MA 02139, USA.
#
# Please report bugs at http://bugzilla.lysator.liu.se/. 
#

include $(top_srcdir)/scripts/common.make

SUBDIRS = man

info_TEXINFOS = Protocol-A.texi lyskomd.texi

MOSTLYCLEANFILES = Protocol-A.notab lyskomd.notab *.tmp \
    protocol-a.texi protocol-a.aux protocol-a.fns protocol-a.log \
    protocol-a.toc protocol-a.am protocol-a.cp protocol-a.fn \
    protocol-a.ky protocol-a.pg protocol-a.tp protocol-a.vr \
    Protocol-A.dvi

DISTCLEANFILES = Protocol-A.pdf protocol-a-current.txt \
	protocol-a-recommended.txt protocol-a-full.txt

EXTRA_DIST = .cvsignore \
	IDEAS \
	checkargs.py \
	cmsltt12.mf \
	constructs.expected \
	filterlines.py \
	kom-style.el \
	tac.py

# Automake does not yet support these targets automatically.
pdf: Protocol-A.pdf
html: protocol-a/index.html protocol-a.html

# Automake tries to generate this rule automatically, but it fails
# because of the capital letters in the file name of the source file.
protocol-a.info: Protocol-A.texi
	$(RM) $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]
	$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \
	 -o $@ `test -f '$<' || echo '$(srcdir)/'`$<

# The TeX implementation cannot cope with Protocol-A.texi.  We use too
# many macros in too complex ways.  But if we expand a few of them
# with a simple sed-script, texinfo.tex will do a fair job.
# Unfortunately, this means that the automake magic fails, so we
# disable it with a explicit targets for the dvi and pdf output.

Protocol-A.dvi: protocol-a.texi
	TEXINPUTS="$(top_srcdir)/scripts:$$TEXINPUTS" \
	MAKEINFO='makeinfo -I .' \
	texi2dvi protocol-a.texi
	mv protocol-a.dvi $@

Protocol-A.pdf: protocol-a.texi
	TEXINPUTS="$(top_srcdir)/scripts:$$TEXINPUTS" \
	MAKEINFO='makeinfo -I .' \
	texi2dvi --pdf protocol-a.texi
	mv protocol-a.pdf $@

protocol-a.texi: Protocol-A.texi
	## This sed script works with texinfo.tex version 2002-03-26.08.
	## With any luck, this could be replaced by a simple "cp" when
	## a future version of texinfo.tex is created.
	sed < $(srcdir)/Protocol-A.texi \
	    -e 's/@holl{\([^,]*\),\([^}]*\)}/\1H\2/g' \
	    -e 's/@value{IAM}/Inl@"agg @}t mig/g' \
	    -e 's/@lt{\([^}]*\)}/\1/g' \
	> $@.tmp
	chmod 444 $@.tmp
	$(RM) $@
	mv $@.tmp $@

SUFFIXES = .texi .notab

.texi.notab:
	## Mixing tabs and non-tabs may cause the info file to look
	## ugly.  Ban tabs.
	$(RM) $@
	if grep -n '	' $< /dev/null ; then echo tabs detected ; exit 1; fi
	$(AWK) 'length($0) > 79 {print FILENAME ":" NR ": too long line"; e=1}\
		END {exit(e)}' $<
	echo no tabs found > $@

protocol-a/index.html: Protocol-A.texi
	makeinfo --html $(srcdir)/Protocol-A.texi

protocol-a.html: Protocol-A.texi
	makeinfo --html --no-split $(srcdir)/Protocol-A.texi

# The stuff below is used to update the official WWW pages at
# http://www.lysator.liu.se/lyskom/protocol/
WWWROOT=/lysator/www/www-pages/html/lyskom/protocol
PROTOEDITION=`sed -n 's/^@set PROTOEDITION //p' < $(srcdir)/Protocol-A.texi`
WWWREV=$(WWWROOT)/$(PROTOEDITION)
update-www: protocol-a.info protocol-a.html protocol-a/index.html \
    Protocol-A.dvi Protocol-A.pdf protocol-a-full.txt
	cd $(WWWROOT) || false
	rm -rf $(WWWREV) \
		Protocol-A-$(PROTOEDITION)-info \
		$(WWWROOT)/Protocol-A-$(PROTOEDITION)-info.tar \
		$(WWWROOT)/Protocol-A-$(PROTOEDITION)-info.tar.gz
	mkdir $(WWWREV)
	mkdir Protocol-A-$(PROTOEDITION)-info
	cp protocol-a.info* Protocol-A-$(PROTOEDITION)-info
	tar cvf $(WWWROOT)/Protocol-A-$(PROTOEDITION)-info.tar \
	    Protocol-A-$(PROTOEDITION)-info
	echo Protocol-A-$(PROTOEDITION)-info.tar|(cd $(WWWROOT)&&xargs gzip -9)
	cp $(srcdir)/Protocol-A.texi $(WWWROOT)/Protocol-A-$(PROTOEDITION).texi
	rm -r Protocol-A-$(PROTOEDITION)-info
	cp Protocol-A.dvi $(WWWROOT)/Protocol-A-$(PROTOEDITION).dvi
	cp Protocol-A.pdf $(WWWROOT)/Protocol-A-$(PROTOEDITION).pdf
	ln -s ../Protocol-A-$(PROTOEDITION).texi $(WWWREV)/Protocol-A.texi
	cp protocol-a.html $(WWWREV)/protocol-a.html
	cp protocol-a/* $(WWWREV)/
	cp protocol-a-*.txt $(WWWREV)/
	echo "Don't forget to edit $(WWWROOT)/index.html"

check: check-doc pdf dvi

protocol-a-full.txt: Protocol-A.texi checkargs.py
	$(MAKE) check-doc

check-doc: Protocol-A.notab lyskomd.notab info
if HAVE_PYTHON
	## Create a list of all aux-items.
	sed -n 's/[0-9][0-9]* : \([^ ]*\) (.*/\1/p' \
		$(top_srcdir)/run-support/aux-items.conf \
	| tee aux-items.tmp \
	| sed 's/.*/@aux{&}/' \
	| LANG=C LC_ALL=C LC_COLLATE=C LC_CTYPE=C sort \
	> aux-items-@.tmp

	## Create a list of client-specific aux items.
	sed -n '/^@c BEGIN-EXTRA-AUX$$/,/^@c END-EXTRA-AUX$$/s/^@item \(.*\) \[[0-9]*\] (.*)$$/@aux{\1}/p' \
	< $(srcdir)/Protocol-A.texi \
	| LANG=C LC_ALL=C LC_COLLATE=C LC_CTYPE=C sort \
	> aux-items-extra-@.tmp

	## Check for any overlap between the aux-item lists.
	$(PYTHON) $(srcdir)/filterlines.py aux-items-extra-@.tmp \
	< aux-items-@.tmp \
	| diff -c aux-items-@.tmp -

	$(PYTHON) $(srcdir)/filterlines.py aux-items-@.tmp \
	< aux-items-extra-@.tmp \
	| diff -c aux-items-extra-@.tmp -

	## Create a list of all requests.
	sed -e '/^#ifdef/,/^#endif/d' \
	    -e '/^#/d' \
	    -e '/^$$/d' \
	< $(top_srcdir)/src/server/fncdef.txt \
	| awk '{print $$1, $$3}' \
	| sed 's/_/-/g' \
	| tee requests-numbered.tmp \
	| awk '{print $$2}' \
	| tee requests.tmp \
	| sed 's/.*/@req{&}/' \
	> requests-@.tmp
	sed 's/.*/@reqlink{&}/' \
	< requests.tmp >> requests-@.tmp
	sed 's/.*/@reqdlink{&}/' \
	< requests.tmp >> requests-@.tmp

	## Create a list of all async messages.
	sed -n -e '/^#if 0/,/^#endif/d' \
	       -e '/^#ifdef/,/^#endif/d' \
	       -e 's/[ 	]*ay_\([^ ]*\) = \([0-9]*\).*/\2 async_\1/p' \
	       $(top_srcdir)/src/server/async.h \
	| sed 's/_/-/g' \
	| tee asyncs-numbered.tmp \
	| awk '{print $$2}' \
	| tee asyncs.tmp \
	| sed 's/.*/@async{&}/' \
	> async-@.tmp
	sed 's/.*/@asynclink{&}/' \
	< asyncs.tmp >> async-@.tmp
	sed 's/.*/@asyncdlink{&}/' \
	< asyncs.tmp >> async-@.tmp

	## Create a list of all miscinfos.
	cat $(top_srcdir)/src/include/kom-types.h \
	| sed -e '/^enum info_type {/,/};/!d' \
	| sed -n -e 's/ *\([^ ]*\)[ 	]*= *\([0-9]*\),.*/\2 \1/p' \
	| sed 's/_/-/g' \
	| grep -v unknown-info \
	| tee miscs-numbered.tmp \
	| sed 's/[0-9]* //' \
	| tee miscs.tmp \
	| sed 's/.*/@misc{&}/' \
	> miscs-@.tmp

	## Create a list of all conf-type bits.
	$(PYTHON) $(srcdir)/tac.py < $(top_srcdir)/src/include/kom-types.h \
	| sed -e '/} Conf_type/,/typedef/!d' \
	| sed -n -e 's/.*unsigned int[ 	]*\([^ 	:]*\)[ 	]*:.*/\1/p' \
	| sed -e 's/_/-/g' \
	      -e 's/allow-anon/allow-anonymous/' \
	      -e 's/letter-box/letterbox/' \
	| tee conftypes.tmp \
	| sed 's/.*/@conftype{&}/' \
	> conftypes-@.tmp

	## Create a list of all types.  We do this from the
	## documentation, and not the source, since the source has its
	## own funny names in a few places.
	sed -n 's/@tindex //p' < $(srcdir)/Protocol-A.texi \
	| tee types.tmp \
	| sed 's/.*/@type{&}/' \
	> types-@.tmp

	## Create a list of all error codes.
	cat $(top_srcdir)/src/include/kom-errno.h \
	| sed -n -e '/enum kom_err/,/};/!d' \
	         -e 's/ *KOM_\([A-Z_]*\) *= *\([0-9]*\),.*/\2 \1/p' \
	| tr '[A-Z]' '[a-z]' \
	| sed -e 's/_/-/g' \
	      -e 's/ not-impl$$/ not-implemented/' \
	      -e 's/ obsolete$$/ obsolete-call/' \
	      -e 's/ pwd$$/ invalid-password/' \
	      -e 's/ long-str$$/ string-too-long/' \
	      -e 's/ login$$/ login-first/' \
	      -e 's/ conf-zero$$/ conference-zero/' \
	      -e 's/ undef-conf$$/ undefined-conference/' \
	      -e 's/ undef-pers$$/ undefined-person/' \
	      -e 's/ access$$/ access-denied/' \
	      -e 's/ perm$$/ permission-denied/' \
	      -e 's/ conf-exists$$/ conference-exists/' \
	      -e 's/ pers-exists$$/ person-exists/' \
	      -e 's/ letter-box$$/ letterbox/' \
	      -e 's/ ldb-err$$/ ldb-error/' \
	      -e 's/ ill-misc$$/ illegal-misc/' \
	      -e 's/ comm-limit$$/ comment-limit/' \
	      -e 's/ foot-limit$$/ footnote-limit/' \
	      -e 's/ undef-session$$/ undefined-session/' \
	      -e 's/ tempfail$$/ temporary-failure/' \
	      -e 's/ anon-rejected$$/ anonymous-rejected/' \
	      -e 's/ ill-aux$$/ illegal-aux-item/' \
	      -e 's/ aux-perm$$/ aux-item-permission/' \
	| tee errorcodes-numbered.tmp \
	| sed 's/[0-9]* //' \
	| tee errorcodes.tmp \
	| sed 's/.*/@errorcode{&}/' \
	> errorcodes-@.tmp

	## Create a list of all privilege bits.
	$(PYTHON) $(srcdir)/tac.py < $(top_srcdir)/src/include/kom-types.h \
	| sed -n -e '/} Priv_bits;/,/typedef[ 	]struct/!d' \
	         -e 's/_/-/g' \
	         -e 's/.* int[ 	]\([-a-z0-9]*\)[ 	]*:.*/\1/p' \
	| tee privbits.tmp \
	| sed 's/.*/@priv{&}/' \
	> privbits-@.tmp

	## Create a list of all @x{}-constructs used.
	sed -e '/@bye/,$$d' \
	    -e '/^@c /d' \
	    -e '/^@c$$/d' \
	    -e '/^@comment /d' \
	    -e '/^@macro /,/@end macro/d' \
	    -e 's/@{//g' \
	    -e 's/@}//g' \
	    -e "`echo s/@/\\\\  ;echo @/g`" \
	    $(srcdir)/Protocol-A.texi \
	| sed -n 's/\(@[^{}]*{[^}]*}\).*/\1/p' \
	| grep -v '^@holl{' \
	| grep -v '^@badspell{' \
	| LANG=C LC_ALL=C LC_COLLATE=C LC_CTYPE=C sort \
	| LANG=C LC_ALL=C LC_COLLATE=C LC_CTYPE=C uniq \
	> constructs.tmp

	## Remove the expected stuff.  @rarg{} and @aarg{} constructs
	## are checked below, so ignore them here.  Various @ref
	## constructs are checked by makeinfo, so we ignore them as
	## well.  @t{} are not interresting.
	cat constructs.tmp \
	| grep -v '@rarg{' \
	| grep -v '@aarg{' \
	| grep -v '@ref{' \
	| grep -v '@xref{' \
	| grep -v '@pxref{' \
	| grep -v '@t{' \
	| grep -v '@footnote{' \
	| grep -v '@field{' \
	| grep -v '@anchor{' \
	| grep -v '@lt{' \
	| $(PYTHON) $(srcdir)/filterlines.py \
	    aux-items-@.tmp \
	    aux-items-extra-@.tmp \
	    requests-@.tmp \
	    types-@.tmp \
	    async-@.tmp \
	    miscs-@.tmp \
	    conftypes-@.tmp \
	    errorcodes-@.tmp \
	    privbits-@.tmp \
	> constructs-@.tmp
	## If the diff command below finds any differences, you have to
	## check that they are expected, and then manually update
	## constructs.expected.  Please be careful when you examine the
	## diff.
	diff -c $(srcdir)/constructs.expected constructs-@.tmp

	## Check @rarg{} and @aarg{} constructs.  They are only allowed
	## to refer to named arguments of the call they are documenting.
	$(PYTHON) $(srcdir)/checkargs.py $(srcdir)/Protocol-A.texi
else
	@echo >&2
	@echo WARNING: no python interpreter was found by configure, so >&2
	@echo most documentation tests could not be run. >&2
	@echo >&2
endif

# The targets below are for the benefit of the Xenofarm automated 
# builds.  They provide information for the build summary.  See
# http://www.lysator.liu.se/lyskom/lyskom-server/xenofarm.html
ident-makeinfo:
	@echo '$$(MAKEINFO):' $(MAKEINFO)
	@-type makeinfo
	@echo Obtaining version:
	-makeinfo --version
	@echo Obtaining version:
	-$(MAKEINFO) --version