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