1# $FreeBSD: src/libexec/bootpd/Makefile.UNIX,v 1.5 1999/08/28 00:09:14 peter Exp $ 2# $DragonFly: src/libexec/bootpd/Makefile.UNIX,v 1.2 2003/06/17 04:27:07 dillon Exp $ 3# 4# Makefile for the BOOTP programs: 5# bootpd - BOOTP server daemon 6# bootpef - BOOTP extension file builder 7# bootpgw - BOOTP gateway daemon 8# bootptest - BOOTP tester (client) 9# 10 11# OPTion DEFinitions: 12# Remove the -DVEND_CMU if you don't wish to support the "CMU vendor format" 13# in addition to the RFC1048 format. Leaving out DEBUG saves little. 14OPTDEFS= -DSYSLOG -DVEND_CMU -DDEBUG 15 16# Uncomment and edit this to choose the facility code used for syslog. 17# LOG_FACILITY= "-DLOG_BOOTP=LOG_LOCAL2" 18 19# SYStem DEFinitions: 20# Either uncomment some of the following, or do: 21# "make sunos4" (or "make sunos5", etc.) 22# SYSDEFS= -DSUNOS -DETC_ETHERS 23# SYSDEFS= -DSVR4 24# SYSLIBS= -lsocket -lnsl 25 26# Uncomment this if your system does not provide streror(3) 27# STRERROR=strerror.o 28 29# FILE DEFinitions: 30# The next few lines may be uncommented and changed to alter the default 31# filenames bootpd uses for its configuration and dump files. 32#CONFFILE= -DCONFIG_FILE=\"/usr/etc/bootptab\" 33#DUMPFILE= -DDUMPTAB_FILE=\"/usr/etc/bootpd.dump\" 34#FILEDEFS= $(CONFFILE) $(DUMPFILE) 35 36# MORE DEFinitions (whatever you might want to add) 37# One might define NDEBUG (to remove "assert()" checks). 38MOREDEFS= 39 40INSTALL=/usr/bin/install 41DESTDIR= 42BINDIR=/usr/etc 43MANDIR=/usr/local/man 44 45CFLAGS= $(OPTDEFS) $(SYSDEFS) $(FILEDEFS) $(MOREDEFS) 46PROGS= bootpd bootpef bootpgw bootptest 47TESTS= trylook trygetif trygetea 48 49all: $(PROGS) $(TESTS) 50 51system: install 52 53install: $(PROGS) 54 -for f in $(PROGS) ;\ 55 do \ 56 $(INSTALL) -c -s $$f $(DESTDIR)$(BINDIR) ;\ 57 done 58 59MAN5= bootptab.5 60MAN8= bootpd.8 bootpef.8 bootptest.8 61install.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 71clean: 72 -rm -f core *.o 73 -rm -f $(PROGS) $(TESTS) 74 75distclean: 76 -rm -f *.BAK *.CKP *~ .emacs* 77 78# 79# Handy targets for systems needing special treatment: 80# (Most POSIX systems should work with just "make all") 81# 82 83# DEC/OSF1 on the Alpha 84alpha: 85 $(MAKE) SYSDEFS="-DETC_ETHERS -Dint32=int -D_SOCKADDR_LEN" \ 86 STRERROR=strerror.o 87 88# Control Data EP/IX 1.4.3 system, BSD 4.3 mode 89epix143: 90 $(MAKE) CC="cc -systype bsd43" \ 91 SYSDEFS="-Dconst= -D_SIZE_T -DNO_UNISTD -DUSE_BFUNCS" \ 92 STRERROR=strerror.o 93 94# Control Data EP/IX 2.1.1 system, SVR4 mode 95epix211: 96 $(MAKE) CC="cc -systype svr4" \ 97 SYSDEFS="-DSVR4" \ 98 SYSLIBS="-lsocket -lnsl" 99 100# IRIX 5.X (Silicon Graphics) 101irix: 102 $(MAKE) SYSDEFS= SYSLIBS= 103 104# Linux 1.1.80+ on [34]86 105linux: 106 $(MAKE) SYSDEFS="-O6 -Wall -fomit-frame-pointer" 107 108# SunOS 4.X 109sunos4: 110 $(MAKE) SYSDEFS="-DSUNOS -DETC_ETHERS" \ 111 STRERROR=strerror.o 112 113# Solaris 2.X (i.e. SunOS 5.X) 114sunos5: 115 $(MAKE) SYSDEFS="-DSVR4 -DETC_ETHERS" \ 116 SYSLIBS="-lsocket -lnsl" 117 118# Solaris 2.X (i.e. SunOS 5.X) with GCC. Note that GCC normally 119# defines __STDC__=1 which breaks many Solaris header files... 120sunos5gcc: 121 $(MAKE) SYSDEFS="-DSVR4 -DETC_ETHERS -D__STDC__=0" \ 122 SYSLIBS="-lsocket -lnsl" CC="gcc -Wall" 123 124# UNIX System V Rel. 3 125svr3: 126 $(MAKE) SYSDEFS="-DSYSV" 127 128# UNIX System V Rel. 4 129svr4: 130 $(MAKE) SYSDEFS="-DSVR4" \ 131 SYSLIBS="-lsocket -lnsl" 132 133# AT&T/GIS - Both AT&T StarServer and NCR 3000 134# may work for others using Wollongong's WIN-TCP 135wollongong gis : 136 $(MAKE) SYSDEFS="-DSVR4 -DWIN_TCP" \ 137 SYSLIBS="-lsocket -lnsl" 138 139# 140# How to build each program: 141# 142 143OBJ_D= bootpd.o dovend.o readfile.o hash.o dumptab.o \ 144 lookup.o getif.o hwaddr.o tzone.o report.o $(STRERROR) 145bootpd: $(OBJ_D) 146 $(CC) -o $@ $(OBJ_D) $(SYSLIBS) 147 148OBJ_EF= bootpef.o dovend.o readfile.o hash.o dumptab.o \ 149 lookup.o hwaddr.o tzone.o report.o $(STRERROR) 150bootpef: $(OBJ_EF) 151 $(CC) -o $@ $(OBJ_EF) $(SYSLIBS) 152 153OBJ_GW= bootpgw.o getif.o hwaddr.o report.o $(STRERROR) 154bootpgw: $(OBJ_GW) 155 $(CC) -o $@ $(OBJ_GW) $(SYSLIBS) 156 157OBJ_TEST= bootptest.o print-bootp.o getif.o getether.o \ 158 report.o $(STRERROR) 159bootptest: $(OBJ_TEST) 160 $(CC) -o $@ $(OBJ_TEST) $(SYSLIBS) 161 162# This is just for testing the lookup functions. 163TRYLOOK= trylook.o lookup.o report.o $(STRERROR) 164trylook : $(TRYLOOK) 165 $(CC) -o $@ $(TRYLOOK) $(SYSLIBS) 166 167# This is just for testing getif. 168TRYGETIF= trygetif.o getif.o report.o $(STRERROR) 169trygetif : $(TRYGETIF) 170 $(CC) -o $@ $(TRYGETIF) $(SYSLIBS) 171 172# This is just for testing getether. 173TRYGETEA= trygetea.o getether.o report.o $(STRERROR) 174trygetea : $(TRYGETEA) 175 $(CC) -o $@ $(TRYGETEA) $(SYSLIBS) 176 177# This rule just keeps the LOG_BOOTP define localized. 178report.o : report.c 179 $(CC) $(CFLAGS) $(LOG_FACILITY) -c $< 180 181# Punt SunOS -target noise 182.c.o: 183 $(CC) $(CFLAGS) -c $< 184 185# 186# Header file dependencies: 187# 188 189bootpd.o : bootp.h bptypes.h hash.h hwaddr.h bootpd.h dovend.h 190bootpd.o : readfile.h report.h tzone.h patchlevel.h getif.h 191bootpef.o : bootp.h bptypes.h hash.h hwaddr.h bootpd.h dovend.h 192bootpef.o : readfile.h report.h tzone.h patchlevel.h 193bootpgw.o : bootp.h bptypes.h getif.h hwaddr.h report.h patchlevel.h 194bootptest.o : bootp.h bptypes.h bootptest.h getif.h patchlevel.h 195dovend.o : bootp.h bptypes.h bootpd.h hash.h hwaddr.h report.h dovend.h 196dumptab.o : bootp.h bptypes.h hash.h hwaddr.h report.h patchlevel.h bootpd.h 197getif.o : getif.h report.h 198hash.o : hash.h 199hwaddr.o : bptypes.h hwaddr.h report.h 200lookup.o : bootp.h bptypes.h lookup.h report.h 201print-bootp.o : bootp.h bptypes.h bootptest.h 202readfile.o : bootp.h bptypes.h hash.h hwaddr.h lookup.h readfile.h 203readfile.o : report.h tzone.h bootpd.h 204report.o : report.h 205tzone.o : bptypes.h report.h tzone.h 206