chiark / gitweb /
added buildship.
[userv.git] / Makefile.in
1 #  userv - Makefile.in
2 #  
3 #  Copyright (C)1996-1997 Ian Jackson
4 #  
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.
9 #  
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.
14 #  
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.
18
19 CC=@CC@
20 CFLAGS=@CFLAGS@ $(XCFLAGS)
21 OPTIMISE=@OPTIMISE@
22 CPPFLAGS=@DEBUGDEFS@ $(XCPPFLAGS)
23 LDLIBS=@DEBUGLIBS@ $(XLDLIBS)
24
25 M4=m4
26 M4FLAGS=
27 LEX=flex
28 CWD=$(shell pwd)
29
30 INSTALL=@INSTALL@
31 INSTALL_PROGRAM=@INSTALL_PROGRAM@
32 INSTALL_DATA=@INSTALL_DATA@
33 prefix=@prefix@
34 exec_prefix=$(prefix)
35 bindir=$(exec_prefix)/bin
36 sbindir=$(exec_prefix)/sbin
37 etcdir=/etc
38 etcsubdir=$(etcdir)/userv
39
40 SOURCES=        Makefile.in configure.in acconfig.h                     \
41                 client.c common.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 pcsum.h \
48                 spec.html spec.ps overview.ps
49
50 SHIPTARGETS=    $(SOURCES) $(ALSOSHIP) $(GENSHIP)
51
52 all:            daemon client
53
54 install:        all
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
62
63 daemon:         daemon.o parserlexer.o ddebug.o lib.o
64
65 lexer.l:        language.i4
66
67 client.o:       config.h common.h pcsum.h
68
69 daemon.o:       config.h common.h pcsum.h daemon.h lib.h tokens.h
70
71 lib.o:          config.h lib.h
72
73 ddebug.o:       config.h common.h pcsum.h daemon.h lib.h tokens.h
74
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 $@
78
79 pcsum.h:        common.h
80                 md5sum common.h | perl -pe 's/../0x$$&,/g; s/,$$//;' \
81                         >pcsum.h.new && mv pcsum.h.new pcsum.h
82
83 tokens.h:       language.i4
84
85 autoconf configure:
86                 autoheader
87                 autoconf
88
89 clean:
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
93                 rm -rf spec.html*
94                 rm -f *.o *~ core ./#*#
95
96 distclean:      clean
97                 rm -f config.status config.log Makefile config.h
98
99 realclean:      distclean
100                 rm -f configure config.h.in
101
102 shipprep:       $(SHIPTARGETS)
103
104 ship:           $(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)
109
110 linecount:      $(SOURCES)
111                 wc -l $^
112
113 %.html:         %.sgml
114                 rm -rf $@; debiandoc2html $<
115
116 %.ps:           %.sgml
117                 debiandoc2ps -1 -k -O $< >$@.new && mv $@.new $@
118
119 %.ps:           %.fig
120                 fig2dev -L ps -c -l dummy -P -z A4 $< >$@.new && mv $@.new $@
121
122 %.l:            %.l.m4
123                 $(M4) $(M4FLAGS) -- $< >$@.new && mv $@.new $@
124
125 %.h:            %.h.m4
126                 $(M4) $(M4FLAGS) -- $< >$@.new && mv $@.new $@
127
128 %:              %.m4
129                 $(M4) $(M4FLAGS) -- $< >$@.new && mv $@.new $@