144099b7bSPaul Traina# 244099b7bSPaul Traina# Makefile for the BOOTP programs: 344099b7bSPaul Traina# bootpd - BOOTP server daemon 444099b7bSPaul Traina# bootpef - BOOTP extension file builder 544099b7bSPaul Traina# bootpgw - BOOTP gateway daemon 644099b7bSPaul Traina# bootptest - BOOTP tester (client) 744099b7bSPaul Traina# 844099b7bSPaul Traina 944099b7bSPaul Traina# OPTion DEFinitions: 1044099b7bSPaul Traina# Remove the -DVEND_CMU if you don't wish to support the "CMU vendor format" 1144099b7bSPaul Traina# in addition to the RFC1048 format. Leaving out DEBUG saves little. 1244099b7bSPaul TrainaOPTDEFS= -DSYSLOG -DVEND_CMU -DDEBUG 1344099b7bSPaul Traina 1444099b7bSPaul Traina# Uncomment and edit this to choose the facility code used for syslog. 1544099b7bSPaul Traina# LOG_FACILITY= "-DLOG_BOOTP=LOG_LOCAL2" 1644099b7bSPaul Traina 1744099b7bSPaul Traina# SYStem DEFinitions: 1844099b7bSPaul Traina# Either uncomment some of the following, or do: 1944099b7bSPaul Traina# "make sunos4" (or "make sunos5", etc.) 2044099b7bSPaul Traina# SYSDEFS= -DSUNOS -DETC_ETHERS 2144099b7bSPaul Traina# SYSDEFS= -DSVR4 2244099b7bSPaul Traina# SYSLIBS= -lsocket -lnsl 2344099b7bSPaul Traina 2444099b7bSPaul Traina# Uncomment this if your system does not provide streror(3) 2544099b7bSPaul Traina# STRERROR=strerror.o 2644099b7bSPaul Traina 2744099b7bSPaul Traina# FILE DEFinitions: 2844099b7bSPaul Traina# The next few lines may be uncommented and changed to alter the default 2944099b7bSPaul Traina# filenames bootpd uses for its configuration and dump files. 3044099b7bSPaul Traina#CONFFILE= -DCONFIG_FILE=\"/usr/etc/bootptab\" 3144099b7bSPaul Traina#DUMPFILE= -DDUMPTAB_FILE=\"/usr/etc/bootpd.dump\" 3244099b7bSPaul Traina#FILEDEFS= $(CONFFILE) $(DUMPFILE) 3344099b7bSPaul Traina 3444099b7bSPaul Traina# MORE DEFinitions (whatever you might want to add) 3544099b7bSPaul Traina# One might define NDEBUG (to remove "assert()" checks). 3644099b7bSPaul TrainaMOREDEFS= 3744099b7bSPaul Traina 3844099b7bSPaul TrainaINSTALL=/usr/bin/install 3944099b7bSPaul TrainaDESTDIR= 4044099b7bSPaul TrainaBINDIR=/usr/etc 4144099b7bSPaul TrainaMANDIR=/usr/local/man 4244099b7bSPaul Traina 4344099b7bSPaul TrainaCFLAGS= $(OPTDEFS) $(SYSDEFS) $(FILEDEFS) $(MOREDEFS) 4444099b7bSPaul TrainaPROGS= bootpd bootpef bootpgw bootptest 4544099b7bSPaul TrainaTESTS= trylook trygetif trygetea 4644099b7bSPaul Traina 47e08ac58bSPaul Trainaall: $(PROGS) $(TESTS) 4844099b7bSPaul Traina 4944099b7bSPaul Trainasystem: install 5044099b7bSPaul Traina 5144099b7bSPaul Trainainstall: $(PROGS) 5244099b7bSPaul Traina -for f in $(PROGS) ;\ 5344099b7bSPaul Traina do \ 5444099b7bSPaul Traina $(INSTALL) -c -s $$f $(DESTDIR)$(BINDIR) ;\ 5544099b7bSPaul Traina done 5644099b7bSPaul Traina 5744099b7bSPaul TrainaMAN5= bootptab.5 5844099b7bSPaul TrainaMAN8= bootpd.8 bootpef.8 bootptest.8 5944099b7bSPaul Trainainstall.man: $(MAN5) $(MAN8) 6044099b7bSPaul Traina -for f in $(MAN5) ;\ 6144099b7bSPaul Traina do \ 6244099b7bSPaul Traina $(INSTALL) -c -m 644 $$f $(DESTDIR)$(MANDIR)/man5 ;\ 6344099b7bSPaul Traina done 6444099b7bSPaul Traina -for f in $(MAN8) ;\ 6544099b7bSPaul Traina do \ 6644099b7bSPaul Traina $(INSTALL) -c -m 644 $$f $(DESTDIR)$(MANDIR)/man8 ;\ 6744099b7bSPaul Traina done 6844099b7bSPaul Traina 6944099b7bSPaul Trainaclean: 7044099b7bSPaul Traina -rm -f core *.o 7144099b7bSPaul Traina -rm -f $(PROGS) $(TESTS) 7244099b7bSPaul Traina 7344099b7bSPaul Trainadistclean: 7444099b7bSPaul Traina -rm -f *.BAK *.CKP *~ .emacs* 7544099b7bSPaul Traina 7644099b7bSPaul Traina# 77e08ac58bSPaul Traina# Handy targets for systems needing special treatment: 78e08ac58bSPaul Traina# (Most POSIX systems should work with just "make all") 7944099b7bSPaul Traina# 8044099b7bSPaul Traina 8144099b7bSPaul Traina# DEC/OSF1 on the Alpha 8244099b7bSPaul Trainaalpha: 8344099b7bSPaul Traina $(MAKE) SYSDEFS="-DETC_ETHERS -Dint32=int -D_SOCKADDR_LEN" \ 8444099b7bSPaul Traina STRERROR=strerror.o 8544099b7bSPaul Traina 8644099b7bSPaul Traina# Control Data EP/IX 1.4.3 system, BSD 4.3 mode 8744099b7bSPaul Trainaepix143: 8844099b7bSPaul Traina $(MAKE) CC="cc -systype bsd43" \ 8944099b7bSPaul Traina SYSDEFS="-Dconst= -D_SIZE_T -DNO_UNISTD -DUSE_BFUNCS" \ 9044099b7bSPaul Traina STRERROR=strerror.o 9144099b7bSPaul Traina 9244099b7bSPaul Traina# Control Data EP/IX 2.1.1 system, SVR4 mode 9344099b7bSPaul Trainaepix211: 9444099b7bSPaul Traina $(MAKE) CC="cc -systype svr4" \ 9544099b7bSPaul Traina SYSDEFS="-DSVR4" \ 9644099b7bSPaul Traina SYSLIBS="-lsocket -lnsl" 9744099b7bSPaul Traina 98e08ac58bSPaul Traina# IRIX 5.X (Silicon Graphics) 9944099b7bSPaul Trainairix: 100e08ac58bSPaul Traina $(MAKE) SYSDEFS= SYSLIBS= 101e08ac58bSPaul Traina 102e08ac58bSPaul Traina# Linux 1.1.80+ on [34]86 103e08ac58bSPaul Trainalinux: 104e08ac58bSPaul Traina $(MAKE) SYSDEFS="-O6 -Wall -fomit-frame-pointer" 10544099b7bSPaul Traina 10644099b7bSPaul Traina# SunOS 4.X 10744099b7bSPaul Trainasunos4: 10844099b7bSPaul Traina $(MAKE) SYSDEFS="-DSUNOS -DETC_ETHERS" \ 10944099b7bSPaul Traina STRERROR=strerror.o 11044099b7bSPaul Traina 11144099b7bSPaul Traina# Solaris 2.X (i.e. SunOS 5.X) 11244099b7bSPaul Trainasunos5: 11344099b7bSPaul Traina $(MAKE) SYSDEFS="-DSVR4 -DETC_ETHERS" \ 11444099b7bSPaul Traina SYSLIBS="-lsocket -lnsl" 11544099b7bSPaul Traina 116e08ac58bSPaul Traina# Solaris 2.X (i.e. SunOS 5.X) with GCC. Note that GCC normally 117e08ac58bSPaul Traina# defines __STDC__=1 which breaks many Solaris header files... 118e08ac58bSPaul Trainasunos5gcc: 119e08ac58bSPaul Traina $(MAKE) SYSDEFS="-DSVR4 -DETC_ETHERS -D__STDC__=0" \ 120e08ac58bSPaul Traina SYSLIBS="-lsocket -lnsl" CC="gcc -Wall" 121e08ac58bSPaul Traina 122e08ac58bSPaul Traina# UNIX System V Rel. 3 123e08ac58bSPaul Trainasvr3: 124e08ac58bSPaul Traina $(MAKE) SYSDEFS="-DSYSV" 125e08ac58bSPaul Traina 126e08ac58bSPaul Traina# UNIX System V Rel. 4 12744099b7bSPaul Trainasvr4: 12844099b7bSPaul Traina $(MAKE) SYSDEFS="-DSVR4" \ 12944099b7bSPaul Traina SYSLIBS="-lsocket -lnsl" 13044099b7bSPaul Traina 131e08ac58bSPaul Traina# AT&T/GIS - Both AT&T StarServer and NCR 3000 132e08ac58bSPaul Traina# may work for others using Wollongong's WIN-TCP 133e08ac58bSPaul Trainawollongong gis : 134e08ac58bSPaul Traina $(MAKE) SYSDEFS="-DSVR4 -DWIN_TCP" \ 135e08ac58bSPaul Traina SYSLIBS="-lsocket -lnsl" 136e08ac58bSPaul Traina 13744099b7bSPaul Traina# 13844099b7bSPaul Traina# How to build each program: 13944099b7bSPaul Traina# 14044099b7bSPaul Traina 14144099b7bSPaul TrainaOBJ_D= bootpd.o dovend.o readfile.o hash.o dumptab.o \ 14244099b7bSPaul Traina lookup.o getif.o hwaddr.o tzone.o report.o $(STRERROR) 14344099b7bSPaul Trainabootpd: $(OBJ_D) 14444099b7bSPaul Traina $(CC) -o $@ $(OBJ_D) $(SYSLIBS) 14544099b7bSPaul Traina 14644099b7bSPaul TrainaOBJ_EF= bootpef.o dovend.o readfile.o hash.o dumptab.o \ 14744099b7bSPaul Traina lookup.o hwaddr.o tzone.o report.o $(STRERROR) 14844099b7bSPaul Trainabootpef: $(OBJ_EF) 14944099b7bSPaul Traina $(CC) -o $@ $(OBJ_EF) $(SYSLIBS) 15044099b7bSPaul Traina 15144099b7bSPaul TrainaOBJ_GW= bootpgw.o getif.o hwaddr.o report.o $(STRERROR) 15244099b7bSPaul Trainabootpgw: $(OBJ_GW) 15344099b7bSPaul Traina $(CC) -o $@ $(OBJ_GW) $(SYSLIBS) 15444099b7bSPaul Traina 15544099b7bSPaul TrainaOBJ_TEST= bootptest.o print-bootp.o getif.o getether.o \ 15644099b7bSPaul Traina report.o $(STRERROR) 15744099b7bSPaul Trainabootptest: $(OBJ_TEST) 15844099b7bSPaul Traina $(CC) -o $@ $(OBJ_TEST) $(SYSLIBS) 15944099b7bSPaul Traina 16044099b7bSPaul Traina# This is just for testing the lookup functions. 16144099b7bSPaul TrainaTRYLOOK= trylook.o lookup.o report.o $(STRERROR) 16244099b7bSPaul Trainatrylook : $(TRYLOOK) 16344099b7bSPaul Traina $(CC) -o $@ $(TRYLOOK) $(SYSLIBS) 16444099b7bSPaul Traina 16544099b7bSPaul Traina# This is just for testing getif. 16644099b7bSPaul TrainaTRYGETIF= trygetif.o getif.o report.o $(STRERROR) 16744099b7bSPaul Trainatrygetif : $(TRYGETIF) 16844099b7bSPaul Traina $(CC) -o $@ $(TRYGETIF) $(SYSLIBS) 16944099b7bSPaul Traina 17044099b7bSPaul Traina# This is just for testing getether. 17144099b7bSPaul TrainaTRYGETEA= trygetea.o getether.o report.o $(STRERROR) 17244099b7bSPaul Trainatrygetea : $(TRYGETEA) 17344099b7bSPaul Traina $(CC) -o $@ $(TRYGETEA) $(SYSLIBS) 17444099b7bSPaul Traina 17544099b7bSPaul Traina# This rule just keeps the LOG_BOOTP define localized. 17644099b7bSPaul Trainareport.o : report.c 17744099b7bSPaul Traina $(CC) $(CFLAGS) $(LOG_FACILITY) -c $< 17844099b7bSPaul Traina 17944099b7bSPaul Traina# Punt SunOS -target noise 18044099b7bSPaul Traina.c.o: 18144099b7bSPaul Traina $(CC) $(CFLAGS) -c $< 18244099b7bSPaul Traina 18344099b7bSPaul Traina# 18444099b7bSPaul Traina# Header file dependencies: 18544099b7bSPaul Traina# 18644099b7bSPaul Traina 18744099b7bSPaul Trainabootpd.o : bootp.h bptypes.h hash.h hwaddr.h bootpd.h dovend.h 18844099b7bSPaul Trainabootpd.o : readfile.h report.h tzone.h patchlevel.h getif.h 18944099b7bSPaul Trainabootpef.o : bootp.h bptypes.h hash.h hwaddr.h bootpd.h dovend.h 19044099b7bSPaul Trainabootpef.o : readfile.h report.h tzone.h patchlevel.h 19144099b7bSPaul Trainabootpgw.o : bootp.h bptypes.h getif.h hwaddr.h report.h patchlevel.h 19244099b7bSPaul Trainabootptest.o : bootp.h bptypes.h bootptest.h getif.h patchlevel.h 19344099b7bSPaul Trainadovend.o : bootp.h bptypes.h bootpd.h hash.h hwaddr.h report.h dovend.h 19444099b7bSPaul Trainadumptab.o : bootp.h bptypes.h hash.h hwaddr.h report.h patchlevel.h bootpd.h 19544099b7bSPaul Trainagetif.o : getif.h report.h 19644099b7bSPaul Trainahash.o : hash.h 19744099b7bSPaul Trainahwaddr.o : bptypes.h hwaddr.h report.h 19844099b7bSPaul Trainalookup.o : bootp.h bptypes.h lookup.h report.h 19944099b7bSPaul Trainaprint-bootp.o : bootp.h bptypes.h bootptest.h 20044099b7bSPaul Trainareadfile.o : bootp.h bptypes.h hash.h hwaddr.h lookup.h readfile.h 20144099b7bSPaul Trainareadfile.o : report.h tzone.h bootpd.h 20244099b7bSPaul Trainareport.o : report.h 20344099b7bSPaul Trainatzone.o : bptypes.h report.h tzone.h 204