1 1.1 gwr # 2 1.1 gwr # Makefile for the BOOTP programs: 3 1.1 gwr # bootpd - BOOTP server daemon 4 1.1 gwr # bootpef - BOOTP extension file builder 5 1.1 gwr # bootpgw - BOOTP gateway daemon 6 1.1 gwr # bootptest - BOOTP tester (client) 7 1.1 gwr # 8 1.1 gwr 9 1.1 gwr # OPTion DEFinitions: 10 1.1 gwr # Remove the -DVEND_CMU if you don't wish to support the "CMU vendor format" 11 1.1 gwr # in addition to the RFC1048 format. Leaving out DEBUG saves little. 12 1.1 gwr OPTDEFS= -DSYSLOG -DVEND_CMU -DDEBUG 13 1.1 gwr 14 1.1 gwr # Uncomment and edit this to choose the facility code used for syslog. 15 1.1 gwr # LOG_FACILITY= "-DLOG_BOOTP=LOG_LOCAL2" 16 1.1 gwr 17 1.1 gwr # SYStem DEFinitions: 18 1.1 gwr # Either uncomment some of the following, or do: 19 1.1 gwr # "make sunos4" (or "make sunos5", etc.) 20 1.1 gwr # SYSDEFS= -DSUNOS -DETC_ETHERS 21 1.1 gwr # SYSDEFS= -DSVR4 22 1.1 gwr # SYSLIBS= -lsocket -lnsl 23 1.1 gwr 24 1.1 gwr # Uncomment this if your system does not provide streror(3) 25 1.1 gwr # STRERROR=strerror.o 26 1.1 gwr 27 1.1 gwr # FILE DEFinitions: 28 1.1 gwr # The next few lines may be uncommented and changed to alter the default 29 1.1 gwr # filenames bootpd uses for its configuration and dump files. 30 1.1 gwr #CONFFILE= -DCONFIG_FILE=\"/usr/etc/bootptab\" 31 1.1 gwr #DUMPFILE= -DDUMPTAB_FILE=\"/usr/etc/bootpd.dump\" 32 1.1 gwr #FILEDEFS= $(CONFFILE) $(DUMPFILE) 33 1.1 gwr 34 1.1 gwr # MORE DEFinitions (whatever you might want to add) 35 1.1 gwr # One might define NDEBUG (to remove "assert()" checks). 36 1.1 gwr MOREDEFS= 37 1.1 gwr 38 1.1 gwr INSTALL=/usr/bin/install 39 1.1 gwr DESTDIR= 40 1.1 gwr BINDIR=/usr/etc 41 1.1 gwr MANDIR=/usr/local/man 42 1.1 gwr 43 1.1 gwr CFLAGS= $(OPTDEFS) $(SYSDEFS) $(FILEDEFS) $(MOREDEFS) 44 1.1 gwr PROGS= bootpd bootpef bootpgw bootptest 45 1.1 gwr TESTS= trylook trygetif trygetea 46 1.1 gwr 47 1.1 gwr all: $(PROGS) 48 1.1 gwr 49 1.1 gwr tests: $(TESTS) 50 1.1 gwr 51 1.1 gwr system: install 52 1.1 gwr 53 1.1 gwr install: $(PROGS) 54 1.1 gwr -for f in $(PROGS) ;\ 55 1.1 gwr do \ 56 1.1 gwr $(INSTALL) -c -s $$f $(DESTDIR)$(BINDIR) ;\ 57 1.1 gwr done 58 1.1 gwr 59 1.1 gwr MAN5= bootptab.5 60 1.1 gwr MAN8= bootpd.8 bootpef.8 bootptest.8 61 1.1 gwr install.man: $(MAN5) $(MAN8) 62 1.1 gwr -for f in $(MAN5) ;\ 63 1.1 gwr do \ 64 1.1 gwr $(INSTALL) -c -m 644 $$f $(DESTDIR)$(MANDIR)/man5 ;\ 65 1.1 gwr done 66 1.1 gwr -for f in $(MAN8) ;\ 67 1.1 gwr do \ 68 1.1 gwr $(INSTALL) -c -m 644 $$f $(DESTDIR)$(MANDIR)/man8 ;\ 69 1.1 gwr done 70 1.1 gwr 71 1.1 gwr clean: 72 1.1 gwr -rm -f core *.o 73 1.1 gwr -rm -f $(PROGS) $(TESTS) 74 1.1 gwr 75 1.1 gwr distclean: 76 1.1 gwr -rm -f *.BAK *.CKP *~ .emacs* 77 1.1 gwr 78 1.1 gwr # 79 1.1 gwr # Handy targets for individual systems: 80 1.1 gwr # 81 1.1 gwr 82 1.1 gwr # DEC/OSF1 on the Alpha 83 1.1 gwr alpha: 84 1.1 gwr $(MAKE) SYSDEFS="-DETC_ETHERS -Dint32=int -D_SOCKADDR_LEN" \ 85 1.1 gwr STRERROR=strerror.o 86 1.1 gwr 87 1.1 gwr # Control Data EP/IX 1.4.3 system, BSD 4.3 mode 88 1.1 gwr epix143: 89 1.1 gwr $(MAKE) CC="cc -systype bsd43" \ 90 1.1 gwr SYSDEFS="-Dconst= -D_SIZE_T -DNO_UNISTD -DUSE_BFUNCS" \ 91 1.1 gwr STRERROR=strerror.o 92 1.1 gwr 93 1.1 gwr # Control Data EP/IX 2.1.1 system, SVR4 mode 94 1.1 gwr epix211: 95 1.1 gwr $(MAKE) CC="cc -systype svr4" \ 96 1.1 gwr SYSDEFS="-DSVR4" \ 97 1.1 gwr SYSLIBS="-lsocket -lnsl" 98 1.1 gwr 99 1.1 gwr # Silicon Graphics IRIX (no <sys/sockio.h>, so not SVR4) 100 1.1 gwr irix: 101 1.1 gwr $(MAKE) SYSDEFS="-DSYSV -DIRIX" 102 1.1 gwr 103 1.1 gwr # SunOS 4.X 104 1.1 gwr sunos4: 105 1.1 gwr $(MAKE) SYSDEFS="-DSUNOS -DETC_ETHERS" \ 106 1.1 gwr STRERROR=strerror.o 107 1.1 gwr 108 1.1 gwr # Solaris 2.X (i.e. SunOS 5.X) 109 1.1 gwr sunos5: 110 1.1 gwr $(MAKE) SYSDEFS="-DSVR4 -DETC_ETHERS" \ 111 1.1 gwr SYSLIBS="-lsocket -lnsl" 112 1.1 gwr 113 1.1 gwr # UNIX System V Rel. 4 (also: IRIX 5.X, others) 114 1.1 gwr svr4: 115 1.1 gwr $(MAKE) SYSDEFS="-DSVR4" \ 116 1.1 gwr SYSLIBS="-lsocket -lnsl" 117 1.1 gwr 118 1.1 gwr # 119 1.1 gwr # How to build each program: 120 1.1 gwr # 121 1.1 gwr 122 1.1 gwr OBJ_D= bootpd.o dovend.o readfile.o hash.o dumptab.o \ 123 1.1 gwr lookup.o getif.o hwaddr.o tzone.o report.o $(STRERROR) 124 1.1 gwr bootpd: $(OBJ_D) 125 1.1 gwr $(CC) -o $@ $(OBJ_D) $(SYSLIBS) 126 1.1 gwr 127 1.1 gwr OBJ_EF= bootpef.o dovend.o readfile.o hash.o dumptab.o \ 128 1.1 gwr lookup.o hwaddr.o tzone.o report.o $(STRERROR) 129 1.1 gwr bootpef: $(OBJ_EF) 130 1.1 gwr $(CC) -o $@ $(OBJ_EF) $(SYSLIBS) 131 1.1 gwr 132 1.1 gwr OBJ_GW= bootpgw.o getif.o hwaddr.o report.o $(STRERROR) 133 1.1 gwr bootpgw: $(OBJ_GW) 134 1.1 gwr $(CC) -o $@ $(OBJ_GW) $(SYSLIBS) 135 1.1 gwr 136 1.1 gwr OBJ_TEST= bootptest.o print-bootp.o getif.o getether.o \ 137 1.1 gwr report.o $(STRERROR) 138 1.1 gwr bootptest: $(OBJ_TEST) 139 1.1 gwr $(CC) -o $@ $(OBJ_TEST) $(SYSLIBS) 140 1.1 gwr 141 1.1 gwr print-bootp.o : print-bootp.c 142 1.1 gwr $(CC) $(CFLAGS) -DBOOTPTEST -c $< 143 1.1 gwr 144 1.1 gwr # This is just for testing the lookup functions. 145 1.1 gwr TRYLOOK= trylook.o lookup.o report.o $(STRERROR) 146 1.1 gwr trylook : $(TRYLOOK) 147 1.1 gwr $(CC) -o $@ $(TRYLOOK) $(SYSLIBS) 148 1.1 gwr 149 1.1 gwr # This is just for testing getif. 150 1.1 gwr TRYGETIF= trygetif.o getif.o report.o $(STRERROR) 151 1.1 gwr trygetif : $(TRYGETIF) 152 1.1 gwr $(CC) -o $@ $(TRYGETIF) $(SYSLIBS) 153 1.1 gwr 154 1.1 gwr # This is just for testing getether. 155 1.1 gwr TRYGETEA= trygetea.o getether.o report.o $(STRERROR) 156 1.1 gwr trygetea : $(TRYGETEA) 157 1.1 gwr $(CC) -o $@ $(TRYGETEA) $(SYSLIBS) 158 1.1 gwr 159 1.1 gwr # This rule just keeps the LOG_BOOTP define localized. 160 1.1 gwr report.o : report.c 161 1.1 gwr $(CC) $(CFLAGS) $(LOG_FACILITY) -c $< 162 1.1 gwr 163 1.1 gwr # Punt SunOS -target noise 164 1.1 gwr .c.o: 165 1.1 gwr $(CC) $(CFLAGS) -c $< 166 1.1 gwr 167 1.1 gwr # 168 1.1 gwr # Header file dependencies: 169 1.1 gwr # 170 1.1 gwr 171 1.1 gwr bootpd.o : bootp.h bptypes.h hash.h hwaddr.h bootpd.h dovend.h 172 1.1 gwr bootpd.o : readfile.h report.h tzone.h patchlevel.h getif.h 173 1.1 gwr bootpef.o : bootp.h bptypes.h hash.h hwaddr.h bootpd.h dovend.h 174 1.1 gwr bootpef.o : readfile.h report.h tzone.h patchlevel.h 175 1.1 gwr bootpgw.o : bootp.h bptypes.h getif.h hwaddr.h report.h patchlevel.h 176 1.1 gwr bootptest.o : bootp.h bptypes.h bootptest.h getif.h patchlevel.h 177 1.1 gwr dovend.o : bootp.h bptypes.h bootpd.h hash.h hwaddr.h report.h dovend.h 178 1.1 gwr dumptab.o : bootp.h bptypes.h hash.h hwaddr.h report.h patchlevel.h bootpd.h 179 1.1 gwr getif.o : getif.h report.h 180 1.1 gwr hash.o : hash.h 181 1.1 gwr hwaddr.o : bptypes.h hwaddr.h report.h 182 1.1 gwr lookup.o : bootp.h bptypes.h lookup.h report.h 183 1.1 gwr print-bootp.o : bootp.h bptypes.h bootptest.h 184 1.1 gwr readfile.o : bootp.h bptypes.h hash.h hwaddr.h lookup.h readfile.h 185 1.1 gwr readfile.o : report.h tzone.h bootpd.h 186 1.1 gwr report.o : report.h 187 1.1 gwr tzone.o : bptypes.h report.h tzone.h 188