home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / bootpd-2.zip / MAKEFILE < prev    next >
Text File  |  1995-09-04  |  6KB  |  221 lines

  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. # Remove the -DDHCP if you don't need DHCP support.
  13. OPTDEFS= -DSYSLOG -DVEND_CMU -DDHCP -DDEBUG
  14.  
  15. # Uncomment and edit this to choose the facility code used for syslog.
  16. # LOG_FACILITY= "-DLOG_BOOTP=LOG_LOCAL2"
  17.  
  18. # SYStem DEFinitions:
  19. # Either uncomment some of the following, or do:
  20. #    "make sunos4"    (or "make sunos5", etc.)
  21. # SYSDEFS= -DSUNOS -DETC_ETHERS
  22. # SYSDEFS= -DSVR4
  23. # SYSLIBS= -lsocket -lnsl
  24.  
  25. # Uncomment this if your system does not provide streror(3)
  26. # STRERROR=strerror$O
  27.  
  28. # FILE DEFinitions:
  29. # The next few lines may be uncommented and changed to alter the default
  30. # filenames bootpd uses for its configuration and dump files.
  31. #CONFFILE= -DCONFIG_FILE=\"/usr/etc/bootptab\"
  32. #DUMPFILE= -DDUMPTAB_FILE=\"/usr/etc/bootpd.dump\"
  33. #FILEDEFS= $(CONFFILE) $(DUMPFILE)
  34.  
  35. # MORE DEFinitions (whatever you might want to add)
  36. # One might define NDEBUG (to remove "assert()" checks).
  37. MOREDEFS=
  38.  
  39. INSTALL=/usr/bin/install
  40. DESTDIR=
  41. BINDIR=/usr/sbin
  42. MANDIR=/usr/local/man
  43.  
  44. CFLAGS= $(OPTDEFS) $(SYSDEFS) $(FILEDEFS) $(MOREDEFS)
  45. PROGS= bootpd$X bootpef$X bootpgw$X bootptest$X
  46. TESTS= trylook$X trygetif$X trygetea$X
  47.  
  48. X=
  49. O=.o
  50.  
  51. all: $(PROGS) $(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 systems needing special treatment:
  82. # (Most POSIX systems should work with just "make all")
  83. #
  84.  
  85. # DEC/OSF1 on the Alpha
  86. alpha:
  87.     $(MAKE) SYSDEFS="-DETC_ETHERS -Dint32=int -D_SOCKADDR_LEN" \
  88.         STRERROR=strerror$O
  89.  
  90. # Control Data EP/IX 1.4.3 system, BSD 4.3 mode
  91. epix143:
  92.     $(MAKE) CC="cc -systype bsd43" \
  93.         SYSDEFS="-Dconst= -D_SIZE_T -DNO_UNISTD -DUSE_BFUNCS" \
  94.         STRERROR=strerror$O
  95.  
  96. # Control Data EP/IX 2.1.1 system, SVR4 mode
  97. epix211:
  98.     $(MAKE) CC="cc -systype svr4" \
  99.         SYSDEFS="-DSVR4" \
  100.         SYSLIBS="-lsocket -lnsl"
  101.  
  102. # IRIX 5.X (Silicon Graphics)
  103. irix:
  104.     $(MAKE) SYSDEFS= SYSLIBS=
  105.  
  106. # Linux 1.1.80+
  107. linux:
  108.     $(MAKE) SYSDEFS="-O6 -Wall -fomit-frame-pointer" \
  109.         SYSLIBS="" \
  110.         FILEDEFS='-DCONFIG_FILE=\"/etc/bootptab\" \
  111.               -DDUMPTAB_FILE=\"/tmp/bootpd.dump\"'
  112.  
  113. # SCO (pah!) SYSV rel 3.2
  114. sco:
  115.     $(MAKE) CC="cc" SYSLIBS="-lsocket"
  116.  
  117. # SunOS 4.X
  118. sunos4:
  119.     $(MAKE) SYSDEFS="-DSUNOS -DETC_ETHERS" \
  120.         STRERROR=strerror$O
  121.  
  122. # Solaris 2.X (i.e. SunOS 5.X)
  123. sunos5:
  124.     $(MAKE) SYSDEFS="-DSVR4 -DETC_ETHERS" \
  125.         SYSLIBS="-lsocket -lnsl"
  126.  
  127. # Solaris 2.X (i.e. SunOS 5.X) with GCC.  Note that GCC normally
  128. # defines __STDC__=1 which breaks many Solaris header files...
  129. sunos5gcc:
  130.     $(MAKE) SYSDEFS="-DSVR4 -DETC_ETHERS -D__STDC__=0" \
  131.         SYSLIBS="-lsocket -lnsl" CC="gcc -Wall"
  132.  
  133. # UNIX System V Rel. 3
  134. svr3:
  135.     $(MAKE) SYSDEFS="-DSYSV"
  136.  
  137. # UNIX System V Rel. 4
  138. svr4:
  139.     $(MAKE) SYSDEFS="-DSVR4" \
  140.         SYSLIBS="-lsocket -lnsl"
  141.  
  142. # AT&T/GIS - Both AT&T StarServer and NCR 3000
  143. # may work for others using Wollongong's WIN-TCP
  144. wollongong gis :
  145.     $(MAKE) SYSDEFS="-DSVR4 -DWIN_TCP" \
  146.         SYSLIBS="-lsocket -lnsl"
  147.  
  148. # emx
  149. emx:
  150.     $(MAKE) CC="gcc -Zomf -O" X=".exe" O=".obj" MOREDEFS="-I." \
  151.     SYSLIBS="-lsocket -Zcrtdll -Zstack 512" STRERROR=syslog.obj
  152.  
  153. #
  154. # How to build each program:
  155. #
  156.  
  157. OBJ_D=    bootpd$O dovend$O readfile$O hash$O dumptab$O \
  158.      lookup$O getif$O hwaddr$O tzone$O report$O $(STRERROR)
  159. bootpd$X: $(OBJ_D)
  160.     $(CC) -o $@ $(OBJ_D) $(SYSLIBS)
  161.  
  162. OBJ_EF=    bootpef$O dovend$O readfile$O hash$O dumptab$O \
  163.      lookup$O hwaddr$O tzone$O report$O $(STRERROR)
  164. bootpef$X: $(OBJ_EF)
  165.     $(CC) -o $@ $(OBJ_EF) $(SYSLIBS)
  166.  
  167. OBJ_GW= bootpgw$O getif$O hwaddr$O report$O $(STRERROR)
  168. bootpgw$X: $(OBJ_GW)
  169.     $(CC) -o $@ $(OBJ_GW) $(SYSLIBS)
  170.  
  171. OBJ_TEST= bootptest$O print-bootp$O getif$O getether$O \
  172.      report$O $(STRERROR)
  173. bootptest$X: $(OBJ_TEST)
  174.     $(CC) -o $@ $(OBJ_TEST) $(SYSLIBS)
  175.  
  176. # This is just for testing the lookup functions.
  177. TRYLOOK= trylook$O lookup$O report$O $(STRERROR)
  178. trylook$X : $(TRYLOOK)
  179.     $(CC) -o $@ $(TRYLOOK) $(SYSLIBS)
  180.  
  181. # This is just for testing getif.
  182. TRYGETIF= trygetif$O getif$O report$O $(STRERROR)
  183. trygetif$X : $(TRYGETIF)
  184.     $(CC) -o $@ $(TRYGETIF) $(SYSLIBS)
  185.  
  186. # This is just for testing getether.
  187. TRYGETEA= trygetea$O getether$O report$O $(STRERROR)
  188. trygetea$X : $(TRYGETEA)
  189.     $(CC) -o $@ $(TRYGETEA) $(SYSLIBS)
  190.  
  191. # This rule just keeps the LOG_BOOTP define localized.
  192. report$O : report.c
  193.     $(CC) $(CFLAGS) $(LOG_FACILITY) -c $<
  194.  
  195. # Punt SunOS -target noise
  196. .SUFFIXES: .c $O
  197. .c$O:
  198.     $(CC) $(CFLAGS) -c $<
  199.  
  200. #
  201. # Header file dependencies:
  202. #
  203.  
  204. bootpd$O  : bootp.h bptypes.h hash.h hwaddr.h bootpd.h dovend.h
  205. bootpd$O  : readfile.h report.h tzone.h patchlevel.h getif.h
  206. bootpef$O : bootp.h bptypes.h hash.h hwaddr.h bootpd.h dovend.h
  207. bootpef$O : readfile.h report.h tzone.h patchlevel.h
  208. bootpgw$O : bootp.h bptypes.h getif.h hwaddr.h report.h patchlevel.h
  209. bootptest$O : bootp.h bptypes.h bootptest.h getif.h patchlevel.h
  210. dovend$O : bootp.h bptypes.h bootpd.h hash.h hwaddr.h report.h dovend.h
  211. dumptab$O : bootp.h bptypes.h hash.h hwaddr.h report.h patchlevel.h bootpd.h
  212. getif$O : getif.h report.h
  213. hash$O : hash.h
  214. hwaddr$O : bptypes.h hwaddr.h report.h
  215. lookup$O : bootp.h bptypes.h lookup.h report.h
  216. print-bootp$O : bootp.h bptypes.h bootptest.h
  217. readfile$O : bootp.h bptypes.h hash.h hwaddr.h lookup.h readfile.h
  218. readfile$O : report.h tzone.h bootpd.h
  219. report$O : report.h
  220. tzone$O : bptypes.h report.h tzone.h
  221.