chiark / gitweb /
Incorporate markups on all paper copies to date.
[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 version.h                             \
42                 overlord.c process.c servexec.c                         \
43                 daemon.h debug.c parser.c lib.c lib.h                   \
44                 language.i4 lexer.l.m4 tokens.h.m4
45 ALSOSHIP=       system.default system.override \
46                 spec.sgml overview.fig overview.ps \
47                 COPYING INSTALL buildship install-sh .cvsignore
48 GENSHIP=        lexer.l lexer.c tokens.h configure config.h.in \
49                 spec.html spec.ps overview.ps
50
51 SHIPTARGETS=    $(SOURCES) $(ALSOSHIP) $(GENSHIP)
52
53 all:            daemon client
54
55 install:        all
56                 $(INSTALL_PROGRAM) -s -o root -g root -m 755 daemon $(sbindir)/uservd
57                 $(INSTALL_PROGRAM) -s -o root -g root -m 4755 client $(bindir)/userv
58                 $(INSTALL) -d -o root -g root -m 2755 $(etcsubdir)
59                 if ! test -f $(etcsubdir)/system.default; then \
60                         $(INSTALL_DATA) -o root -g root system.default $(etcsubdir); fi
61                 if ! test -f $(etcsubdir)/system.override; then \
62                         $(INSTALL_DATA) -o root -g root system.override $(etcsubdir); fi
63
64 daemon:         overlord.o process.o servexec.o parserlexer.o debug.o lib.o
65                 $(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS)
66
67 lexer.l:        language.i4
68
69 client.o:       config.h common.h pcsum.h version.h
70
71 process.o:      config.h common.h pcsum.h daemon.h lib.h tokens.h
72
73 overlord.o:     config.h common.h pcsum.h daemon.h
74
75 servexec.o:     config.h common.h pcsum.h daemon.h lib.h version.h
76
77 lib.o:          config.h lib.h
78
79 debug.o:        config.h common.h pcsum.h daemon.h lib.h tokens.h
80
81 parserlexer.o:  lexer.c parser.c config.h common.h pcsum.h daemon.h lib.h tokens.h
82 # lexer.c #include's parser.c at the end.  Blame flex.
83                 $(CC) -c $(CPPFLAGS) $(CFLAGS) lexer.c -o $@
84
85 pcsum.h:        common.h version.h config.h config.status Makefile
86                 cat $^ | md5sum | sed -e 's/../0x&,/g; s/,$$//;' >pcsum.h.new
87                 cmp pcsum.h.new pcsum.h || mv -f pcsum.h.new pcsum.h
88                 @rm -f pcsum.h.new
89
90 tokens.h:       language.i4
91
92 autoconf configure:
93                 autoheader
94                 autoconf
95
96 clean:
97                 rm -f daemon client lexer.l lexer.c tokens.h pcsum.h
98                 rm -f overview.eps overview.ps
99                 rm -f spec.lout* spec.ps spec.text* lout.li
100                 rm -rf spec.html*
101                 rm -f *.o *~ core ./#*#
102
103 distclean:      clean
104                 rm -f config.status config.log Makefile config.h
105
106 realclean:      distclean
107                 rm -f configure config.h.in
108
109 shipprep:       $(SHIPTARGETS)
110
111 ship:           $(SHIPTARGETS)
112                 rm -rf shipcheck
113                 mkdir -p shipcheck/userv-$(VERSION)
114                 cp -a $^ shipcheck/userv-$(VERSION)
115                 cd shipcheck && \
116                  GZIP=-9v tar zvvcf userv-$(VERSION).tar.gz userv-$(VERSION)
117                 rm -rf shipcheck/userv-$(VERSION)
118
119 linecount:      $(SOURCES)
120                 wc -l $^
121
122 %.html:         %.sgml
123                 rm -rf $@; debiandoc2html $<
124
125 %.ps:           %.sgml
126                 debiandoc2ps -1 -k -O $< >$@.new && mv $@.new $@
127
128 %.ps:           %.fig
129                 fig2dev -L ps -c -l dummy -P -z A4 $< >$@.new && mv $@.new $@
130
131 %.l:            %.l.m4
132                 $(M4) $(M4FLAGS) -- $< >$@.new && mv $@.new $@
133
134 %.h:            %.h.m4
135                 $(M4) $(M4FLAGS) -- $< >$@.new && mv $@.new $@
136
137 %:              %.m4
138                 $(M4) $(M4FLAGS) -- $< >$@.new && mv $@.new $@