1 # (c) Copyright 1992 by Panagiotis Tsirigotis
2 # All rights reserved. The file named COPYRIGHT specifies the terms
3 # and conditions for redistribution.
6 # $Id: Makefile.in,v 1.6 2005/03/30 23:15:28 bbraun Exp $
8 # Based on Program makefile template: *Revision: 1.14 *
13 # $(NAME) --> create the program (this is the default target)
14 # install --> install the program (and man page)
15 # uninstall --> uninstall the program (and man page)
24 # Available debug flags:
25 # DEBUG code is being debugged
26 # DEBUG_SERVER forked server will do a sleep
27 # DEBUG_INTERCEPTOR forked interceptor will do a sleep
28 # DEBUG_SIGNALS code that handles SIGSEGV and SIGBUS
29 # DEBUG_LOGGING forked logging server will do a sleep
30 # DEBUG_SHUTDOWN forked shutdown server will do a sleep
31 # DEBUG_TPCINT enable debugging code in the tcp interceptor
32 # DEBUG_UDPINT enable debugging code in the udp interceptor
33 # DEBUG_DAEMON debug xinetd when not invoked with -d option
34 # DEBUG_RETRY debug the server retry code
41 INSTALL_CMD = @INSTALL@
43 LIBS = -lsio -lmisc -lxlog -lportable -lstr -lpset @LIBS@
45 INCLUDEDIR = -I../libs/include
46 LIBDIR = -L../libs/lib
48 LDFLAGS = @LDFLAGS@ $(LIBDIR)
49 CFLAGS = $(INCLUDEDIR) @CFLAGS@ @DEFS@ -Wall
76 child.c conf.c confparse.c connection.c \
78 ident.c init.c int.c intcommon.c internals.c \
82 parse.c parsesup.c parsers.c \
84 sconf.c sensor.c server.c service.c \
87 udpint.c util.c redirect.c \
88 xgetloadavg.c includedir.c xtimer.c inet.c xmdns.c
93 child.o conf.o confparse.o connection.o \
95 ident.o init.o int.o intcommon.o internals.o \
99 parse.o parsesup.o parsers.o \
101 sconf.o sensor.o server.o service.o \
102 signals.o special.o \
104 udpint.o util.o redirect.o \
105 xgetloadavg.o options.o includedir.o xtimer.o inet.o xmdns.o
107 XMODE = -m 700 # mode for executables
108 FMODE = -m 640 # mode for anything but executables
112 # The following variables do not need to be changed
119 $(CC) $(CFLAGS) $(DEBUG) $(SRCDIR)/itox.c -o $@ $(LDFLAGS) $(LIBS)
122 $(CC) $(CFLAGS) $(DEBUG) -o $@ $(OBJS) $(LDFLAGS) $(LIBS) || rm -f $@
125 rm -f $(OBJS) $(NAME) core itox
133 $(INSTALL) $(XMODE) $(NAME) $(INSTALLDIR)
136 if test "$(MANPROGDIR)" ; then \
137 $(INSTALL) $(FMODE) $(MANPROGFILE) $(MANPROGDIR)/$(MANPROGPAGE) ;\
139 if test "$(MANDATADIR)" ; then \
140 for i in $(MANDATANAMES) ; do \
142 $(INSTALL) $(FMODE) $$name.man $(MANDATADIR)/$$name.$(MANDATASECTION);\
147 a=`pwd` ; cd $(INSTALLDIR) ;\
148 if test $$a != `pwd` ; then rm -f $(NAME) ; fi
149 a=`pwd` ; cd $(MANPROGDIR) ;\
150 if test $$a != `pwd` ; then rm -f $(MANPROGPAGE) ; fi
151 a=`pwd` ; cd $(MANDATADIR) ;\
152 if test $$a != `pwd` ; then \
153 for i in $(MANDATANAMES) ; do \
154 rm -f $(NAME).$$i.$(MANDATASECTION) ;\
159 # Header file dependencies
161 $(SRCDIR)/addr.h: defs.h
162 @if test -f $@ ; then touch $@ ; else echo $@ is missing ; exit 1 ; fi
164 $(SRCDIR)/builtins.h: defs.h
165 @if test -f $@ ; then touch $@ ; else echo $@ is missing ; exit 1 ; fi
167 $(SRCDIR)/conf.h: service.h
168 @if test -f $@ ; then touch $@ ; else echo $@ is missing ; exit 1 ; fi
170 $(SRCDIR)/int.h: server.h
171 @if test -f $@ ; then touch $@ ; else echo $@ is missing ; exit 1 ; fi
173 $(SRCDIR)/parse.h: defs.h
174 @if test -f $@ ; then touch $@ ; else echo $@ is missing ; exit 1 ; fi
176 $(SRCDIR)/sconf.h: defs.h log.h mask.h
177 @if test -f $@ ; then touch $@ ; else echo $@ is missing ; exit 1 ; fi
179 $(SRCDIR)/sensor.h: defs.h service.h
180 @if test -f $@ ; then touch $@ ; else echo $@ is missing ; exit 1 ; fi
182 $(SRCDIR)/server.h: defs.h service.h connection.h
183 @if test -f $@ ; then touch $@ ; else echo $@ is missing ; exit 1 ; fi
185 $(SRCDIR)/service.h: defs.h sconf.h builtins.h
186 @if test -f $@ ; then touch $@ ; else echo $@ is missing ; exit 1 ; fi
188 $(SRCDIR)/state.h: mask.h sconf.h conf.h
189 @if test -f $@ ; then touch $@ ; else echo $@ is missing ; exit 1 ; fi
191 $(SRCDIR)/connection.h: mask.h service.h
192 @if test -f $@ ; then touch $@ ; else echo $@ is missing ; exit 1 ; fi
195 # Object file dependencies
197 access.o: access.h addr.h connection.h sensor.h service.h state.h msg.h
198 addr.o: addr.h defs.h msg.h
199 builtins.o: builtins.h xconfig.h defs.h sconf.h server.h msg.h
200 child.o: attr.h xconfig.h sconst.h server.h state.h msg.h $(OPT_HEADER)
201 conf.o: attr.h conf.h xconfig.h defs.h service.h state.h msg.h
202 confparse.o: attr.h xconfig.h conf.h defs.h parse.h sconst.h \
203 sconf.h sensor.h state.h msg.h
204 connection.o: connection.h service.h state.h msg.h
205 sconf.o: addr.h attr.h defs.h sconf.h state.h
206 env.o: attr.h defs.h sconf.h msg.h
207 ident.o: defs.h sconst.h server.h msg.h
208 includedir.o: parse.h msg.h
209 inet.o: parse.h parsesup.h msg.h
210 init.o: defs.h conf.h xconfig.h state.h msg.h $(OPT_HEADER)
211 int.o: xconfig.h connection.h defs.h int.h server.h service.h msg.h
212 intcommon.o: xconfig.h defs.h int.h server.h service.h state.h msg.h
213 internals.o: xconfig.h server.h service.h state.h msg.h
214 log.o: access.h defs.h connection.h sconst.h server.h service.h msg.h
215 logctl.o: xconfig.h defs.h log.h service.h state.h msg.h
216 main.o: service.h state.h msg.h $(OPT_HEADER)
217 msg.o: xconfig.h defs.h state.h $(OPT_HEADER)
218 nvlists.o: defs.h sconf.h
219 parse.o: addr.h attr.h conf.h defs.h parse.h service.h msg.h
220 parsers.o: addr.h xconfig.h defs.h parse.h sconf.h msg.h
221 parsesup.o: defs.h parse.h msg.h
222 reconfig.o: access.h conf.h xconfig.h defs.h server.h service.h state.h \
224 redirect.o: service.h log.h sconf.h msg.h
225 retry.o: access.h xconfig.h connection.h server.h state.h msg.h
226 sensor.o: addr.h msg.h sconf.h server.h xconfig.h xtimer.h
227 server.o: access.h xconfig.h connection.h server.h state.h msg.h
228 service.o: access.h attr.h xconfig.h connection.h defs.h \
229 server.h service.h state.h msg.h $(OPT_HEADER)
230 signals.o: xconfig.h defs.h state.h msg.h
231 special.o: builtins.h conf.h xconfig.h connection.h server.h sconst.h \
232 state.h msg.h $(OPT_HEADER)
233 tcpint.o: access.h xconfig.h defs.h int.h msg.h
235 udpint.o: access.h defs.h int.h msg.h
236 util.o: xconfig.h defs.h msg.h