3 # Copyright (C)1996-1997 Ian Jackson
5 # This is free software; you can redistribute it and/or modify it
6 # under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2 of the License, or
8 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful, but
11 # WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 # General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with userv; if not, write to the Free Software
17 # Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 CFLAGS=@CFLAGS@ $(XCFLAGS) -DVERSION='"$(VERSION)"'
24 CPPFLAGS=@DEBUGDEFS@ $(XCPPFLAGS)
25 LDLIBS=@DEBUGLIBS@ $(XLDLIBS)
33 INSTALL_PROGRAM=@INSTALL_PROGRAM@
34 INSTALL_DATA=@INSTALL_DATA@
37 bindir=$(exec_prefix)/bin
38 sbindir=$(exec_prefix)/sbin
40 etcsubdir=$(etcdir)/userv
42 SOURCES= Makefile.in configure.in acconfig.h \
44 overlord.c process.c servexec.c \
45 daemon.h debug.c parser.c lib.c lib.h \
46 language.i4 lexer.l.m4 tokens.h.m4
47 ALSOSHIP= README INSTALL Changelog COPYING \
48 system.default system.override \
49 spec.sgml.in overview.fig overview.ps \
50 buildship install-sh .cvsignore
51 GENSHIP= lexer.l lexer.c tokens.h configure config.h.in \
52 spec.sgml spec.html spec.ps overview.ps
54 SHIPTARGETS= $(SOURCES) $(ALSOSHIP) $(GENSHIP)
59 $(INSTALL_PROGRAM) -s -o root -g root -m 755 daemon $(sbindir)/uservd
60 $(INSTALL_PROGRAM) -s -o root -g root -m 4755 client $(bindir)/userv
61 $(INSTALL) -d -o root -g root -m 2755 $(etcsubdir)
62 if ! test -f $(etcsubdir)/system.default; then \
63 $(INSTALL_DATA) -o root -g root system.default $(etcsubdir); fi
64 if ! test -f $(etcsubdir)/system.override; then \
65 $(INSTALL_DATA) -o root -g root system.override $(etcsubdir); fi
67 daemon: overlord.o process.o servexec.o parserlexer.o debug.o lib.o
68 $(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS)
72 spec.sgml: spec.sgml.in Makefile
73 sed -e '/<version><\/version>/ s/>/&$(VERSION)/' \
74 spec.sgml.in >$@.new && mv -f $@.new $@
76 client.o: config.h common.h pcsum.h version.h
78 process.o: config.h common.h pcsum.h daemon.h lib.h tokens.h
80 overlord.o: config.h common.h pcsum.h daemon.h
82 servexec.o: config.h common.h pcsum.h daemon.h lib.h version.h
84 lib.o: config.h common.h lib.h
86 debug.o: config.h common.h pcsum.h daemon.h lib.h tokens.h
88 parserlexer.o: lexer.c parser.c config.h common.h pcsum.h daemon.h lib.h tokens.h
89 # lexer.c #include's parser.c at the end. Blame flex.
90 $(CC) -c $(CPPFLAGS) $(CFLAGS) lexer.c -o $@
92 pcsum.h: common.h config.h config.status Makefile
93 cat $^ | md5sum | sed -e 's/../0x&,/g; s/,$$//;' >pcsum.h.new
94 cmp pcsum.h.new pcsum.h || mv -f pcsum.h.new pcsum.h
98 echo '#define VERSION "$(VERSION)"' >$@.new && mv -f $@.new $@
100 tokens.h: language.i4
107 rm -f daemon client pcsum.h
109 rm -f spec.lout* spec.text* spec.sgml?* spec.ps?*
111 rm -f lout.li *.lix *.ldx config.cache
112 rm -f *.o *~ core ./#*#
115 rm -f config.status config.log Makefile config.h
118 rm -f spec.ps* spec.sgml*
119 rm -f lexer.l lexer.c tokens.h overview.ps
122 totalclean: realclean
123 rm -f configure config.h.in
125 shipprep: $(SHIPTARGETS)
129 mkdir -p shipcheck/userv-$(VERSION)
130 cp -a $^ shipcheck/userv-$(VERSION)
132 GZIP=-9v tar zvvcf userv-$(VERSION).tar.gz userv-$(VERSION)
133 rm -rf shipcheck/userv-$(VERSION)
135 linecount: $(SOURCES)
139 rm -rf $@; debiandoc2html $<
142 debiandoc2ps -1 -O $< >$@.new && mv $@.new $@
145 fig2dev -L ps -c -l dummy -P -z A4 $< >$@.new && mv $@.new $@
148 $(M4) $(M4FLAGS) -- $< >$@.new && mv $@.new $@
151 $(M4) $(M4FLAGS) -- $< >$@.new && mv $@.new $@
154 $(M4) $(M4FLAGS) -- $< >$@.new && mv $@.new $@