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
58 $(INSTALL) -c -s $$f $(DESTDIR)$(BINDIR) ;\
62 MAN8= bootpd.8 bootpef.8 bootptest.8
63 install.man: $(MAN5) $(MAN8)
66 $(INSTALL) -c -m 644 $$f $(DESTDIR)$(MANDIR)/man5 ;\
70 $(INSTALL) -c -m 644 $$f $(DESTDIR)$(MANDIR)/man8 ;\
75 -rm -f $(PROGS) $(TESTS)
78 -rm -f *.BAK *.CKP *~ .emacs*
81 # Handy targets for individual systems:
84 # DEC/OSF1 on the Alpha
86 $(MAKE) SYSDEFS="-DETC_ETHERS -Dint32=int -D_SOCKADDR_LEN" \
89 # Control Data EP/IX 1.4.3 system, BSD 4.3 mode
91 $(MAKE) CC="cc -systype bsd43" \
92 SYSDEFS="-Dconst= -D_SIZE_T -DNO_UNISTD -DUSE_BFUNCS" \
95 # Control Data EP/IX 2.1.1 system, SVR4 mode
97 $(MAKE) CC="cc -systype svr4" \
99 SYSLIBS="-lsocket -lnsl"
101 # Silicon Graphics IRIX (no <sys/sockio.h>, so not SVR4)
103 $(MAKE) SYSDEFS="-DSYSV -DIRIX"
107 $(MAKE) SYSDEFS="-DSUNOS -DETC_ETHERS" \
110 # Solaris 2.X (i.e. SunOS 5.X)
112 $(MAKE) SYSDEFS="-DSVR4 -DETC_ETHERS" \
113 SYSLIBS="-lsocket -lnsl"
115 # UNIX System V Rel. 4 (also: IRIX 5.X, others)
117 $(MAKE) SYSDEFS="-DSVR4" \
118 SYSLIBS="-lsocket -lnsl"
121 # How to build each program:
124 OBJ_D= bootpd.o dovend.o readfile.o hash.o dumptab.o \
125 lookup.o getif.o hwaddr.o tzone.o report.o $(STRERROR)
127 $(CC) -o $@ $(OBJ_D) $(SYSLIBS)
129 OBJ_EF= bootpef.o dovend.o readfile.o hash.o dumptab.o \
130 lookup.o hwaddr.o tzone.o report.o $(STRERROR)
132 $(CC) -o $@ $(OBJ_EF) $(SYSLIBS)
134 OBJ_GW= bootpgw.o getif.o hwaddr.o report.o $(STRERROR)
136 $(CC) -o $@ $(OBJ_GW) $(SYSLIBS)
138 OBJ_TEST= bootptest.o print-bootp.o getif.o getether.o \
140 bootptest: $(OBJ_TEST)
141 $(CC) -o $@ $(OBJ_TEST) $(SYSLIBS)
143 # This is just for testing the lookup functions.
144 TRYLOOK= trylook.o lookup.o report.o $(STRERROR)
146 $(CC) -o $@ $(TRYLOOK) $(SYSLIBS)
148 # This is just for testing getif.
149 TRYGETIF= trygetif.o getif.o report.o $(STRERROR)
150 trygetif : $(TRYGETIF)
151 $(CC) -o $@ $(TRYGETIF) $(SYSLIBS)
153 # This is just for testing getether.
154 TRYGETEA= trygetea.o getether.o report.o $(STRERROR)
155 trygetea : $(TRYGETEA)
156 $(CC) -o $@ $(TRYGETEA) $(SYSLIBS)
158 # This rule just keeps the LOG_BOOTP define localized.
160 $(CC) $(CFLAGS) $(LOG_FACILITY) -c $<
162 # Punt SunOS -target noise
164 $(CC) $(CFLAGS) -c $<
167 # Header file dependencies:
170 bootpd.o : bootp.h bptypes.h hash.h hwaddr.h bootpd.h dovend.h
171 bootpd.o : readfile.h report.h tzone.h patchlevel.h getif.h
172 bootpef.o : bootp.h bptypes.h hash.h hwaddr.h bootpd.h dovend.h
173 bootpef.o : readfile.h report.h tzone.h patchlevel.h
174 bootpgw.o : bootp.h bptypes.h getif.h hwaddr.h report.h patchlevel.h
175 bootptest.o : bootp.h bptypes.h bootptest.h getif.h patchlevel.h
176 dovend.o : bootp.h bptypes.h bootpd.h hash.h hwaddr.h report.h dovend.h
177 dumptab.o : bootp.h bptypes.h hash.h hwaddr.h report.h patchlevel.h bootpd.h
178 getif.o : getif.h report.h
180 hwaddr.o : bptypes.h hwaddr.h report.h
181 lookup.o : bootp.h bptypes.h lookup.h report.h
182 print-bootp.o : bootp.h bptypes.h bootptest.h
183 readfile.o : bootp.h bptypes.h hash.h hwaddr.h lookup.h readfile.h
184 readfile.o : report.h tzone.h bootpd.h
186 tzone.o : bptypes.h report.h tzone.h