chiark / gitweb /
2b2e0d9fe06fbfd9b23414dd8f1f9f254d055ad2
[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 VERSION=0.55
20
21 CC=@CC@
22 CFLAGS=@CFLAGS@ $(XCFLAGS) -DVERSION='"$(VERSION)"'
23 OPTIMISE=@OPTIMISE@
24 CPPFLAGS=@DEBUGDEFS@ $(XCPPFLAGS)
25 LDLIBS=@DEBUGLIBS@ $(XLDLIBS)
26
27 M4=m4
28 M4FLAGS=
29 LEX=flex
30 CWD=$(shell pwd)
31
32 INSTALL=@INSTALL@
33 INSTALL_PROGRAM=@INSTALL_PROGRAM@
34 INSTALL_DATA=@INSTALL_DATA@
35 prefix=@prefix@
36 exec_prefix=$(prefix)
37 bindir=$(exec_prefix)/bin
38 sbindir=$(exec_prefix)/sbin
39 etcdir=/etc
40 etcsubdir=$(etcdir)/userv
41
42 SOURCES=        Makefile.in configure.in acconfig.h                     \
43                 client.c common.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=       system.default system.override \
48                 spec.sgml.in overview.fig overview.ps \
49                 COPYING INSTALL buildship install-sh .cvsignore
50 GENSHIP=        lexer.l lexer.c tokens.h configure config.h.in \
51                 spec.sgml spec.html spec.ps overview.ps
52
53 SHIPTARGETS=    $(SOURCES) $(ALSOSHIP) $(GENSHIP)
54
55 all:            daemon client
56
57 install:        all
58                 $(INSTALL_PROGRAM) -s -o root -g root -m 755 daemon $(sbindir)/uservd
59                 $(INSTALL_PROGRAM) -s -o root -g root -m 4755 client $(bindir)/userv
60                 $(INSTALL) -d -o root -g root -m 2755 $(etcsubdir)
61                 if ! test -f $(etcsubdir)/system.default; then \
62                         $(INSTALL_DATA) -o root -g root system.default $(etcsubdir); fi
63                 if ! test -f $(etcsubdir)/system.override; then \
64                         $(INSTALL_DATA) -o root -g root system.override $(etcsubdir); fi
65
66 daemon:         overlord.o process.o servexec.o parserlexer.o debug.o lib.o
67                 $(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS)
68
69 lexer.l:        language.i4
70
71 spec.sgml:      spec.sgml.in Makefile
72                 sed -e '/<version><\/version>/ s/>/&$(VERSION)/' \
73                         spec.sgml.in >$@.new && mv -f $@.new $@
74
75 client.o:       config.h common.h pcsum.h version.h
76
77 process.o:      config.h common.h pcsum.h daemon.h lib.h tokens.h
78
79 overlord.o:     config.h common.h pcsum.h daemon.h
80
81 servexec.o:     config.h common.h pcsum.h daemon.h lib.h version.h
82
83 lib.o:          config.h common.h lib.h
84
85 debug.o:        config.h common.h pcsum.h daemon.h lib.h tokens.h
86
87 parserlexer.o:  lexer.c parser.c config.h common.h pcsum.h daemon.h lib.h tokens.h
88 # lexer.c #include's parser.c at the end.  Blame flex.
89                 $(CC) -c $(CPPFLAGS) $(CFLAGS) lexer.c -o $@
90
91 pcsum.h:        common.h config.h config.status Makefile
92                 cat $^ | md5sum | sed -e 's/../0x&,/g; s/,$$//;' >pcsum.h.new
93                 cmp pcsum.h.new pcsum.h || mv -f pcsum.h.new pcsum.h
94                 @rm -f pcsum.h.new
95
96 version.h:      Makefile
97                 echo '#define VERSION "$(VERSION)"' >$@.new && mv -f $@.new $@
98
99 tokens.h:       language.i4
100
101 autoconf configure:
102                 autoheader
103                 autoconf
104
105 clean:
106                 rm -f daemon client lexer.l lexer.c tokens.h pcsum.h
107                 rm -f overview.eps overview.ps
108                 rm -f spec.lout* spec.ps spec.text* lout.li
109                 rm -rf spec.html*
110                 rm -f *.o *~ core ./#*#
111
112 distclean:      clean
113                 rm -f config.status config.log Makefile config.h
114
115 realclean:      distclean
116                 rm -f configure config.h.in
117
118 shipprep:       $(SHIPTARGETS)
119
120 ship:           $(SHIPTARGETS)
121                 rm -rf shipcheck
122                 mkdir -p shipcheck/userv-$(VERSION)
123                 cp -a $^ shipcheck/userv-$(VERSION)
124                 cd shipcheck && \
125                  GZIP=-9v tar zvvcf userv-$(VERSION).tar.gz userv-$(VERSION)
126                 rm -rf shipcheck/userv-$(VERSION)
127
128 linecount:      $(SOURCES)
129                 wc -l $^
130
131 %.html:         %.sgml
132                 rm -rf $@; debiandoc2html $<
133
134 %.ps:           %.sgml
135                 debiandoc2ps -1 -O $< >$@.new && mv $@.new $@
136
137 %.ps:           %.fig
138                 fig2dev -L ps -c -l dummy -P -z A4 $< >$@.new && mv $@.new $@
139
140 %.l:            %.l.m4
141                 $(M4) $(M4FLAGS) -- $< >$@.new && mv $@.new $@
142
143 %.h:            %.h.m4
144                 $(M4) $(M4FLAGS) -- $< >$@.new && mv $@.new $@
145
146 %:              %.m4
147                 $(M4) $(M4FLAGS) -- $< >$@.new && mv $@.new $@