2 # Makefile for the BOOTP programs:
3 # bootpd - BOOTP server daemon
4 # bootpef - BOOTP extension file builder
5 # bootpgw - BOOTP gateway daemon
6 # bootptest - BOOTP tester (client)
10 # Remove the -DVEND_CMU if you don't wish to support the "CMU vendor format"
11 # in addition to the RFC1048 format. Leaving out DEBUG saves little.
12 OPTDEFS= -DSYSLOG -DVEND_CMU -DDEBUG
14 # Uncomment and edit this to choose the facility code used for syslog.
15 # LOG_FACILITY= "-DLOG_BOOTP=LOG_LOCAL2"
18 # Either uncomment some of the following, or do:
19 # "make sunos4" (or "make sunos5", etc.)
20 # SYSDEFS= -DSUNOS -DETC_ETHERS
22 # SYSLIBS= -lsocket -lnsl
24 # Uncomment this if your system does not provide streror(3)
28 # The next few lines may be uncommented and changed to alter the default
29 # filenames bootpd uses for its configuration and dump files.
30 #CONFFILE= -DCONFIG_FILE=\"/usr/etc/bootptab\"
31 #DUMPFILE= -DDUMPTAB_FILE=\"/usr/etc/bootpd.dump\"
32 #FILEDEFS= $(CONFFILE) $(DUMPFILE)
34 # MORE DEFinitions (whatever you might want to add)
35 # One might define NDEBUG (to remove "assert()" checks).
38 INSTALL=/usr/bin/install
43 CFLAGS= $(OPTDEFS) $(SYSDEFS) $(FILEDEFS) $(MOREDEFS)
44 PROGS= bootpd bootpef bootpgw bootptest
45 TESTS= trylook trygetif trygetea
47 all: $(PROGS) $(TESTS)
54 $(INSTALL) -c -s $$f $(DESTDIR)$(BINDIR) ;\
58 MAN8= bootpd.8 bootpef.8 bootptest.8
59 install.man: $(MAN5) $(MAN8)
62 $(INSTALL) -c -m 644 $$f $(DESTDIR)$(MANDIR)/man5 ;\
66 $(INSTALL) -c -m 644 $$f $(DESTDIR)$(MANDIR)/man8 ;\
71 -rm -f $(PROGS) $(TESTS)
74 -rm -f *.BAK *.CKP *~ .emacs*
77 # Handy targets for systems needing special treatment:
78 # (Most POSIX systems should work with just "make all")
81 # DEC/OSF1 on the Alpha
83 $(MAKE) SYSDEFS="-DETC_ETHERS -Dint32=int -D_SOCKADDR_LEN" \
86 # Control Data EP/IX 1.4.3 system, BSD 4.3 mode
88 $(MAKE) CC="cc -systype bsd43" \
89 SYSDEFS="-Dconst= -D_SIZE_T -DNO_UNISTD -DUSE_BFUNCS" \
92 # Control Data EP/IX 2.1.1 system, SVR4 mode
94 $(MAKE) CC="cc -systype svr4" \
96 SYSLIBS="-lsocket -lnsl"
98 # IRIX 5.X (Silicon Graphics)
100 $(MAKE) SYSDEFS= SYSLIBS=
102 # Linux 1.1.80+ on [34]86
104 $(MAKE) SYSDEFS="-O6 -Wall -fomit-frame-pointer"
108 $(MAKE) SYSDEFS="-DSUNOS -DETC_ETHERS" \
111 # Solaris 2.X (i.e. SunOS 5.X)
113 $(MAKE) SYSDEFS="-DSVR4 -DETC_ETHERS" \
114 SYSLIBS="-lsocket -lnsl"
116 # Solaris 2.X (i.e. SunOS 5.X) with GCC. Note that GCC normally
117 # defines __STDC__=1 which breaks many Solaris header files...
119 $(MAKE) SYSDEFS="-DSVR4 -DETC_ETHERS -D__STDC__=0" \
120 SYSLIBS="-lsocket -lnsl" CC="gcc -Wall"
122 # UNIX System V Rel. 3
124 $(MAKE) SYSDEFS="-DSYSV"
126 # UNIX System V Rel. 4
128 $(MAKE) SYSDEFS="-DSVR4" \
129 SYSLIBS="-lsocket -lnsl"
131 # AT&T/GIS - Both AT&T StarServer and NCR 3000
132 # may work for others using Wollongong's WIN-TCP
134 $(MAKE) SYSDEFS="-DSVR4 -DWIN_TCP" \
135 SYSLIBS="-lsocket -lnsl"
138 # How to build each program:
141 OBJ_D= bootpd.o dovend.o readfile.o hash.o dumptab.o \
142 lookup.o getif.o hwaddr.o tzone.o report.o $(STRERROR)
144 $(CC) -o $@ $(OBJ_D) $(SYSLIBS)
146 OBJ_EF= bootpef.o dovend.o readfile.o hash.o dumptab.o \
147 lookup.o hwaddr.o tzone.o report.o $(STRERROR)
149 $(CC) -o $@ $(OBJ_EF) $(SYSLIBS)
151 OBJ_GW= bootpgw.o getif.o hwaddr.o report.o $(STRERROR)
153 $(CC) -o $@ $(OBJ_GW) $(SYSLIBS)
155 OBJ_TEST= bootptest.o print-bootp.o getif.o getether.o \
157 bootptest: $(OBJ_TEST)
158 $(CC) -o $@ $(OBJ_TEST) $(SYSLIBS)
160 # This is just for testing the lookup functions.
161 TRYLOOK= trylook.o lookup.o report.o $(STRERROR)
163 $(CC) -o $@ $(TRYLOOK) $(SYSLIBS)
165 # This is just for testing getif.
166 TRYGETIF= trygetif.o getif.o report.o $(STRERROR)
167 trygetif : $(TRYGETIF)
168 $(CC) -o $@ $(TRYGETIF) $(SYSLIBS)
170 # This is just for testing getether.
171 TRYGETEA= trygetea.o getether.o report.o $(STRERROR)
172 trygetea : $(TRYGETEA)
173 $(CC) -o $@ $(TRYGETEA) $(SYSLIBS)
175 # This rule just keeps the LOG_BOOTP define localized.
177 $(CC) $(CFLAGS) $(LOG_FACILITY) -c $<
179 # Punt SunOS -target noise
181 $(CC) $(CFLAGS) -c $<
184 # Header file dependencies:
187 bootpd.o : bootp.h bptypes.h hash.h hwaddr.h bootpd.h dovend.h
188 bootpd.o : readfile.h report.h tzone.h patchlevel.h getif.h
189 bootpef.o : bootp.h bptypes.h hash.h hwaddr.h bootpd.h dovend.h
190 bootpef.o : readfile.h report.h tzone.h patchlevel.h
191 bootpgw.o : bootp.h bptypes.h getif.h hwaddr.h report.h patchlevel.h
192 bootptest.o : bootp.h bptypes.h bootptest.h getif.h patchlevel.h
193 dovend.o : bootp.h bptypes.h bootpd.h hash.h hwaddr.h report.h dovend.h
194 dumptab.o : bootp.h bptypes.h hash.h hwaddr.h report.h patchlevel.h bootpd.h
195 getif.o : getif.h report.h
197 hwaddr.o : bptypes.h hwaddr.h report.h
198 lookup.o : bootp.h bptypes.h lookup.h report.h
199 print-bootp.o : bootp.h bptypes.h bootptest.h
200 readfile.o : bootp.h bptypes.h hash.h hwaddr.h lookup.h readfile.h
201 readfile.o : report.h tzone.h bootpd.h
203 tzone.o : bptypes.h report.h tzone.h