8604d2aa26d86847f0debda79b2bc25daa2228e9
[openafs.git] / src / util / 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 DEST=@DEST@
9 TOP_INCDIR=@TOP_INCDIR@
10 TOP_LIBDIR=@TOP_LIBDIR@
11 bindir=@bindir@
12 sbindir=@sbindir@
13 libexecdir=@libexecdir@
14 libdir=@libdir@
15 includedir=@includedir@
16 mandir=@mandir@
17 COMPILE_ET=${TOP_SRCDIR}/comerr/compile_et
18 RXGEN=${TOP_SRCDIR}/rxgen/rxgen
19 TOP_SRCDIR=@TOP_SRCDIR@
20 SYS_NAME=@AFS_SYSNAME@
21 prefix=@prefix@
22 exec_prefix=@exec_prefix@
23 afsconfdir=@afsconfdir@
24 viceetcdir=@viceetcdir@
25 afssrvbindir=@afssrvbindir@
26 afssrvsbindir=@afssrvsbindir@
27 afssrvlibexecdir=@afssrvlibexecdir@
28 afsdbdir=@afsdbdir@
29 afslogsdir=@afslogsdir@
30 afslocaldir=@afslocaldir@
31 afsbackupdir=@afsbackupdir@
32 afsbosconfigdir=@afsbosconfigdir@
33
34 SHELL = /bin/sh
35
36 include ../config/Makefile.${SYS_NAME}
37
38 CFLAGS=${OPTMZ} -I${TOP_SRCDIR}/config -I. -I${TOP_INCDIR} ${XCFLAGS}
39 LDFLAGS = ${OPTMZ} ${XLDFLAGS}
40
41 objects = assert.o base64.o casestrcpy.o ktime.o volparse.o hostparse.o \
42          hputil.o kreltime.o isathing.o get_krbrlm.o uuid.o serverLog.o \
43          dirpath.o fileutil.o netutils.o flipbase64.o \
44          afs_atomlist.o afs_lhash.o snprintf.o ${REGEX_OBJ}
45
46 all: ukinstall kinstall \
47         ${TOP_INCDIR}/afs/dirpath.h \
48         ${TOP_INCDIR}/afs/pthread_nosigs.h \
49         ${TOP_INCDIR}/afs/assert.h \
50         ${TOP_INCDIR}/afs/errors.h \
51         ${TOP_INCDIR}/afs/vice.h \
52         ${TOP_INCDIR}/afs/remote.h \
53         ${TOP_INCDIR}/afs/ktime.h \
54         ${TOP_INCDIR}/afs/fileutil.h \
55         ${TOP_INCDIR}/afs/netutils.h \
56         ${TOP_INCDIR}/afs/packages.h \
57         ${TOP_INCDIR}/afs/afsutil.h \
58         ${TOP_INCDIR}/afs/pthread_glock.h \
59         ${TOP_INCDIR}/afs/afs_atomlist.h \
60         ${TOP_INCDIR}/afs/afs_lhash.h \
61         ${TOP_INCDIR}/potpourri.h \
62         ${TOP_LIBDIR}/util.a \
63         ${TOP_LIBDIR}/libafsutil.a \
64         sys
65
66 dirpath.h: dirpath.hin Makefile
67         ( sed \
68                 -e "s+@afsconfdir+${afsconfdir}+" \
69                 -e "s+@viceetcdir+${viceetcdir}+" \
70                 -e "s+@afssrvbindir+${afssrvbindir}+" \
71                 -e "s+@afssrvsbindir+${afssrvsbindir}+" \
72                 -e "s+@afssrvlibexecdir+${afssrvlibexecdir}+" \
73                 -e "s+@afsdbdir+${afsdbdir}+" \
74                 -e "s+@afslogsdir+${afslogsdir}+" \
75                 -e "s+@afslocaldir+${afslocaldir}+" \
76                 -e "s+@afsbackupdir+${afsbackupdir}+" \
77                 -e "s+@afsbosconfigdir+${afsbosconfigdir}+" \
78                 dirpath.hin >dirpath.h.tmp && \
79                 mv dirpath.h.tmp dirpath.h )
80
81 util.a: ${objects} AFS_component_version_number.o
82         $(RM) -f util.a
83         $(AR) crv util.a ${objects} AFS_component_version_number.o
84         $(RANLIB) util.a
85
86 volparse.o: volparse.c
87         ${CC} ${CFLAGS} -c volparse.c
88
89 snprintf.o: snprintf.c
90         ${CC} ${CFLAGS} -c snprintf.c
91
92 base64.o: base64.c
93         ${CC} ${CFLAGS} -c base64.c
94
95 hostparse.o: hostparse.c afsutil.h
96         ${CC} ${CFLAGS} -c hostparse.c
97
98 ktime.o: ktime.c
99         ${CC} ${CFLAGS} -c ktime.c
100
101 kreltime.o: kreltime.c
102         ${CC} ${CFLAGS} -c kreltime.c
103
104 get_krbrlm.o: get_krbrlm.c
105         ${CC} ${CFLAGS} -c get_krbrlm.c
106
107 uuid.o: uuid.c
108         ${CC} ${CFLAGS} -c uuid.c
109
110 sys.o: sys.c ${TOP_INCDIR}/afs/param.h AFS_component_version_number.c
111         ${CC} ${CFLAGS} -c sys.c
112
113 sys: sys.o 
114         ${CC} ${LDFLAGS} -o sys sys.o
115
116 isathing.o: isathing.c
117         ${CC} ${CFLAGS} -c isathing.c
118
119 serverLog.o: serverLog.c
120         ${CC} ${CFLAGS} -c serverLog.c
121
122 dirpath.o: dirpath.c dirpath.h
123         ${CC} ${CFLAGS} -c dirpath.c
124
125 fileutil.o: fileutil.c fileutil.h
126         ${CC} ${CFLAGS} -c fileutil.c
127
128 netutils.o: netutils.c netutils.h
129         ${CC} ${CFLAGS} -c netutils.c
130
131 afs_atomlist.o: afs_atomlist.c afs_atomlist.h
132         ${CC} ${CFLAGS} -c afs_atomlist.c
133
134 afs_lhash.o: afs_lhash.c afs_lhash.h afs_atomlist.h
135         ${CC} ${CFLAGS} -c afs_lhash.c
136
137 #
138 # Install targets
139 #
140 KDIR=../libafs/afs
141 UKDIR=../libuafs/afs
142
143 install: \
144         ${DESTDIR}${includedir}/afs/dirpath.h \
145         ${DESTDIR}${includedir}/afs/pthread_nosigs.h \
146         ${DESTDIR}${includedir}/afs/assert.h \
147         ${DESTDIR}${includedir}/afs/errors.h \
148         ${DESTDIR}${includedir}/afs/vice.h \
149         ${DESTDIR}${includedir}/afs/remote.h \
150         ${DESTDIR}${includedir}/afs/ktime.h \
151         ${DESTDIR}${includedir}/afs/fileutil.h \
152         ${DESTDIR}${includedir}/afs/netutils.h \
153         ${DESTDIR}${includedir}/afs/packages.h \
154         ${DESTDIR}${includedir}/afs/afsutil.h \
155         ${DESTDIR}${includedir}/afs/pthread_glock.h \
156         ${DESTDIR}${includedir}/afs/afs_atomlist.h \
157         ${DESTDIR}${includedir}/afs/afs_lhash.h \
158         ${DESTDIR}${includedir}/potpourri.h \
159         ${DESTDIR}${libdir}/afs/util.a \
160         ${DESTDIR}${libdir}/afs/libafsutil.a \
161         ${DESTDIR}${bindir}/sys
162
163 ${TOP_INCDIR}/afs/dirpath.h: dirpath.h
164         ${INSTALL} $? $@
165
166 ${TOP_INCDIR}/afs/pthread_nosigs.h: pthread_nosigs.h
167         ${INSTALL} $? $@
168
169 ${TOP_INCDIR}/afs/assert.h: assert.h
170         ${INSTALL} $? $@
171
172 ${TOP_INCDIR}/afs/errors.h: errors.h
173         ${INSTALL} $? $@
174
175 ${TOP_INCDIR}/afs/vice.h: vice.h
176         ${INSTALL} $? $@
177
178 ${TOP_INCDIR}/afs/remote.h: remote.h
179         ${INSTALL} $? $@
180
181 ${TOP_INCDIR}/afs/ktime.h: ktime.h
182         ${INSTALL} $? $@
183
184 ${TOP_INCDIR}/afs/fileutil.h: fileutil.h
185         ${INSTALL} $? $@
186
187 ${TOP_INCDIR}/afs/netutils.h: netutils.h
188         ${INSTALL} $? $@
189
190 ${TOP_INCDIR}/afs/packages.h: packages.h
191         ${INSTALL} $? $@
192
193 ${TOP_INCDIR}/afs/afsutil.h: afsutil.h
194         ${INSTALL} $? $@
195
196 ${TOP_INCDIR}/afs/pthread_glock.h: pthread_glock.h
197         ${INSTALL} $? $@
198
199 ${TOP_INCDIR}/afs/afs_atomlist.h: afs_atomlist.h
200         ${INSTALL} $? $@
201
202 ${TOP_INCDIR}/afs/afs_lhash.h: afs_lhash.h
203         ${INSTALL} $? $@
204
205 ${TOP_INCDIR}/potpourri.h: potpourri.h
206         ${INSTALL} $? $@
207
208
209 ${TOP_LIBDIR}/util.a: util.a
210         ${INSTALL} $? $@
211
212 ${TOP_LIBDIR}/libafsutil.a: util.a
213         ${INSTALL} $? $@
214
215
216 ${DESTDIR}${includedir}/afs/dirpath.h: dirpath.h
217         ${INSTALL} $? $@
218
219 ${DESTDIR}${includedir}/afs/pthread_nosigs.h: pthread_nosigs.h
220         ${INSTALL} $? $@
221
222 ${DESTDIR}${includedir}/afs/assert.h: assert.h
223         ${INSTALL} $? $@
224
225 ${DESTDIR}${includedir}/afs/errors.h: errors.h
226         ${INSTALL} $? $@
227
228 ${DESTDIR}${includedir}/afs/vice.h: vice.h
229         ${INSTALL} $? $@
230
231 ${DESTDIR}${includedir}/afs/remote.h: remote.h
232         ${INSTALL} $? $@
233
234 ${DESTDIR}${includedir}/afs/ktime.h: ktime.h
235         ${INSTALL} $? $@
236
237 ${DESTDIR}${includedir}/afs/fileutil.h: fileutil.h
238         ${INSTALL} $? $@
239
240 ${DESTDIR}${includedir}/afs/netutils.h: netutils.h
241         ${INSTALL} $? $@
242
243 ${DESTDIR}${includedir}/afs/packages.h: packages.h
244         ${INSTALL} $? $@
245
246 ${DESTDIR}${includedir}/afs/afsutil.h: afsutil.h
247         ${INSTALL} $? $@
248
249 ${DESTDIR}${includedir}/afs/pthread_glock.h: pthread_glock.h
250         ${INSTALL} $? $@
251
252 ${DESTDIR}${includedir}/afs/afs_atomlist.h: afs_atomlist.h
253         ${INSTALL} $? $@
254
255 ${DESTDIR}${includedir}/afs/afs_lhash.h: afs_lhash.h
256         ${INSTALL} $? $@
257
258 ${DESTDIR}${includedir}/potpourri.h: potpourri.h
259         ${INSTALL} $? $@
260
261
262 ${DESTDIR}${libdir}/afs/util.a: util.a
263         ${INSTALL} $? $@
264
265 ${DESTDIR}${libdir}/afs/libafsutil.a: util.a
266         ${INSTALL} $? $@
267
268
269 ${DESTDIR}${bindir}/sys: sys
270         ${INSTALL} $? $@
271
272
273 ${DEST}/include/afs/dirpath.h: dirpath.h
274         ${INSTALL} $? $@
275
276 ${DEST}/include/afs/pthread_nosigs.h: pthread_nosigs.h
277         ${INSTALL} $? $@
278
279 ${DEST}/include/afs/assert.h: assert.h
280         ${INSTALL} $? $@
281
282 ${DEST}/include/afs/errors.h: errors.h
283         ${INSTALL} $? $@
284
285 ${DEST}/include/afs/vice.h: vice.h
286         ${INSTALL} $? $@
287
288 ${DEST}/include/afs/remote.h: remote.h
289         ${INSTALL} $? $@
290
291 ${DEST}/include/afs/ktime.h: ktime.h
292         ${INSTALL} $? $@
293
294 ${DEST}/include/afs/fileutil.h: fileutil.h
295         ${INSTALL} $? $@
296
297 ${DEST}/include/afs/netutils.h: netutils.h
298         ${INSTALL} $? $@
299
300 ${DEST}/include/afs/packages.h: packages.h
301         ${INSTALL} $? $@
302
303 ${DEST}/include/afs/afsutil.h: afsutil.h
304         ${INSTALL} $? $@
305
306 ${DEST}/include/afs/pthread_glock.h: pthread_glock.h
307         ${INSTALL} $? $@
308
309 ${DEST}/include/afs/afs_atomlist.h: afs_atomlist.h
310         ${INSTALL} $? $@
311
312 ${DEST}/include/afs/afs_lhash.h: afs_lhash.h
313         ${INSTALL} $? $@
314
315 ${DEST}/include/potpourri.h: potpourri.h
316         ${INSTALL} $? $@
317
318
319 ${DEST}/lib/afs/util.a: util.a
320         ${INSTALL} $? $@
321
322 ${DEST}/lib/afs/libafsutil.a: util.a
323         ${INSTALL} $? $@
324
325
326 ${DEST}/bin/sys: sys
327         ${INSTALL} $? $@
328
329
330 kinstall: ${KDIR}/vice.h \
331         ${KDIR}/afs_base64.c \
332         ${KDIR}/afs_uuid.c \
333         ${KDIR}/afs_atomlist.c \
334         ${KDIR}/afs_atomlist.h \
335         ${KDIR}/afs_lhash.c \
336         ${KDIR}/afs_lhash.h
337
338 ${KDIR}/vice.h: vice.h
339         ${INSTALL} $? $@
340
341 ${KDIR}/afs_base64.c: base64.c
342         ${INSTALL} $? $@
343
344 ${KDIR}/afs_uuid.c: uuid.c
345         ${INSTALL} $? $@
346
347 ${KDIR}/afs_atomlist.c: afs_atomlist.c
348         ${INSTALL} $? $@
349
350 ${KDIR}/afs_atomlist.h: afs_atomlist.h
351         ${INSTALL} $? $@
352
353 ${KDIR}/afs_lhash.c: afs_lhash.c
354         ${INSTALL} $? $@
355
356 ${KDIR}/afs_lhash.h: afs_lhash.h
357         ${INSTALL} $? $@
358
359 ukinstall: \
360         ${UKDIR}/afs_uuid.c \
361         ${UKDIR}/afs_atomlist.c \
362         ${UKDIR}/afs_atomlist.h \
363         ${UKDIR}/afs_lhash.c \
364         ${UKDIR}/afs_lhash.h \
365         ${UKDIR}/pthread_glock.h \
366         ${UKDIR}/vice.h \
367         ${UKDIR}/errors.h \
368         ${UKDIR}/afsutil.h \
369         ${UKDIR}/dirpath.h \
370         ${UKDIR}/dirpath.c \
371         ${UKDIR}/fileutil.h \
372         ${UKDIR}/fileutil.c \
373         ${UKDIR}/netutils.h \
374         ${UKDIR}/netutils.c \
375         ${UKDIR}/casestrcpy.c \
376         ${UKDIR}/hostparse.c 
377
378 ${UKDIR}/errors.h: errors.h
379         ${INSTALL} $? $@
380
381 ${UKDIR}/afsutil.h: afsutil.h
382         ${INSTALL} $? $@
383
384 ${UKDIR}/dirpath.h: dirpath.h
385         ${INSTALL} $? $@
386
387 ${UKDIR}/dirpath.c: dirpath.c
388         ${INSTALL} $? $@
389
390 ${UKDIR}/fileutil.h: fileutil.h
391         ${INSTALL} $? $@
392
393 ${UKDIR}/fileutil.c: fileutil.c
394         ${INSTALL} $? $@
395
396 ${UKDIR}/netutils.h: netutils.h
397         ${INSTALL} $? $@
398
399 ${UKDIR}/netutils.c: netutils.c
400         ${INSTALL} $? $@
401
402 ${UKDIR}/casestrcpy.c: casestrcpy.c
403         ${INSTALL} $? $@
404
405 ${UKDIR}/hostparse.c: hostparse.c
406         ${INSTALL} $? $@
407
408 ${UKDIR}/pthread_glock.h: pthread_glock.h
409         ${INSTALL} $? $@
410
411 ${UKDIR}/vice.h: vice.h
412         ${INSTALL} $? $@
413
414 ${UKDIR}/afs_uuid.c: uuid.c
415         ${INSTALL} $? $@
416
417 ${UKDIR}/afs_atomlist.c: afs_atomlist.c
418         ${INSTALL} $? $@
419
420 ${UKDIR}/afs_atomlist.h: afs_atomlist.h
421         ${INSTALL} $? $@
422
423 ${UKDIR}/afs_lhash.c: afs_lhash.c
424         ${INSTALL} $? $@
425
426 ${UKDIR}/afs_lhash.h: afs_lhash.h
427         ${INSTALL} $? $@
428
429 #
430 # Misc targets
431 #
432
433 clean:
434         $(RM) -f ${objects} sys dirpath.h
435         $(RM) -f util.a *.o core AFS_component_version_number.c
436
437 test:
438         cd test; $(MAKE)
439
440 include ../config/Makefile.version
441 ${DESTDIR}${bindir}/sys: sys
442         ${INSTALL} $? $@
443
444 dest: \
445         ${DEST}/include/afs/dirpath.h \
446         ${DEST}/include/afs/pthread_nosigs.h \
447         ${DEST}/include/afs/assert.h \
448         ${DEST}/include/afs/errors.h \
449         ${DEST}/include/afs/vice.h \
450         ${DEST}/include/afs/remote.h \
451         ${DEST}/include/afs/ktime.h \
452         ${DEST}/include/afs/fileutil.h \
453         ${DEST}/include/afs/netutils.h \
454         ${DEST}/include/afs/packages.h \
455         ${DEST}/include/afs/afsutil.h \
456         ${DEST}/include/afs/pthread_glock.h \
457         ${DEST}/include/afs/afs_atomlist.h \
458         ${DEST}/include/afs/afs_lhash.h \
459         ${DEST}/include/potpourri.h \
460         ${DEST}/lib/afs/util.a \
461         ${DEST}/lib/afs/libafsutil.a \
462         ${DEST}/bin/sys
463