Makefile.am 8.45 KB
Newer Older
1
# $Id: Makefile.am,v 1.40 2002/01/01 14:47:58 ceder Exp $
Per Cederqvist's avatar
Per Cederqvist committed
2
# Copyright (C) 1998-1999, 2001  Lysator Academic Computer Association.
Per Cederqvist's avatar
Per Cederqvist committed
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#
# 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 mail bug reports to bug-lyskom@lysator.liu.se. 
#

Per Cederqvist's avatar
Per Cederqvist committed
25
26
RM = rm -f

Per Cederqvist's avatar
Per Cederqvist committed
27
28
SUBDIRS = man

29
info_TEXINFOS = Protocol-A.texi lyskomd.texi
30

31
MOSTLYCLEANFILES = Protocol-A.notab lyskomd.notab *.tmp
32

33
EXTRA_DIST = .cvsignore \
Per Cederqvist's avatar
Per Cederqvist committed
34
	IDEAS \
35
36
37
	checkargs.py \
	cmsltt12.mf \
	constructs.expected
38
39
40
41

# 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
42
	cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
43
44
	cd $(srcdir) \
	  && $(MAKEINFO) `echo $< | sed 's,.*/,,'`
45
46
47
48
49
50
51
52

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
53
54
	gawk 'length($0) > 79 {print FILENAME ":" NR ": too long line"; e=1} \
		END {exit(e)}' $<
55
	echo no tabs found > $@
56

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

60
61
62
63
64
# 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)
65
update-www: protocol-a.info protocol-a.html # Protocol-A.dvi Protocol-A.pdf
66
	cd $(WWWROOT) || false
67
68
69
	rm -rf $(WWWREV) Protocol-A-$(PROTOEDITION)-info \
		$(WWWROOT)/Protocol-A-$(PROTOEDITION)-info.tar \
		$(WWWROOT)/Protocol-A-$(PROTOEDITION)-info.tar.gz
70
	mkdir $(WWWREV)
71
72
73
74
75
	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)
76
	cp $(srcdir)/Protocol-A.texi $(WWWROOT)/Protocol-A-$(PROTOEDITION).texi
77
	rm -r Protocol-A-$(PROTOEDITION)-info
78
79
	## cp Protocol-A.dvi $(WWWROOT)/Protocol-A-$(PROTOEDITION).dvi
	## cp Protocol-A.pdf $(WWWROOT)/Protocol-A-$(PROTOEDITION).pdf
80
	ln -s ../Protocol-A-$(PROTOEDITION).texi $(WWWREV)/Protocol-A.texi
81
	cp protocol-a.html $(WWWREV)/protocol-a.html
82
83
84
85
86
87
88
	echo "Don't forget to edit $(WWWROOT)/index.html"

Protocol-A.pdf: Protocol-A.texi
	texi2pdf $(srcdir)/Protocol-A.texi

check: check-doc

89
check-doc: Protocol-A.notab lyskomd.notab info
90
	## Create a list of all aux-items.
91
92
93
94
95
96
	sed -n 's/[0-9][0-9]* : \([^ ]*\) (.*/\1/p' \
		$(top_srcdir)/run-support/aux-items.conf \
	| tee aux-items.tmp \
	| sed 's/.*/^@aux{&}$$/' \
	> aux-items-@.tmp

97
	## Create a list of all requests.
Per Cederqvist's avatar
Per Cederqvist committed
98
99
100
101
102
	sed -e '/^#ifdef/,/^#endif/d' \
	    -e '/^#/d' \
	    -e '/^$$/d' \
	< $(top_srcdir)/src/server/fncdef.txt \
	| awk '{print $$1, $$3}' \
103
	| sed 's/_/-/g' \
104
	| tee requests-numbered.tmp \
Per Cederqvist's avatar
Per Cederqvist committed
105
	| awk '{print $$2}' \
106
107
108
	| tee requests.tmp \
	| sed 's/.*/^@req{&}$$/' \
	> requests-@.tmp
109
110
111
112
	sed 's/.*/^@reqlink{&}$$/' \
	< requests.tmp >> requests-@.tmp
	sed 's/.*/^@reqdlink{&}$$/' \
	< requests.tmp >> requests-@.tmp
113

114
	## Create a list of all async messages.
115
116
117
	sed -n -e '/^#if 0/,/^#endif/d' \
	       -e '/^#ifdef/,/^#endif/d' \
	       -e 's/[ 	]*ay_\([^ ]*\) = \([0-9]*\).*/\2 async_\1/p' \
118
119
	       $(top_srcdir)/src/server/async.h \
	| sed 's/_/-/g' \
120
121
	| tee asyncs-numbered.tmp \
	| awk '{print $$2}' \
122
123
124
	| tee asyncs.tmp \
	| sed 's/.*/^@async{&}$$/' \
	> async-@.tmp
125
126
127
128
	sed 's/.*/^@asynclink{&}$$/' \
	< asyncs.tmp >> async-@.tmp
	sed 's/.*/^@asyncdlink{&}$$/' \
	< asyncs.tmp >> async-@.tmp
129

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

142
	## Create a list of all conf-type bits.
143
144
145
146
147
148
149
150
151
152
	tac $(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

153
154
155
	## 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.
156
157
158
159
160
	sed -n 's/@tindex //p' < $(srcdir)/Protocol-A.texi \
	| tee types.tmp \
	| sed 's/.*/^@type{&}$$/' \
	> types-@.tmp

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
	## 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

195
196
197
198
199
200
201
202
203
	## Create a list of all privilege bits.
	tac $(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

204
	## Create a list of all @x{}-constructs used.
205
206
	sed -e '/@bye/,$$d' \
	    -e '/^@c /d' \
207
208
209
210
211
212
213
214
	    -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' \
215
216
	| grep -v '^@holl{' \
	| grep -v '^@badspell{' \
217
218
	| LANG=C LC_ALL=C LC_COLLATE=C LC_CTYPE=C sort \
	| LANG=C LC_ALL=C LC_COLLATE=C LC_CTYPE=C uniq \
219
220
	> constructs.tmp

221
222
223
224
	## 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.
225
226
227
228
229
230
231
232
233
	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{' \
234
235
	| grep -v '@anchor{' \
	| grep -v '@lt{' \
236
237
238
239
240
241
242
	| grep -v \
	    -f aux-items-@.tmp \
	    -f requests-@.tmp \
	    -f types-@.tmp \
	    -f async-@.tmp \
	    -f miscs-@.tmp \
	    -f conftypes-@.tmp \
243
	    -f errorcodes-@.tmp \
244
	    -f privbits-@.tmp \
245
	> constructs-@.tmp
246
247
248
249
	## 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.
250
251
	diff -u $(srcdir)/constructs.expected constructs-@.tmp

252
253
	## Check @rarg{} and @aarg{} constructs.  They are only allowed
	## to refer to named arguments of the call they are documenting.
254
	python $(srcdir)/checkargs.py $(srcdir)/Protocol-A.texi