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