3 # Makefile for the BOOTP programs:
4 # bootpd - BOOTP server daemon
5 # bootpef - BOOTP extension file builder
6 # bootpgw - BOOTP gateway daemon
7 # bootptest - BOOTP tester (client)
11 # Remove the -DVEND_CMU if you don't wish to support the "CMU vendor format"
12 # in addition to the RFC1048 format. Leaving out DEBUG saves little.
13 OPTDEFS= -DSYSLOG -DVEND_CMU -DDEBUG
15 # Uncomment and edit this to choose the facility code used for syslog.
16 # LOG_FACILITY= "-DLOG_BOOTP=LOG_LOCAL2"
19 # Either uncomment some of the following, or do:
20 # "make sunos4" (or "make sunos5", etc.)
21 # SYSDEFS= -DSUNOS -DETC_ETHERS
23 # SYSLIBS= -lsocket -lnsl
25 # Uncomment this if your system does not provide streror(3)
29 # The next few lines may be uncommented and changed to alter the default
30 # filenames bootpd uses for its configuration and dump files.
31 #CONFFILE= -DCONFIG_FILE=\"/usr/etc/bootptab\"
32 #DUMPFILE= -DDUMPTAB_FILE=\"/usr/etc/bootpd.dump\"
33 #FILEDEFS= $(CONFFILE) $(DUMPFILE)
35 # MORE DEFinitions (whatever you might want to add)
36 # One might define NDEBUG (to remove "assert()" checks).
39 INSTALL=/usr/bin/install
44 CFLAGS= $(OPTDEFS) $(SYSDEFS) $(FILEDEFS) $(MOREDEFS)
45 PROGS= bootpd bootpef bootpgw bootptest
46 TESTS= trylook trygetif trygetea
48 all: $(PROGS) $(TESTS)
55 $(INSTALL) -c -s $$f $(DESTDIR)$(BINDIR) ;\
59 MAN8= bootpd.8 bootpef.8 bootptest.8
60 install.man: $(MAN5) $(MAN8)
63 $(INSTALL) -c -m 644 $$f $(DESTDIR)$(MANDIR)/man5 ;\
67 $(INSTALL) -c -m 644 $$f $(DESTDIR)$(MANDIR)/man8 ;\
72 -rm -f $(PROGS) $(TESTS)
75 -rm -f *.BAK *.CKP *~ .emacs*
78 # Handy targets for systems needing special treatment:
79 # (Most POSIX systems should work with just "make all")
82 # DEC/OSF1 on the Alpha
84 $(MAKE) SYSDEFS="-DETC_ETHERS -Dint32=int -D_SOCKADDR_LEN" \
87 # Control Data EP/IX 1.4.3 system, BSD 4.3 mode
89 $(MAKE) CC="cc -systype bsd43" \
90 SYSDEFS="-Dconst= -D_SIZE_T -DNO_UNISTD -DUSE_BFUNCS" \
93 # Control Data EP/IX 2.1.1 system, SVR4 mode
95 $(MAKE) CC="cc -systype svr4" \
97 SYSLIBS="-lsocket -lnsl"
99 # IRIX 5.X (Silicon Graphics)
101 $(MAKE) SYSDEFS= SYSLIBS=
103 # Linux 1.1.80+ on [34]86
105 $(MAKE) SYSDEFS="-O6 -Wall -fomit-frame-pointer"
109 $(MAKE) SYSDEFS="-DSUNOS -DETC_ETHERS" \
112 # Solaris 2.X (i.e. SunOS 5.X)
114 $(MAKE) SYSDEFS="-DSVR4 -DETC_ETHERS" \
115 SYSLIBS="-lsocket -lnsl"
117 # Solaris 2.X (i.e. SunOS 5.X) with GCC. Note that GCC normally
118 # defines __STDC__=1 which breaks many Solaris header files...
120 $(MAKE) SYSDEFS="-DSVR4 -DETC_ETHERS -D__STDC__=0" \
121 SYSLIBS="-lsocket -lnsl" CC="gcc -Wall"
123 # UNIX System V Rel. 3
125 $(MAKE) SYSDEFS="-DSYSV"
127 # UNIX System V Rel. 4
129 $(MAKE) SYSDEFS="-DSVR4" \
130 SYSLIBS="-lsocket -lnsl"
132 # AT&T/GIS - Both AT&T StarServer and NCR 3000
133 # may work for others using Wollongong's WIN-TCP
135 $(MAKE) SYSDEFS="-DSVR4 -DWIN_TCP" \
136 SYSLIBS="-lsocket -lnsl"
139 # How to build each program:
142 OBJ_D= bootpd.o dovend.o readfile.o hash.o dumptab.o \
143 lookup.o getif.o hwaddr.o tzone.o report.o $(STRERROR)
145 $(CC) -o $@ $(OBJ_D) $(SYSLIBS)
147 OBJ_EF= bootpef.o dovend.o readfile.o hash.o dumptab.o \
148 lookup.o hwaddr.o tzone.o report.o $(STRERROR)
150 $(CC) -o $@ $(OBJ_EF) $(SYSLIBS)
152 OBJ_GW= bootpgw.o getif.o hwaddr.o report.o $(STRERROR)
154 $(CC) -o $@ $(OBJ_GW) $(SYSLIBS)
156 OBJ_TEST= bootptest.o print-bootp.o getif.o getether.o \
158 bootptest: $(OBJ_TEST)
159 $(CC) -o $@ $(OBJ_TEST) $(SYSLIBS)
161 # This is just for testing the lookup functions.
162 TRYLOOK= trylook.o lookup.o report.o $(STRERROR)
164 $(CC) -o $@ $(TRYLOOK) $(SYSLIBS)
166 # This is just for testing getif.
167 TRYGETIF= trygetif.o getif.o report.o $(STRERROR)
168 trygetif : $(TRYGETIF)
169 $(CC) -o $@ $(TRYGETIF) $(SYSLIBS)
171 # This is just for testing getether.
172 TRYGETEA= trygetea.o getether.o report.o $(STRERROR)
173 trygetea : $(TRYGETEA)
174 $(CC) -o $@ $(TRYGETEA) $(SYSLIBS)
176 # This rule just keeps the LOG_BOOTP define localized.
178 $(CC) $(CFLAGS) $(LOG_FACILITY) -c $<
180 # Punt SunOS -target noise
182 $(CC) $(CFLAGS) -c $<
185 # Header file dependencies:
188 bootpd.o : bootp.h bptypes.h hash.h hwaddr.h bootpd.h dovend.h
189 bootpd.o : readfile.h report.h tzone.h patchlevel.h getif.h
190 bootpef.o : bootp.h bptypes.h hash.h hwaddr.h bootpd.h dovend.h
191 bootpef.o : readfile.h report.h tzone.h patchlevel.h
192 bootpgw.o : bootp.h bptypes.h getif.h hwaddr.h report.h patchlevel.h
193 bootptest.o : bootp.h bptypes.h bootptest.h getif.h patchlevel.h
194 dovend.o : bootp.h bptypes.h bootpd.h hash.h hwaddr.h report.h dovend.h
195 dumptab.o : bootp.h bptypes.h hash.h hwaddr.h report.h patchlevel.h bootpd.h
196 getif.o : getif.h report.h
198 hwaddr.o : bptypes.h hwaddr.h report.h
199 lookup.o : bootp.h bptypes.h lookup.h report.h
200 print-bootp.o : bootp.h bptypes.h bootptest.h
201 readfile.o : bootp.h bptypes.h hash.h hwaddr.h lookup.h readfile.h
202 readfile.o : report.h tzone.h bootpd.h
204 tzone.o : bptypes.h report.h tzone.h