__P removal.
[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 # $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.
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 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).
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) $(TESTS)
50
51 system: install
52
53 install: $(PROGS)
54         -for f in $(PROGS) ;\
55         do \
56                 $(INSTALL) -c -s $$f $(DESTDIR)$(BINDIR) ;\
57         done
58
59 MAN5= bootptab.5
60 MAN8= bootpd.8 bootpef.8 bootptest.8
61 install.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
71 clean:
72         -rm -f core *.o
73         -rm -f $(PROGS) $(TESTS)
74
75 distclean:
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
84 alpha:
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
89 epix143:
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
95 epix211:
96         $(MAKE) CC="cc -systype svr4" \
97                 SYSDEFS="-DSVR4" \
98                 SYSLIBS="-lsocket -lnsl"
99
100 # IRIX 5.X (Silicon Graphics)
101 irix:
102         $(MAKE) SYSDEFS= SYSLIBS=
103
104 # Linux 1.1.80+ on [34]86
105 linux:
106         $(MAKE) SYSDEFS="-O6 -Wall -fomit-frame-pointer"
107
108 # SunOS 4.X
109 sunos4:
110         $(MAKE) SYSDEFS="-DSUNOS -DETC_ETHERS" \
111                 STRERROR=strerror.o
112
113 # Solaris 2.X (i.e. SunOS 5.X)
114 sunos5:
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...
120 sunos5gcc:
121         $(MAKE) SYSDEFS="-DSVR4 -DETC_ETHERS -D__STDC__=0" \
122                 SYSLIBS="-lsocket -lnsl" CC="gcc -Wall"
123
124 # UNIX System V Rel. 3
125 svr3:
126         $(MAKE) SYSDEFS="-DSYSV"
127
128 # UNIX System V Rel. 4
129 svr4:
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
135 wollongong gis :
136         $(MAKE) SYSDEFS="-DSVR4 -DWIN_TCP" \
137                 SYSLIBS="-lsocket -lnsl"
138
139 #
140 # How to build each program:
141 #
142
143 OBJ_D=  bootpd.o dovend.o readfile.o hash.o dumptab.o \
144          lookup.o getif.o hwaddr.o tzone.o report.o $(STRERROR)
145 bootpd: $(OBJ_D)
146         $(CC) -o $@ $(OBJ_D) $(SYSLIBS)
147
148 OBJ_EF= bootpef.o dovend.o readfile.o hash.o dumptab.o \
149          lookup.o hwaddr.o tzone.o report.o $(STRERROR)
150 bootpef: $(OBJ_EF)
151         $(CC) -o $@ $(OBJ_EF) $(SYSLIBS)
152
153 OBJ_GW= bootpgw.o getif.o hwaddr.o report.o $(STRERROR)
154 bootpgw: $(OBJ_GW)
155         $(CC) -o $@ $(OBJ_GW) $(SYSLIBS)
156
157 OBJ_TEST= bootptest.o print-bootp.o getif.o getether.o \
158          report.o $(STRERROR)
159 bootptest: $(OBJ_TEST)
160         $(CC) -o $@ $(OBJ_TEST) $(SYSLIBS)
161
162 # This is just for testing the lookup functions.
163 TRYLOOK= trylook.o lookup.o report.o $(STRERROR)
164 trylook : $(TRYLOOK)
165         $(CC) -o $@ $(TRYLOOK) $(SYSLIBS)
166
167 # This is just for testing getif.
168 TRYGETIF= trygetif.o getif.o report.o $(STRERROR)
169 trygetif : $(TRYGETIF)
170         $(CC) -o $@ $(TRYGETIF) $(SYSLIBS)
171
172 # This is just for testing getether.
173 TRYGETEA= trygetea.o getether.o report.o $(STRERROR)
174 trygetea : $(TRYGETEA)
175         $(CC) -o $@ $(TRYGETEA) $(SYSLIBS)
176
177 # This rule just keeps the LOG_BOOTP define localized.
178 report.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
189 bootpd.o  : bootp.h bptypes.h hash.h hwaddr.h bootpd.h dovend.h
190 bootpd.o  : readfile.h report.h tzone.h patchlevel.h getif.h
191 bootpef.o : bootp.h bptypes.h hash.h hwaddr.h bootpd.h dovend.h
192 bootpef.o : readfile.h report.h tzone.h patchlevel.h
193 bootpgw.o : bootp.h bptypes.h getif.h hwaddr.h report.h patchlevel.h
194 bootptest.o : bootp.h bptypes.h bootptest.h getif.h patchlevel.h
195 dovend.o : bootp.h bptypes.h bootpd.h hash.h hwaddr.h report.h dovend.h
196 dumptab.o : bootp.h bptypes.h hash.h hwaddr.h report.h patchlevel.h bootpd.h
197 getif.o : getif.h report.h
198 hash.o : hash.h
199 hwaddr.o : bptypes.h hwaddr.h report.h
200 lookup.o : bootp.h bptypes.h lookup.h report.h
201 print-bootp.o : bootp.h bptypes.h bootptest.h
202 readfile.o : bootp.h bptypes.h hash.h hwaddr.h lookup.h readfile.h
203 readfile.o : report.h tzone.h bootpd.h
204 report.o : report.h
205 tzone.o : bptypes.h report.h tzone.h