1# (c) Copyright 1992 by Panagiotis Tsirigotis
2# All rights reserved.  The file named COPYRIGHT specifies the terms
3# and conditions for redistribution.
4
5#
6# $Id: Makefile.in,v 1.6 2005-03-30 23:15:28 bbraun Exp $
7#
8# Based on Program makefile template: *Revision: 1.14 *
9#
10
11#
12# Available entries:
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)
16#	clean			--> cleanup
17#
18
19NAME		= xinetd
20VPATH		= @srcdir@
21SRCDIR		= @srcdir@
22TOPSRC		= @top_srcdir@
23
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
35#
36
37DEFS        = @DEFS@
38
39PREFIX      = @prefix@
40
41INSTALL_CMD = @INSTALL@
42
43LIBS        = -lsio -lmisc -lxlog -lportable -lstr -lpset @LIBS@
44
45INCLUDEDIR  = -I../libs/include
46LIBDIR      = -L../libs/lib
47
48LDFLAGS     = @LDFLAGS@ $(LIBDIR)
49CFLAGS      = $(INCLUDEDIR) @CFLAGS@ @DEFS@ -Wall
50
51HDRS     = \
52		access.h \
53		addr.h \
54		attr.h \
55		builtins.h \
56		conf.h \
57		xconfig.h \
58		connection.h \
59		defs.h \
60		inet.h \
61		int.h \
62		log.h \
63		mask.h \
64		parse.h \
65		sconst.h \
66		sconf.h \
67		sensor.h \
68		server.h \
69		service.h \
70		state.h \
71		xtimer.h
72
73SRCS     = \
74		access.c addr.c \
75		builtins.c \
76		child.c conf.c confparse.c connection.c \
77		env.c \
78		ident.c init.c int.c intcommon.c internals.c \
79		log.c logctl.c \
80		main.c msg.c \
81		nvlists.c \
82		parse.c parsesup.c parsers.c \
83		reconfig.c retry.c \
84		sconf.c sensor.c server.c service.c \
85		signals.c special.c \
86		tcpint.c time.c \
87		udpint.c util.c redirect.c \
88		xgetloadavg.c includedir.c xtimer.c inet.c xmdns.c
89
90OBJS     = \
91		access.o addr.o \
92		builtins.o \
93		child.o conf.o confparse.o connection.o \
94		env.o \
95		ident.o init.o int.o intcommon.o internals.o \
96		log.o logctl.o \
97		main.o msg.o \
98		nvlists.o \
99		parse.o parsesup.o parsers.o \
100		reconfig.o retry.o \
101		sconf.o sensor.o server.o service.o \
102		signals.o special.o \
103		tcpint.o time.o \
104		udpint.o util.o redirect.o \
105		xgetloadavg.o options.o includedir.o xtimer.o inet.o xmdns.o
106
107XMODE		= -m 700	# mode for executables
108FMODE		= -m 640	# mode for anything but executables
109INSTALL		= @INSTALL@
110
111#
112# The following variables do not need to be changed
113#
114
115
116all: xinetd itox
117
118itox: itox.c
119	$(CC) $(CFLAGS) $(DEBUG) $(SRCDIR)/itox.c -o $@ $(LDFLAGS) $(LIBS)
120
121xinetd: $(OBJS)
122	$(CC) $(CFLAGS) $(DEBUG) -o $@ $(OBJS) $(LDFLAGS) $(LIBS) || rm -f $@
123
124clean:
125	rm -f $(OBJS) $(NAME) core itox
126	rm -f *.swp
127	rm -f *.?~
128
129distclean: clean
130	rm -f Makefile
131
132install: $(NAME)
133	$(INSTALL) $(XMODE) $(NAME) $(INSTALLDIR)
134
135install.man:
136	if test "$(MANPROGDIR)" ; then \
137		$(INSTALL) $(FMODE) $(MANPROGFILE) $(MANPROGDIR)/$(MANPROGPAGE) ;\
138	fi
139	if test "$(MANDATADIR)" ; then \
140		for i in $(MANDATANAMES) ; do \
141			name=$(NAME).$$i ; \
142			$(INSTALL) $(FMODE) $$name.man $(MANDATADIR)/$$name.$(MANDATASECTION);\
143		done ;\
144	fi
145
146uninstall:
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) ;\
155		done ;\
156	fi
157
158#
159# Header file dependencies
160#
161$(SRCDIR)/addr.h: defs.h
162	@if test -f $@ ; then touch $@ ; else echo $@ is missing ; exit 1 ; fi
163
164$(SRCDIR)/builtins.h: defs.h
165	@if test -f $@ ; then touch $@ ; else echo $@ is missing ; exit 1 ; fi
166
167$(SRCDIR)/conf.h: service.h
168	@if test -f $@ ; then touch $@ ; else echo $@ is missing ; exit 1 ; fi
169
170$(SRCDIR)/int.h: server.h
171	@if test -f $@ ; then touch $@ ; else echo $@ is missing ; exit 1 ; fi
172
173$(SRCDIR)/parse.h: defs.h
174	@if test -f $@ ; then touch $@ ; else echo $@ is missing ; exit 1 ; fi
175
176$(SRCDIR)/sconf.h: defs.h log.h mask.h
177	@if test -f $@ ; then touch $@ ; else echo $@ is missing ; exit 1 ; fi
178
179$(SRCDIR)/sensor.h: defs.h service.h
180	@if test -f $@ ; then touch $@ ; else echo $@ is missing ; exit 1 ; fi
181
182$(SRCDIR)/server.h: defs.h service.h connection.h
183	@if test -f $@ ; then touch $@ ; else echo $@ is missing ; exit 1 ; fi
184
185$(SRCDIR)/service.h: defs.h sconf.h builtins.h
186	@if test -f $@ ; then touch $@ ; else echo $@ is missing ; exit 1 ; fi
187
188$(SRCDIR)/state.h: mask.h sconf.h conf.h
189	@if test -f $@ ; then touch $@ ; else echo $@ is missing ; exit 1 ; fi
190
191$(SRCDIR)/connection.h: mask.h service.h
192	@if test -f $@ ; then touch $@ ; else echo $@ is missing ; exit 1 ; fi
193
194#
195# Object file dependencies
196#
197access.o:	access.h addr.h connection.h sensor.h service.h state.h msg.h
198addr.o: 	addr.h defs.h msg.h
199builtins.o: 	builtins.h xconfig.h defs.h sconf.h server.h msg.h
200child.o: 	attr.h xconfig.h sconst.h server.h state.h msg.h $(OPT_HEADER)
201conf.o: 	attr.h conf.h xconfig.h defs.h service.h state.h msg.h
202confparse.o:	attr.h xconfig.h conf.h defs.h parse.h sconst.h \
203		sconf.h sensor.h state.h msg.h
204connection.o:	connection.h service.h state.h msg.h
205sconf.o:	addr.h attr.h defs.h sconf.h state.h
206env.o:		attr.h defs.h sconf.h msg.h
207ident.o:	defs.h sconst.h server.h msg.h
208includedir.o:	parse.h msg.h
209inet.o:		parse.h parsesup.h msg.h
210init.o:		defs.h conf.h xconfig.h state.h msg.h $(OPT_HEADER)
211int.o:		xconfig.h connection.h defs.h int.h server.h service.h msg.h
212intcommon.o:	xconfig.h defs.h int.h server.h service.h state.h msg.h
213internals.o:	xconfig.h server.h service.h state.h msg.h
214log.o:		access.h defs.h connection.h sconst.h server.h service.h msg.h
215logctl.o:	xconfig.h defs.h log.h service.h state.h msg.h
216main.o:		service.h state.h msg.h $(OPT_HEADER)
217msg.o:		xconfig.h defs.h state.h $(OPT_HEADER)
218nvlists.o:	defs.h sconf.h
219parse.o:	addr.h attr.h conf.h defs.h parse.h service.h msg.h
220parsers.o:	addr.h xconfig.h defs.h parse.h sconf.h msg.h
221parsesup.o:	defs.h parse.h msg.h
222reconfig.o:	access.h conf.h xconfig.h defs.h server.h service.h state.h \
223		msg.h
224redirect.o:	service.h log.h sconf.h msg.h
225retry.o:	access.h xconfig.h connection.h server.h state.h msg.h
226sensor.o:	addr.h msg.h sconf.h server.h xconfig.h xtimer.h
227server.o:	access.h xconfig.h connection.h server.h state.h msg.h
228service.o:	access.h attr.h xconfig.h connection.h defs.h \
229			server.h service.h state.h msg.h $(OPT_HEADER)
230signals.o:	xconfig.h defs.h state.h msg.h
231special.o:	builtins.h conf.h xconfig.h connection.h server.h sconst.h \
232		state.h msg.h $(OPT_HEADER)
233tcpint.o:	access.h xconfig.h defs.h int.h msg.h
234time.o:		defs.h msg.h
235udpint.o:	access.h defs.h int.h msg.h
236util.o:		xconfig.h defs.h msg.h
237xtimer.o:	msg.h
238