1 # $FreeBSD: src/libexec/bootpd/Makefile.UNIX,v 1.5 1999/08/28 00:09:14 peter Exp $
2 # $DragonFly: src/libexec/bootpd/Makefile.UNIX,v 1.2 2003/06/17 04:27:07 dillon Exp $
4 # Makefile for the BOOTP programs:
5 # bootpd - BOOTP server daemon
6 # bootpef - BOOTP extension file builder
7 # bootpgw - BOOTP gateway daemon
8 # bootptest - BOOTP tester (client)
12 # Remove the -DVEND_CMU if you don't wish to support the "CMU vendor format"
13 # in addition to the RFC1048 format. Leaving out DEBUG saves little.
14 OPTDEFS= -DSYSLOG -DVEND_CMU -DDEBUG
16 # Uncomment and edit this to choose the facility code used for syslog.
17 # LOG_FACILITY= "-DLOG_BOOTP=LOG_LOCAL2"
20 # Either uncomment some of the following, or do:
21 # "make sunos4" (or "make sunos5", etc.)
22 # SYSDEFS= -DSUNOS -DETC_ETHERS
24 # SYSLIBS= -lsocket -lnsl
26 # Uncomment this if your system does not provide streror(3)
30 # The next few lines may be uncommented and changed to alter the default
31 # filenames bootpd uses for its configuration and dump files.
32 #CONFFILE= -DCONFIG_FILE=\"/usr/etc/bootptab\"
33 #DUMPFILE= -DDUMPTAB_FILE=\"/usr/etc/bootpd.dump\"
34 #FILEDEFS= $(CONFFILE) $(DUMPFILE)
36 # MORE DEFinitions (whatever you might want to add)
37 # One might define NDEBUG (to remove "assert()" checks).
40 INSTALL=/usr/bin/install
45 CFLAGS= $(OPTDEFS) $(SYSDEFS) $(FILEDEFS) $(MOREDEFS)
46 PROGS= bootpd bootpef bootpgw bootptest
47 TESTS= trylook trygetif trygetea
49 all: $(PROGS) $(TESTS)
56 $(INSTALL) -c -s $$f $(DESTDIR)$(BINDIR) ;\
60 MAN8= bootpd.8 bootpef.8 bootptest.8
61 install.man: $(MAN5) $(MAN8)
64 $(INSTALL) -c -m 644 $$f $(DESTDIR)$(MANDIR)/man5 ;\
68 $(INSTALL) -c -m 644 $$f $(DESTDIR)$(MANDIR)/man8 ;\
73 -rm -f $(PROGS) $(TESTS)
76 -rm -f *.BAK *.CKP *~ .emacs*
79 # Handy targets for systems needing special treatment:
80 # (Most POSIX systems should work with just "make all")
83 # DEC/OSF1 on the Alpha
85 $(MAKE) SYSDEFS="-DETC_ETHERS -Dint32=int -D_SOCKADDR_LEN" \
88 # Control Data EP/IX 1.4.3 system, BSD 4.3 mode
90 $(MAKE) CC="cc -systype bsd43" \
91 SYSDEFS="-Dconst= -D_SIZE_T -DNO_UNISTD -DUSE_BFUNCS" \
94 # Control Data EP/IX 2.1.1 system, SVR4 mode
96 $(MAKE) CC="cc -systype svr4" \
98 SYSLIBS="-lsocket -lnsl"
100 # IRIX 5.X (Silicon Graphics)
102 $(MAKE) SYSDEFS= SYSLIBS=
104 # Linux 1.1.80+ on [34]86
106 $(MAKE) SYSDEFS="-O6 -Wall -fomit-frame-pointer"
110 $(MAKE) SYSDEFS="-DSUNOS -DETC_ETHERS" \
113 # Solaris 2.X (i.e. SunOS 5.X)
115 $(MAKE) SYSDEFS="-DSVR4 -DETC_ETHERS" \
116 SYSLIBS="-lsocket -lnsl"
118 # Solaris 2.X (i.e. SunOS 5.X) with GCC. Note that GCC normally
119 # defines __STDC__=1 which breaks many Solaris header files...
121 $(MAKE) SYSDEFS="-DSVR4 -DETC_ETHERS -D__STDC__=0" \
122 SYSLIBS="-lsocket -lnsl" CC="gcc -Wall"
124 # UNIX System V Rel. 3
126 $(MAKE) SYSDEFS="-DSYSV"
128 # UNIX System V Rel. 4
130 $(MAKE) SYSDEFS="-DSVR4" \
131 SYSLIBS="-lsocket -lnsl"
133 # AT&T/GIS - Both AT&T StarServer and NCR 3000
134 # may work for others using Wollongong's WIN-TCP
136 $(MAKE) SYSDEFS="-DSVR4 -DWIN_TCP" \
137 SYSLIBS="-lsocket -lnsl"
140 # How to build each program:
143 OBJ_D= bootpd.o dovend.o readfile.o hash.o dumptab.o \
144 lookup.o getif.o hwaddr.o tzone.o report.o $(STRERROR)
146 $(CC) -o $@ $(OBJ_D) $(SYSLIBS)
148 OBJ_EF= bootpef.o dovend.o readfile.o hash.o dumptab.o \
149 lookup.o hwaddr.o tzone.o report.o $(STRERROR)
151 $(CC) -o $@ $(OBJ_EF) $(SYSLIBS)
153 OBJ_GW= bootpgw.o getif.o hwaddr.o report.o $(STRERROR)
155 $(CC) -o $@ $(OBJ_GW) $(SYSLIBS)
157 OBJ_TEST= bootptest.o print-bootp.o getif.o getether.o \
159 bootptest: $(OBJ_TEST)
160 $(CC) -o $@ $(OBJ_TEST) $(SYSLIBS)
162 # This is just for testing the lookup functions.
163 TRYLOOK= trylook.o lookup.o report.o $(STRERROR)
165 $(CC) -o $@ $(TRYLOOK) $(SYSLIBS)
167 # This is just for testing getif.
168 TRYGETIF= trygetif.o getif.o report.o $(STRERROR)
169 trygetif : $(TRYGETIF)
170 $(CC) -o $@ $(TRYGETIF) $(SYSLIBS)
172 # This is just for testing getether.
173 TRYGETEA= trygetea.o getether.o report.o $(STRERROR)
174 trygetea : $(TRYGETEA)
175 $(CC) -o $@ $(TRYGETEA) $(SYSLIBS)
177 # This rule just keeps the LOG_BOOTP define localized.
179 $(CC) $(CFLAGS) $(LOG_FACILITY) -c $<
181 # Punt SunOS -target noise
183 $(CC) $(CFLAGS) -c $<
186 # Header file dependencies:
189 bootpd.o : bootp.h bptypes.h hash.h hwaddr.h bootpd.h dovend.h
190 bootpd.o : readfile.h report.h tzone.h patchlevel.h getif.h
191 bootpef.o : bootp.h bptypes.h hash.h hwaddr.h bootpd.h dovend.h
192 bootpef.o : readfile.h report.h tzone.h patchlevel.h
193 bootpgw.o : bootp.h bptypes.h getif.h hwaddr.h report.h patchlevel.h
194 bootptest.o : bootp.h bptypes.h bootptest.h getif.h patchlevel.h
195 dovend.o : bootp.h bptypes.h bootpd.h hash.h hwaddr.h report.h dovend.h
196 dumptab.o : bootp.h bptypes.h hash.h hwaddr.h report.h patchlevel.h bootpd.h
197 getif.o : getif.h report.h
199 hwaddr.o : bptypes.h hwaddr.h report.h
200 lookup.o : bootp.h bptypes.h lookup.h report.h
201 print-bootp.o : bootp.h bptypes.h bootptest.h
202 readfile.o : bootp.h bptypes.h hash.h hwaddr.h lookup.h readfile.h
203 readfile.o : report.h tzone.h bootpd.h
205 tzone.o : bptypes.h report.h tzone.h