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.
20 CFLAGS=@CFLAGS@ $(XCFLAGS)
22 CPPFLAGS=@DEBUGDEFS@ $(XCPPFLAGS)
23 LDLIBS=@DEBUGLIBS@ $(XLDLIBS)
31 INSTALL_PROGRAM=@INSTALL_PROGRAM@
32 INSTALL_DATA=@INSTALL_DATA@
35 bindir=$(exec_prefix)/bin
36 sbindir=$(exec_prefix)/sbin
38 etcsubdir=$(etcdir)/userv
40 SOURCES= Makefile.in configure.in acconfig.h \
41 client.c common.h version.h \
42 daemon.c daemon.h ddebug.c parser.c lib.c lib.h \
43 language.i4 lexer.l.m4 tokens.h.m4
44 ALSOSHIP= system.default system.override \
45 spec.sgml overview.fig overview.ps \
46 COPYING buildship install-sh .cvsignore
47 GENSHIP= lexer.l lexer.c tokens.h configure config.h.in \
48 spec.html spec.ps overview.ps
50 SHIPTARGETS= $(SOURCES) $(ALSOSHIP) $(GENSHIP)
55 $(INSTALL_PROGRAM) -s -o root -g root -m 755 daemon $(sbindir)/uservd
56 $(INSTALL_PROGRAM) -s -o root -g root -m 4755 client $(bindir)/userv
57 $(INSTALL) -d -o root -g root -m 2755 $(etcsubdir)
58 if ! test -f $(etcsubdir)/system.default; then \
59 $(INSTALL_DATA) -o root -g root system.default $(etcsubdir); fi
60 if ! test -f $(etcsubdir)/system.override; then \
61 $(INSTALL_DATA) -o root -g root system.override $(etcsubdir); fi
63 daemon: daemon.o parserlexer.o ddebug.o lib.o
67 client.o: config.h common.h pcsum.h version.h
69 daemon.o: config.h common.h pcsum.h daemon.h lib.h tokens.h
73 ddebug.o: config.h common.h pcsum.h daemon.h lib.h tokens.h
75 parserlexer.o: lexer.c parser.c config.h common.h pcsum.h daemon.h lib.h tokens.h
76 # lexer.c #include's parser.c at the end. Blame flex.
77 $(CC) -c $(CPPFLAGS) $(CFLAGS) lexer.c -o $@
79 pcsum.h: common.h version.h config.h config.status Makefile
80 cat $^ | md5sum | sed -e 's/../0x&,/g; s/,$$//;' >pcsum.h.new
81 cmp pcsum.h.new pcsum.h || mv -f pcsum.h.new pcsum.h
91 rm -f daemon client lexer.l lexer.c tokens.h pcsum.h
92 rm -f overview.eps overview.ps
93 rm -f spec.lout* spec.ps spec.text* lout.li
95 rm -f *.o *~ core ./#*#
98 rm -f config.status config.log Makefile config.h
101 rm -f configure config.h.in
103 shipprep: $(SHIPTARGETS)
107 mkdir -p shipcheck/userv-$(VERSION)
108 cp -a $^ shipcheck/userv-$(VERSION)
110 GZIP=-9v tar zvvcf userv-$(VERSION).tar.gz userv-$(VERSION)
111 rm -rf shipcheck/userv-$(VERSION)
113 linecount: $(SOURCES)
117 rm -rf $@; debiandoc2html $<
120 debiandoc2ps -1 -k -O $< >$@.new && mv $@.new $@
123 fig2dev -L ps -c -l dummy -P -z A4 $< >$@.new && mv $@.new $@
126 $(M4) $(M4FLAGS) -- $< >$@.new && mv $@.new $@
129 $(M4) $(M4FLAGS) -- $< >$@.new && mv $@.new $@
132 $(M4) $(M4FLAGS) -- $< >$@.new && mv $@.new $@