]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - libexec/bootpd/Makefile.UNIX
libarchive: merge security fix from vendor branch
[FreeBSD/FreeBSD.git] / libexec / bootpd / Makefile.UNIX
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) $(TESTS)
48
49 system: install
50
51 install: $(PROGS)
52         -for f in $(PROGS) ;\
53         do \
54                 $(INSTALL) -c -s $$f $(DESTDIR)$(BINDIR) ;\
55         done
56
57 MAN5= bootptab.5
58 MAN8= bootpd.8 bootpef.8 bootptest.8
59 install.man: $(MAN5) $(MAN8)
60         -for f in $(MAN5) ;\
61         do \
62                 $(INSTALL) -c -m 644 $$f $(DESTDIR)$(MANDIR)/man5 ;\
63         done
64         -for f in $(MAN8) ;\
65         do \
66                 $(INSTALL) -c -m 644 $$f $(DESTDIR)$(MANDIR)/man8 ;\
67         done
68
69 clean:
70         -rm -f core *.o
71         -rm -f $(PROGS) $(TESTS)
72
73 distclean:
74         -rm -f *.BAK *.CKP *~ .emacs*
75
76 #
77 # Handy targets for systems needing special treatment:
78 # (Most POSIX systems should work with just "make all")
79 #
80
81 # DEC/OSF1 on the Alpha
82 alpha:
83         $(MAKE) SYSDEFS="-DETC_ETHERS -Dint32=int -D_SOCKADDR_LEN" \
84                 STRERROR=strerror.o
85
86 # Control Data EP/IX 1.4.3 system, BSD 4.3 mode
87 epix143:
88         $(MAKE) CC="cc -systype bsd43" \
89                 SYSDEFS="-Dconst= -D_SIZE_T -DNO_UNISTD -DUSE_BFUNCS" \
90                 STRERROR=strerror.o
91
92 # Control Data EP/IX 2.1.1 system, SVR4 mode
93 epix211:
94         $(MAKE) CC="cc -systype svr4" \
95                 SYSDEFS="-DSVR4" \
96                 SYSLIBS="-lsocket -lnsl"
97
98 # IRIX 5.X (Silicon Graphics)
99 irix:
100         $(MAKE) SYSDEFS= SYSLIBS=
101
102 # Linux 1.1.80+ on [34]86
103 linux:
104         $(MAKE) SYSDEFS="-O6 -Wall -fomit-frame-pointer"
105
106 # SunOS 4.X
107 sunos4:
108         $(MAKE) SYSDEFS="-DSUNOS -DETC_ETHERS" \
109                 STRERROR=strerror.o
110
111 # Solaris 2.X (i.e. SunOS 5.X)
112 sunos5:
113         $(MAKE) SYSDEFS="-DSVR4 -DETC_ETHERS" \
114                 SYSLIBS="-lsocket -lnsl"
115
116 # Solaris 2.X (i.e. SunOS 5.X) with GCC.  Note that GCC normally
117 # defines __STDC__=1 which breaks many Solaris header files...
118 sunos5gcc:
119         $(MAKE) SYSDEFS="-DSVR4 -DETC_ETHERS -D__STDC__=0" \
120                 SYSLIBS="-lsocket -lnsl" CC="gcc -Wall"
121
122 # UNIX System V Rel. 3
123 svr3:
124         $(MAKE) SYSDEFS="-DSYSV"
125
126 # UNIX System V Rel. 4
127 svr4:
128         $(MAKE) SYSDEFS="-DSVR4" \
129                 SYSLIBS="-lsocket -lnsl"
130
131 # AT&T/GIS - Both AT&T StarServer and NCR 3000
132 # may work for others using Wollongong's WIN-TCP
133 wollongong gis :
134         $(MAKE) SYSDEFS="-DSVR4 -DWIN_TCP" \
135                 SYSLIBS="-lsocket -lnsl"
136
137 #
138 # How to build each program:
139 #
140
141 OBJ_D=  bootpd.o dovend.o readfile.o hash.o dumptab.o \
142          lookup.o getif.o hwaddr.o tzone.o report.o $(STRERROR)
143 bootpd: $(OBJ_D)
144         $(CC) -o $@ $(OBJ_D) $(SYSLIBS)
145
146 OBJ_EF= bootpef.o dovend.o readfile.o hash.o dumptab.o \
147          lookup.o hwaddr.o tzone.o report.o $(STRERROR)
148 bootpef: $(OBJ_EF)
149         $(CC) -o $@ $(OBJ_EF) $(SYSLIBS)
150
151 OBJ_GW= bootpgw.o getif.o hwaddr.o report.o $(STRERROR)
152 bootpgw: $(OBJ_GW)
153         $(CC) -o $@ $(OBJ_GW) $(SYSLIBS)
154
155 OBJ_TEST= bootptest.o print-bootp.o getif.o getether.o \
156          report.o $(STRERROR)
157 bootptest: $(OBJ_TEST)
158         $(CC) -o $@ $(OBJ_TEST) $(SYSLIBS)
159
160 # This is just for testing the lookup functions.
161 TRYLOOK= trylook.o lookup.o report.o $(STRERROR)
162 trylook : $(TRYLOOK)
163         $(CC) -o $@ $(TRYLOOK) $(SYSLIBS)
164
165 # This is just for testing getif.
166 TRYGETIF= trygetif.o getif.o report.o $(STRERROR)
167 trygetif : $(TRYGETIF)
168         $(CC) -o $@ $(TRYGETIF) $(SYSLIBS)
169
170 # This is just for testing getether.
171 TRYGETEA= trygetea.o getether.o report.o $(STRERROR)
172 trygetea : $(TRYGETEA)
173         $(CC) -o $@ $(TRYGETEA) $(SYSLIBS)
174
175 # This rule just keeps the LOG_BOOTP define localized.
176 report.o : report.c
177         $(CC) $(CFLAGS) $(LOG_FACILITY) -c $<
178
179 # Punt SunOS -target noise
180 .c.o:
181         $(CC) $(CFLAGS) -c $<
182
183 #
184 # Header file dependencies:
185 #
186
187 bootpd.o  : bootp.h bptypes.h hash.h hwaddr.h bootpd.h dovend.h
188 bootpd.o  : readfile.h report.h tzone.h patchlevel.h getif.h
189 bootpef.o : bootp.h bptypes.h hash.h hwaddr.h bootpd.h dovend.h
190 bootpef.o : readfile.h report.h tzone.h patchlevel.h
191 bootpgw.o : bootp.h bptypes.h getif.h hwaddr.h report.h patchlevel.h
192 bootptest.o : bootp.h bptypes.h bootptest.h getif.h patchlevel.h
193 dovend.o : bootp.h bptypes.h bootpd.h hash.h hwaddr.h report.h dovend.h
194 dumptab.o : bootp.h bptypes.h hash.h hwaddr.h report.h patchlevel.h bootpd.h
195 getif.o : getif.h report.h
196 hash.o : hash.h
197 hwaddr.o : bptypes.h hwaddr.h report.h
198 lookup.o : bootp.h bptypes.h lookup.h report.h
199 print-bootp.o : bootp.h bptypes.h bootptest.h
200 readfile.o : bootp.h bptypes.h hash.h hwaddr.h lookup.h readfile.h
201 readfile.o : report.h tzone.h bootpd.h
202 report.o : report.h
203 tzone.o : bptypes.h report.h tzone.h