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