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