# $Id: Makefile.am,v 1.62 2003/10/06 08:28:18 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 = \ 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