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 \
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 install-sh .cvsignore
47 GENSHIP= lexer.l lexer.c tokens.h pcsum.h \
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
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 $@
80 md5sum common.h | perl -pe 's/../0x$$&,/g; s/,$$//;' \
81 >pcsum.h.new && mv pcsum.h.new pcsum.h
90 rm -f daemon client lexer.l lexer.c tokens.h pcsum.h
91 rm -f overview.eps overview.ps
92 rm -f spec.lout* spec.ps spec.text* lout.li
94 rm -f *.o *~ core ./#*#
97 rm -f config.status config.log Makefile config.h
100 rm -f configure config.h.in
102 shipprep: $(SHIPTARGETS)
105 rm -rf d && mkdir d && cp -av $^ d
106 mv d userv-$(VERSION)
107 GZIP=-9v tar zvvcf ../userv-$(VERSION).tar.gz userv-$(VERSION)
108 rm -rf userv-$(VERSION)
110 linecount: $(SOURCES)
114 rm -rf $@; debiandoc2html $<
117 debiandoc2ps -1 -k -O $< >$@.new && mv $@.new $@
120 fig2dev -L ps -c -l dummy -P -z A4 $< >$@.new && mv $@.new $@
123 $(M4) $(M4FLAGS) -- $< >$@.new && mv $@.new $@
126 $(M4) $(M4FLAGS) -- $< >$@.new && mv $@.new $@
129 $(M4) $(M4FLAGS) -- $< >$@.new && mv $@.new $@