Build system: Move install definitions to include
[openafs.git] / src / kauth / Makefile.in
1 # Copyright 2000, International Business Machines Corporation and others.
2 # All Rights Reserved.
3
4 # This software has been released under the terms of the IBM Public
5 # License.  For details, see the LICENSE file in the top-level source
6 # directory or online at http://www.openafs.org/dl/license10.html
7
8 srcdir=@srcdir@
9 include @TOP_OBJDIR@/src/config/Makefile.config
10 include @TOP_OBJDIR@/src/config/Makefile.lwp
11
12
13 INCLS=${TOP_INCDIR}/ubik.h \
14              ${TOP_INCDIR}/lwp.h \
15              ${TOP_INCDIR}/lock.h  \
16              ${TOP_INCDIR}/rx/rx.h \
17              ${TOP_INCDIR}/rx/xdr.h \
18              ${TOP_INCDIR}/rx/rxkad.h \
19              ${TOP_INCDIR}/afs/com_err.h \
20         kaserver.h kauth.h kautils.h
21
22 LIBS=${TOP_LIBDIR}/libubik.a \
23         ${TOP_LIBDIR}/libprot.a \
24         ${TOP_LIBDIR}/libauth.a \
25         ${TOP_LIBDIR}/librxkad.a \
26         ${TOP_LIBDIR}/libsys.a \
27         ${TOP_LIBDIR}/librxstat.a \
28         ${TOP_LIBDIR}/librx.a \
29         ${TOP_LIBDIR}/libsys.a  \
30         ${TOP_LIBDIR}/liblwp.a \
31         ${TOP_LIBDIR}/libcmd.a \
32         ${TOP_LIBDIR}/libafscom_err.a \
33         ${TOP_LIBDIR}/libafsutil.a \
34         $(DBM) \
35         ${TOP_LIBDIR}/libafshcrypto_lwp.a
36
37 UKSRCS=authclient.c user.c kautils.h kaserver.h kaaux.c katoken.c \
38        kalocalcell.c client.c kaerrors.c
39
40 KLIBS=${TOP_LIBDIR}/libubik.a \
41         ${TOP_LIBDIR}/libprot.a \
42         ${TOP_LIBDIR}/libauth.krb.a \
43         ${TOP_LIBDIR}/librxkad.a \
44         ${TOP_LIBDIR}/libsys.a \
45         ${TOP_LIBDIR}/librx.a \
46         ${TOP_LIBDIR}/libsys.a  \
47         ${TOP_LIBDIR}/liblwp.a \
48         ${TOP_LIBDIR}/libcmd.a \
49         ${TOP_LIBDIR}/libafscom_err.a \
50         ${TOP_LIBDIR}/libafsutil.a \
51         ${TOP_LIBDIR}/libafshcrypto_lwp.a
52
53 OBJS=kauth.xdr.o kauth.cs.o kaaux.o client.o authclient.o katoken.o kautils.o kalocalcell.o kaerrors.o user.o krb_tf.o
54 KOBJS=kauth.xdr.o kauth.cs.o kaaux.o client.o authclient.o katoken.o kautils.o kalocalcell.o kaerrors.o user.krb.o krb_tf.o
55
56 all: kaserver kas kpwvalid klog klog.krb knfs kpasswd rebuild kdb ka-forwarder \
57         ${TOP_LIBDIR}/libkauth.a \
58         ${TOP_LIBDIR}/libkauth.krb.a \
59         depinstall
60
61 depinstall: \
62         kaerrors.c kauth.cs.c kauth.xdr.c \
63         ${TOP_INCDIR}/afs/kautils.h \
64         ${TOP_INCDIR}/afs/kauth.h \
65         ${TOP_INCDIR}/afs/kaport.h 
66
67 generated: \
68         kaerrors.c kautils.h \
69         kauth.cs.c kauth.ss.c kauth.xdr.c kauth.h
70
71 ${TOP_LIBDIR}/libkauth.a: libkauth.a
72         ${INSTALL_DATA} $? $@
73
74 ${TOP_LIBDIR}/libkauth.krb.a: libkauth.krb.a
75         ${INSTALL_DATA} $? $@
76
77 ${TOP_INCDIR}/afs/kautils.h: kautils.h
78         ${INSTALL_DATA} $? $@
79
80 ${TOP_INCDIR}/afs/kauth.h: kauth.h
81         ${INSTALL_DATA} $? $@
82
83 ${TOP_INCDIR}/afs/kaport.h: kaport.h
84         ${INSTALL_DATA} $? $@
85
86 test tests: all
87         cd test; $(MAKE)
88
89 kaserver: kautils.o kalocalcell.o kadatabase.o kaprocs.o kalog.o kauth.ss.o kauth.xdr.o kaserver.o kaaux.o krb_udp.o kaauxdb.o $(LIBS) 
90         $(AFS_LDRULE) kaserver.o kautils.o kalocalcell.o kadatabase.o \
91                 krb_udp.o kaprocs.o kalog.o kauth.ss.o kauth.xdr.o kaaux.o \
92                 kaauxdb.o \
93                 $(LIBS) $(LIB_roken) $(LIB_crypt) ${XLIBS} \
94                 ${TOP_LIBDIR}/libaudit.a
95
96 kaserver.o: kaserver.c ${INCLS} AFS_component_version_number.o
97
98 kautils.o: kautils.c ${INCLS}
99
100 kalocalcell.o: kalocalcell.c ${INCLS}
101
102 kadatabase.o: kadatabase.c ${INCLS}
103
104 kaprocs.o: kaprocs.c ${INCLS} kaport.h
105
106 authclient.o: authclient.c ${INCLS}
107
108 kaauxdb.o: kaauxdb.c
109
110 kaerrors.o: kaerrors.c
111
112 kautils.h: kaerrors.c
113
114 kaerrors.c: kaerrors.et kautils.p.h
115         $(RM) -f kautils.h kaerrors.c
116         ${COMPILE_ET} -p ${srcdir} kaerrors -h kautils
117
118 kauth.ss.o: kauth.ss.c
119 kauth.cs.o: kauth.cs.c
120 kauth.xdr.o: kauth.xdr.c kauth.h
121
122 $(UKSRCS): kauth.h
123
124 kauth.cs.c: kauth.rg
125         ${RXGEN} -A -u -x -C -o $@ ${srcdir}/kauth.rg
126
127 kauth.ss.c: kauth.rg
128         ${RXGEN} -A -x -S -o $@ ${srcdir}/kauth.rg
129
130 kauth.xdr.c: kauth.rg
131         ${RXGEN} -A -x -c -o $@ ${srcdir}/kauth.rg
132
133 kauth.h: kauth.rg
134         ${RXGEN} -A -u -x -h -o $@ ${srcdir}/kauth.rg
135
136 kauth.xdr.c: kauth.h
137 kauth.cs.c: kauth.h
138 kauth.ss.c: kauth.h
139
140 Kkauth.cs.c: kauth.rg Kkauth.h
141         ${RXGEN} -A -x -k -C -o Kkauth.cs.c ${srcdir}/kauth.rg
142
143 Kkauth.xdr.c: kauth.rg
144         ${RXGEN} -A -x -k -c -o Kkauth.xdr.c ${srcdir}/kauth.rg
145
146 Kkauth.h: kauth.rg
147         ${RXGEN} -A -x -k -h -o Kkauth.h ${srcdir}/kauth.rg
148
149 libkauth.a: $(OBJS) AFS_component_version_number.o
150         -$(RM) -f $@
151         $(AR) crv $@ $(OBJS) AFS_component_version_number.o
152         $(RANLIB) $@
153
154 libkauth.krb.a: $(KOBJS) AFS_component_version_number.o
155         -$(RM) -f $@
156         $(AR) crv $@ $(KOBJS) AFS_component_version_number.o
157         $(RANLIB) $@
158
159 katoken.o: katoken.c ${INCLS}
160
161 client.o: client.c ${INCLS} AFS_component_version_number.o
162
163 kas.o: kas.c ${INCLS} AFS_component_version_number.o
164
165 CFLAGS_admin_tools.o= @CFLAGS_NOERROR@
166 admin_tools.o: admin_tools.c ${INCLS} kaport.h
167
168 kkids.o: kkids.c ${INCLS}
169
170 krb_tf.o: krb_tf.c ${INCLS}
171
172 kas: kauth.h kautils.h admin_tools.o libkauth.a $(LIBS) kas.o kkids.o
173         $(AFS_LDRULE) kas.o admin_tools.o kkids.o libkauth.a \
174                 ${LIBS} $(LIB_roken) $(LIB_crypt) ${XLIBS}
175
176 klog: AFS_component_version_number.o kauth.h kautils.h libkauth.a $(LIBS) \
177         klog.o
178         $(AFS_LDRULE) klog.o libkauth.a \
179                 ${LIBS} $(LIB_roken) $(LIB_crypt) ${XLIBS}
180
181 klog.o: klog.c kauth.h kautils.h AFS_component_version_number.o
182
183 klog.krb: kauth.h kautils.h libkauth.krb.a $(KLIBS) klog.o
184         $(AFS_LDRULE) klog.o libkauth.krb.a \
185                 ${KLIBS} $(LIB_roken) $(LIB_crypt) ${XLIBS}
186
187 knfs: kauth.h kautils.h libkauth.a $(LIBS) knfs.o
188         $(AFS_LDRULE) knfs.o libkauth.a \
189                 ${LIBS} $(LIB_roken) $(LIB_crypt) ${XLIBS}
190
191 knfs.o: knfs.c AFS_component_version_number.o
192
193 CFLAGS_klogin.o = -DKAUTH
194 klogin.o: klogin.c ${INCLS} AFS_component_version_number.o
195
196 klogin: libkauth.a $(LIBS) klogin.o
197         $(AFS_LDRULE) klogin.o libkauth.a \
198                 ${LIBS} $(LIB_roken) $(LIB_crypt) ${XLIBS}
199
200 klogin.krb: libkauth.a $(KLIBS) klogin.o
201         $(AFS_LDRULE) klogin.o libkauth.krb.a \
202                 ${KLIBS} $(LIB_roken) $(LIB_crypt) ${XLIBS}
203
204 kpasswd.o: kauth.h kautils.h ${INCLS} kpasswd.c AFS_component_version_number.o
205
206 kpasswd: kauth.h kautils.h libkauth.a $(LIBS) kpasswd.o kkids.o
207         $(AFS_LDRULE) kpasswd.o kkids.o libkauth.a \
208                 ${LIBS} $(LIB_roken) $(LIB_crypt) ${XLIBS}
209
210 kpwvalid.o: kpwvalid.c AFS_component_version_number.o
211
212 kpwvalid: kpwvalid.o $(LIBS)
213         $(AFS_LDRULE) kpwvalid.o \
214                 ${LIBS} $(LIB_roken) ${XLIBS}
215
216 CFLAGS_user.krb.o = -DAFS_KERBEROS_ENV
217 user.krb.o: user.c ${INCLS} ${TOP_INCDIR}/afs/vice.h
218         $(AFS_CCRULE) $(srcdir)/user.c
219
220 user.o: user.c ${INCLS} ${TOP_INCDIR}/afs/vice.h
221
222 kdb: kdb.o ${INCLS} ${LIBS} libkauth.a
223         $(AFS_LDRULE) kdb.o libkauth.a \
224                 ${LIBS} $(LIB_roken) ${XLIBS}
225
226 kdb.o: kdb.c AFS_component_version_number.o
227
228 krb_udp.o: krb_udp.c kaserver.h kautils.h kauth.h prot.h ${TOP_INCDIR}/lwp.h AFS_component_version_number.o
229
230 krb_udp: krb_udp.o libkauth.a $(KLIBS)
231         $(AFS_LDRULE) krb_udp.o libkauth.a \
232                 $(KLIBS) $(LIB_roken)
233
234 ka-forwarder.o: ka-forwarder.c
235
236 ka-forwarder: ka-forwarder.o
237         $(AFS_LDRULE) ka-forwarder.o \
238                 ${LIBS} $(LIB_roken) ${XLIBS}
239
240 rebuild.o: rebuild.c $(INCLS) AFS_component_version_number.o
241
242 rebuild: rebuild.o kautils.o $(LIBS)
243         $(AFS_LDRULE) rebuild.o kautils.o \
244                 $(LIBS) $(LIB_roken) ${XLIBS}
245
246 #
247 # Install targets
248 #
249 install: kaserver kas kpwvalid kas klog klog.krb knfs kpasswd libkauth.a \
250                 libkauth.krb.a rebuild kdb ka-forwarder kautils.h kauth.h \
251                 kaport.h
252         ${INSTALL} -d ${DESTDIR}${afssrvlibexecdir}
253         ${INSTALL} -d ${DESTDIR}${bindir}
254         ${INSTALL} -d ${DESTDIR}${sbindir}
255         ${INSTALL} -d ${DESTDIR}${afssrvbindir}
256         ${INSTALL} -d ${DESTDIR}${afssrvsbindir}
257         ${INSTALL} -d ${DESTDIR}${libdir}/afs
258         ${INSTALL} -d ${DESTDIR}${includedir}/afs
259         ${INSTALL_PROGRAM} kaserver ${DESTDIR}${afssrvlibexecdir}/kaserver
260         ${INSTALL_PROGRAM} kas ${DESTDIR}${sbindir}/kas
261         ${INSTALL_PROGRAM} kpwvalid ${DESTDIR}${sbindir}/kpwvalid
262         ${INSTALL_PROGRAM} kas ${DESTDIR}${afssrvsbindir}/kas
263         ${INSTALL_PROGRAM} kpwvalid ${DESTDIR}${afssrvsbindir}/kpwvalid
264         ${INSTALL_PROGRAM} klog ${DESTDIR}${bindir}/klog
265         ${INSTALL_PROGRAM} klog.krb ${DESTDIR}${bindir}/klog.krb
266         ${INSTALL_PROGRAM} klog ${DESTDIR}${afssrvbindir}/klog
267         ${INSTALL_PROGRAM} klog.krb ${DESTDIR}${afssrvbindir}/klog.krb
268         ${INSTALL_PROGRAM} knfs ${DESTDIR}${bindir}/knfs
269         ${INSTALL_PROGRAM} kpasswd ${DESTDIR}${bindir}/kpasswd
270         ${INSTALL_PROGRAM} kpwvalid ${DESTDIR}${bindir}/kpwvalid
271         ${INSTALL_DATA} libkauth.a ${DESTDIR}${libdir}/afs/libkauth.a
272         ${INSTALL_DATA} libkauth.krb.a ${DESTDIR}${libdir}/afs/libkauth.krb.a
273         ${INSTALL_PROGRAM} rebuild ${DESTDIR}${afssrvsbindir}/kadb_check
274         ${INSTALL_PROGRAM} kdb ${DESTDIR}${afssrvsbindir}/kdb
275         ${INSTALL_PROGRAM} ka-forwarder ${DESTDIR}${afssrvsbindir}/ka-forwarder
276         ${INSTALL_DATA} kautils.h ${DESTDIR}${includedir}/afs/kautils.h
277         ${INSTALL_DATA} kauth.h ${DESTDIR}${includedir}/afs/kauth.h
278         ${INSTALL_DATA} ${srcdir}/kaport.h ${DESTDIR}${includedir}/afs/kaport.h
279
280 dest: kaserver kas kpwvalid kas klog klog.krb knfs kpasswd libkauth.a \
281                 libkauth.krb.a rebuild kdb ka-forwarder kautils.h kauth.h \
282                 kaport.h
283         ${INSTALL} -d ${DEST}/root.server/usr/afs/bin
284         ${INSTALL} -d ${DEST}/etc
285         ${INSTALL} -d ${DEST}/bin
286         ${INSTALL} -d ${DEST}/lib/afs
287         ${INSTALL} -d ${DEST}/include/afs
288         ${INSTALL_PROGRAM} kaserver ${DEST}/root.server/usr/afs/bin/kaserver
289         ${INSTALL_PROGRAM} kas ${DEST}/etc/kas
290         ${INSTALL_PROGRAM} kpwvalid ${DEST}/etc/kpwvalid
291         ${INSTALL_PROGRAM} kas ${DEST}/root.server/usr/afs/bin/kas
292         ${INSTALL_PROGRAM} kpwvalid ${DEST}/root.server/usr/afs/bin/kpwvalid
293         ${INSTALL_PROGRAM} klog ${DEST}/bin/klog
294         ${INSTALL_PROGRAM} klog.krb ${DEST}/bin/klog.krb
295         ${INSTALL_PROGRAM} klog ${DEST}/root.server/usr/afs/bin/klog
296         ${INSTALL_PROGRAM} klog.krb ${DEST}/root.server/usr/afs/bin/klog.krb
297         ${INSTALL_PROGRAM} knfs ${DEST}/bin/knfs
298         ${INSTALL_PROGRAM} kpasswd ${DEST}/bin/kpasswd
299         ${INSTALL_PROGRAM} kpwvalid ${DEST}/bin/kpwvalid
300         ${INSTALL_DATA} libkauth.a ${DEST}/lib/afs/libkauth.a
301         ${INSTALL_DATA} libkauth.krb.a ${DEST}/lib/afs/libkauth.krb.a
302         ${INSTALL_PROGRAM} kdb ${DEST}/etc/kdb
303         ${INSTALL_PROGRAM} rebuild ${DEST}/etc/kadb_check
304         ${INSTALL_PROGRAM} ka-forwarder ${DEST}/root.server/usr/afs/bin/ka-forwarder
305         ${INSTALL_DATA} kautils.h ${DEST}/include/afs/kautils.h
306         ${INSTALL_DATA} kauth.h ${DEST}/include/afs/kauth.h
307         ${INSTALL_DATA} ${srcdir}/kaport.h ${DEST}/include/afs/kaport.h
308
309 #
310 # Misc. targets
311 #
312 clean:
313         $(RM) -f *.o *.a *.xdr.c *.cs.c *.ss.c core \
314                 kaserver kas klog multiklog kpasswd klogin rebuild \
315                 ka-forwarder \
316                 kauth.h kautils.h kaerrors.c kpwvalid \
317                 AFS_component_version_number.c \
318                 klog.krb knfs klogin.krb kdb Kkauth.h
319
320 include ../config/Makefile.version