fc2f6cfbc412ce39f2cb6c72ba5649d993a6ce15
[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 srcdir=@srcdir@
9 include @TOP_OBJDIR@/src/config/Makefile.config
10 include @TOP_OBJDIR@/src/config/Makefile.lwp
11
12 INSTALL = @INSTALL@
13 INSTALL_DATA = @INSTALL_DATA@
14 INSTALL_PROGRAM = @INSTALL_PROGRAM@
15 INSTALL_SCRIPT = @INSTALL_SCRIPT@
16 HELPER_SPLINT=@HELPER_SPLINT@
17
18
19 objects = assert.o base64.o casestrcpy.o config_file.o ktime.o volparse.o \
20          hostparse.o exec.o \
21          hputil.o kreltime.o isathing.o get_krbrlm.o uuid.o serverLog.o \
22          dirpath.o fileutil.o netutils.o flipbase64.o fstab.o \
23          afs_atomlist.o afs_lhash.o snprintf.o pthread_glock.o \
24          tabular_output.o ${REGEX_OBJ}
25
26 objects_pic = \
27         pic_assert.o \
28         pic_base64.o \
29         pic_casestrcpy.o \
30         pic_config_file.o \
31         pic_ktime.o \
32         pic_volparse.o \
33         pic_hostparse.o \
34         pic_exec.o \
35         pic_hputil.o \
36         pic_kreltime.o \
37         pic_isathing.o \
38         pic_get_krbrlm.o \
39         pic_uuid.o \
40         pic_serverLog.o \
41         pic_dirpath.o \
42         pic_fileutil.o \
43         pic_netutils.o \
44         pic_flipbase64.o \
45         pic_fstab.o \
46         pic_afs_atomlist.o \
47         pic_afs_lhash.o \
48         pic_snprintf.o \
49         pic_pthread_glock.o \
50         pic_tabular_output.o \
51         ${REGEX_OBJ_PIC}
52
53 includes = \
54         ${TOP_INCDIR}/afs/dirpath.h \
55         ${TOP_INCDIR}/afs/pthread_nosigs.h \
56         ${TOP_INCDIR}/afs/afs_assert.h \
57         ${TOP_INCDIR}/afs/errors.h \
58         ${TOP_INCDIR}/afs/vice.h \
59         ${TOP_INCDIR}/afs/remote.h \
60         ${TOP_INCDIR}/afs/ktime.h \
61         ${TOP_INCDIR}/afs/fileutil.h \
62         ${TOP_INCDIR}/afs/netutils.h \
63         ${TOP_INCDIR}/afs/packages.h \
64         ${TOP_INCDIR}/afs/afsutil.h \
65         ${TOP_INCDIR}/afs/afsutil_prototypes.h \
66         ${TOP_INCDIR}/afs/pthread_glock.h \
67         ${TOP_INCDIR}/afs/afs_atomlist.h \
68         ${TOP_INCDIR}/afs/afs_lhash.h \
69         ${TOP_INCDIR}/afs/softsig.h \
70         ${TOP_INCDIR}/afs/work_queue.h \
71         ${TOP_INCDIR}/afs/work_queue_types.h \
72         ${TOP_INCDIR}/afs/thread_pool.h \
73         ${TOP_INCDIR}/afs/thread_pool_types.h \
74         ${TOP_INCDIR}/afs/tabular_output.h \
75         ${TOP_INCDIR}/opr/queue.h
76
77 all: ${includes} \
78         ${TOP_LIBDIR}/util.a \
79         ${TOP_LIBDIR}/libafsutil.a \
80         ${TOP_LIBDIR}/libafsutil_pic.a \
81         sys
82
83 buildtools: ${TOP_LIBDIR}/libafsutil.a ${TOP_INCDIR}/afs/afsutil.h
84 buildtools_clean: clean
85
86 depinstall: ${includes}
87
88 ${TOP_INCDIR}/afs/dirpath.h: dirpath.h
89         ${INSTALL_DATA} $? $@
90
91 ${TOP_INCDIR}/afs/pthread_nosigs.h: ${srcdir}/pthread_nosigs.h
92         ${INSTALL_DATA} $? $@
93
94 ${TOP_INCDIR}/afs/afs_assert.h: ${srcdir}/afs_assert.h
95         ${INSTALL_DATA} $? $@
96
97 ${TOP_INCDIR}/afs/errors.h: ${srcdir}/errors.h
98         ${INSTALL_DATA} $? $@
99
100 ${TOP_INCDIR}/afs/vice.h: ${srcdir}/vice.h
101         ${INSTALL_DATA} $? $@
102
103 ${TOP_INCDIR}/afs/remote.h: ${srcdir}/remote.h
104         ${INSTALL_DATA} $? $@
105
106 ${TOP_INCDIR}/afs/ktime.h: ${srcdir}/ktime.h
107         ${INSTALL_DATA} $? $@
108
109 ${TOP_INCDIR}/afs/fileutil.h: ${srcdir}/fileutil.h
110         ${INSTALL_DATA} $? $@
111
112 ${TOP_INCDIR}/afs/netutils.h: ${srcdir}/netutils.h
113         ${INSTALL_DATA} $? $@
114
115 ${TOP_INCDIR}/afs/packages.h: ${srcdir}/packages.h
116         ${INSTALL_DATA} $? $@
117
118 ${TOP_INCDIR}/afs/afsutil.h: ${srcdir}/afsutil.h
119         ${INSTALL_DATA} $? $@
120
121 ${TOP_INCDIR}/afs/afsutil_prototypes.h: ${srcdir}/afsutil_prototypes.h
122         ${INSTALL_DATA} $? $@
123
124 ${TOP_INCDIR}/afs/pthread_glock.h: ${srcdir}/pthread_glock.h
125         ${INSTALL_DATA} $? $@
126
127 ${TOP_INCDIR}/afs/afs_atomlist.h: ${srcdir}/afs_atomlist.h
128         ${INSTALL_DATA} $? $@
129
130 ${TOP_INCDIR}/afs/afs_lhash.h: ${srcdir}/afs_lhash.h
131         ${INSTALL_DATA} $? $@
132
133 ${TOP_INCDIR}/afs/softsig.h: ${srcdir}/softsig.h
134         ${INSTALL_DATA} $? $@
135
136 ${TOP_INCDIR}/afs/work_queue.h: ${srcdir}/work_queue.h
137         ${INSTALL_DATA} $? $@
138
139 ${TOP_INCDIR}/afs/work_queue_types.h: ${srcdir}/work_queue_types.h
140         ${INSTALL_DATA} $? $@
141
142 ${TOP_INCDIR}/afs/thread_pool.h: ${srcdir}/thread_pool.h
143         ${INSTALL_DATA} $? $@
144
145 ${TOP_INCDIR}/afs/thread_pool_types.h: ${srcdir}/thread_pool_types.h
146         ${INSTALL_DATA} $? $@
147
148 ${TOP_INCDIR}/afs/tabular_output.h: ${srcdir}/tabular_output.h
149         ${INSTALL_DATA} $? $@
150
151 ${TOP_INCDIR}/potpourri.h: ${srcdir}/potpourri.h
152         ${INSTALL_DATA} $? $@
153
154 ${TOP_INCDIR}/opr/queue.h: ${srcdir}/queue.h
155         ${INSTALL_DATA} $? $@
156
157 ${TOP_LIBDIR}/util.a: util.a
158         ${INSTALL_DATA} $? $@
159
160 ${TOP_LIBDIR}/libafsutil.a: util.a
161         ${INSTALL_DATA} $? $@
162
163 ${TOP_LIBDIR}/libafsutil_pic.a: util_pic.a
164         ${INSTALL_DATA} $? $@
165
166 # Use " as the sed boundary character because we lose anyway if that occurs
167 # in path names.
168 dirpath.h: ${srcdir}/dirpath.hin Makefile
169         ( sed \
170                 -e 's"@afsconfdir"${afsconfdir}"' \
171                 -e 's"@viceetcdir"${viceetcdir}"' \
172                 -e 's"@afssrvbindir"${afssrvbindir}"' \
173                 -e 's"@afssrvsbindir"${afssrvsbindir}"' \
174                 -e 's"@afssrvlibexecdir"${afssrvlibexecdir}"' \
175                 -e 's"@afsdbdir"${afsdbdir}"' \
176                 -e 's"@afslogsdir"${afslogsdir}"' \
177                 -e 's"@afslocaldir"${afslocaldir}"' \
178                 -e 's"@afsbackupdir"${afsbackupdir}"' \
179                 -e 's"@afsbosconfigdir"${afsbosconfigdir}"' \
180                 -e 's"@afsdatadir"${afsdatadir}"' \
181                 ${srcdir}/dirpath.hin >dirpath.h.tmp && \
182                 if cmp dirpath.h.tmp dirpath.h >/dev/null ; then : ; else \
183                 mv dirpath.h.tmp dirpath.h ; fi)
184         rm -f dirpath.h.tmp
185
186 util.a: ${objects} AFS_component_version_number.o
187         $(RM) -f util.a
188         $(AR) crv util.a ${objects} AFS_component_version_number.o
189         $(RANLIB) util.a
190
191 util_pic.a: ${objects_pic} AFS_component_version_number_pic.o
192         $(RM) -f util_pic.a
193         $(AR) crv util_pic.a ${objects_pic} AFS_component_version_number_pic.o
194         $(RANLIB) util_pic.a
195
196 pthread_glock.o: ${srcdir}/pthread_glock.c ${includes}
197         ${MT_CC} $(COMMON_CFLAGS) ${MT_CFLAGS} -c ${srcdir}/pthread_glock.c
198
199 ${objects}: ${includes}
200
201 AFS_component_version_number_pic.o: AFS_component_version_number.c
202         $(SHD_CCRULE) AFS_component_version_number.c
203
204 config_file.o: ${TOP_SRCDIR}/external/heimdal/krb5/config_file.c krb5_locl.h
205         $(AFS_CCRULE) -c ${TOP_SRCDIR}/external/heimdal/krb5/config_file.c 
206
207 sys.o: sys.c AFS_component_version_number.c ${includes}
208
209 sys: sys.o 
210         $(AFS_LDRULE) sys.o
211
212 # PIC objects build rules
213 pic_assert.o: ${srcdir}/assert.c ${includes}
214         $(SHD_CCRULE) ${srcdir}/assert.c
215
216 pic_base64.o: ${srcdir}/base64.c ${includes}
217         $(SHD_CCRULE) ${srcdir}/base64.c
218
219 pic_casestrcpy.o: ${srcdir}/casestrcpy.c ${includes}
220         $(SHD_CCRULE) ${srcdir}/casestrcpy.c
221
222 pic_config_file.o: ${TOP_SRCDIR}/external/heimdal/krb5/config_file.c krb5_locl.h
223         $(SHD_CCRULE) ${TOP_SRCDIR}/external/heimdal/krb5/config_file.c
224
225 pic_ktime.o: ${srcdir}/ktime.c ${includes}
226         $(SHD_CCRULE) ${srcdir}/ktime.c
227
228 pic_volparse.o: ${srcdir}/volparse.c ${includes}
229         $(SHD_CCRULE) ${srcdir}/volparse.c
230
231 pic_hostparse.o: ${srcdir}/hostparse.c ${includes}
232         $(SHD_CCRULE) ${srcdir}/hostparse.c
233
234 pic_exec.o: ${srcdir}/exec.c ${includes}
235         $(SHD_CCRULE) ${srcdir}/exec.c
236
237 pic_hputil.o: ${srcdir}/hputil.c ${includes}
238         $(SHD_CCRULE) ${srcdir}/hputil.c
239
240 pic_kreltime.o: ${srcdir}/kreltime.c ${includes}
241         $(SHD_CCRULE) ${srcdir}/kreltime.c
242
243 pic_isathing.o: ${srcdir}/isathing.c ${includes}
244         $(SHD_CCRULE) ${srcdir}/isathing.c
245
246 pic_get_krbrlm.o: ${srcdir}/get_krbrlm.c ${includes}
247         $(SHD_CCRULE) ${srcdir}/get_krbrlm.c
248
249 pic_uuid.o: ${srcdir}/uuid.c ${includes}
250         $(SHD_CCRULE) ${srcdir}/uuid.c
251
252 pic_serverLog.o: ${srcdir}/serverLog.c ${includes}
253         $(SHD_CCRULE) ${srcdir}/serverLog.c
254
255 pic_dirpath.o: ${srcdir}/dirpath.c ${includes}
256         $(SHD_CCRULE) ${srcdir}/dirpath.c
257
258 pic_fileutil.o: ${srcdir}/fileutil.c ${includes}
259         $(SHD_CCRULE) ${srcdir}/fileutil.c
260
261 pic_netutils.o: ${srcdir}/netutils.c ${includes}
262         $(SHD_CCRULE) ${srcdir}/netutils.c
263
264 pic_flipbase64.o: ${srcdir}/flipbase64.c ${includes}
265         $(SHD_CCRULE) ${srcdir}/flipbase64.c
266
267 pic_fstab.o: ${srcdir}/fstab.c ${includes}
268         $(SHD_CCRULE) ${srcdir}/fstab.c
269
270 pic_afs_atomlist.o: ${srcdir}/afs_atomlist.c ${includes}
271         $(SHD_CCRULE) ${srcdir}/afs_atomlist.c
272
273 pic_afs_lhash.o: ${srcdir}/afs_lhash.c ${includes}
274         $(SHD_CCRULE) ${srcdir}/afs_lhash.c
275
276 pic_snprintf.o: ${srcdir}/snprintf.c ${includes}
277         $(SHD_CCRULE) ${srcdir}/snprintf.c
278
279 pic_pthread_glock.o: ${srcdir}/pthread_glock.c ${includes}
280         $(SHD_CCRULE) ${srcdir}/pthread_glock.c
281
282 pic_tabular_output.o: ${srcdir}/tabular_output.c ${includes}
283         $(SHD_CCRULE) ${srcdir}/tabular_output.c
284
285 pic_regex.o: ${srcdir}/regex.c ${includes}
286         $(SHD_CCRULE) ${srcdir}/regex.c
287
288 #
289 # Install targets
290 #
291 KDIR=../libafs/afs
292 UKDIR=../libuafs/afs
293
294 install: dirpath.h util.a util_pic.a sys
295         ${INSTALL} -d ${DESTDIR}${includedir}/afs
296         ${INSTALL} -d ${DESTDIR}${libdir}/afs
297         ${INSTALL} -d ${DESTDIR}${bindir}
298         ${INSTALL_DATA} dirpath.h ${DESTDIR}${includedir}/afs/dirpath.h
299         ${INSTALL_DATA} ${srcdir}/pthread_nosigs.h ${DESTDIR}${includedir}/afs/pthread_nosigs.h
300         ${INSTALL_DATA} ${srcdir}/afs_assert.h ${DESTDIR}${includedir}/afs/afs_assert.h
301         ${INSTALL_DATA} ${srcdir}/errors.h ${DESTDIR}${includedir}/afs/errors.h
302         ${INSTALL_DATA} ${srcdir}/vice.h ${DESTDIR}${includedir}/afs/vice.h
303         ${INSTALL_DATA} ${srcdir}/remote.h ${DESTDIR}${includedir}/afs/remote.h
304         ${INSTALL_DATA} ${srcdir}/ktime.h ${DESTDIR}${includedir}/afs/ktime.h
305         ${INSTALL_DATA} ${srcdir}/fileutil.h ${DESTDIR}${includedir}/afs/fileutil.h
306         ${INSTALL_DATA} ${srcdir}/netutils.h ${DESTDIR}${includedir}/afs/netutils.h
307         ${INSTALL_DATA} ${srcdir}/packages.h ${DESTDIR}${includedir}/afs/packages.h
308         ${INSTALL_DATA} ${srcdir}/afsutil.h ${DESTDIR}${includedir}/afs/afsutil.h
309         ${INSTALL_DATA} ${srcdir}/afsutil_prototypes.h ${DESTDIR}${includedir}/afs/afsutil_prototypes.h
310         ${INSTALL_DATA} ${srcdir}/pthread_glock.h ${DESTDIR}${includedir}/afs/pthread_glock.h
311         ${INSTALL_DATA} ${srcdir}/afs_atomlist.h ${DESTDIR}${includedir}/afs/afs_atomlist.h
312         ${INSTALL_DATA} ${srcdir}/afs_lhash.h ${DESTDIR}${includedir}/afs/afs_lhash.h
313         ${INSTALL_DATA} ${srcdir}/softsig.h ${DESTDIR}${includedir}/afs/softsig.h
314         ${INSTALL_DATA} ${srcdir}/work_queue.h ${DESTDIR}${includedir}/afs/work_queue.h
315         ${INSTALL_DATA} ${srcdir}/work_queue_types.h ${DESTDIR}${includedir}/afs/work_queue_types.h
316         ${INSTALL_DATA} ${srcdir}/thread_pool.h ${DESTDIR}${includedir}/afs/thread_pool.h
317         ${INSTALL_DATA} ${srcdir}/thread_pool_types.h ${DESTDIR}${includedir}/afs/thread_pool_types.h
318         ${INSTALL_DATA} ${srcdir}/tabular_output.h ${DESTDIR}${includedir}/afs/tabular_output.h
319         ${INSTALL_DATA} util.a ${DESTDIR}${libdir}/afs/util.a
320         ${INSTALL_DATA} util.a ${DESTDIR}${libdir}/afs/libafsutil.a
321         ${INSTALL_DATA} util_pic.a ${DESTDIR}${libdir}/afs/libafsutil_pic.a
322         ${INSTALL_PROGRAM} sys ${DESTDIR}${bindir}/sys
323
324 dest: dirpath.h util.a util_pic.a sys
325         ${INSTALL} -d ${DEST}/include/afs
326         ${INSTALL} -d ${DEST}/lib/afs
327         ${INSTALL} -d ${DEST}/bin
328         ${INSTALL_DATA} dirpath.h ${DEST}/include/afs/dirpath.h
329         ${INSTALL_DATA} ${srcdir}/pthread_nosigs.h ${DEST}/include/afs/pthread_nosigs.h
330         ${INSTALL_DATA} ${srcdir}/afs_assert.h ${DEST}/include/afs/afs_assert.h
331         ${INSTALL_DATA} ${srcdir}/errors.h ${DEST}/include/afs/errors.h
332         ${INSTALL_DATA} ${srcdir}/vice.h ${DEST}/include/afs/vice.h
333         ${INSTALL_DATA} ${srcdir}/remote.h ${DEST}/include/afs/remote.h
334         ${INSTALL_DATA} ${srcdir}/ktime.h ${DEST}/include/afs/ktime.h
335         ${INSTALL_DATA} ${srcdir}/fileutil.h ${DEST}/include/afs/fileutil.h
336         ${INSTALL_DATA} ${srcdir}/netutils.h ${DEST}/include/afs/netutils.h
337         ${INSTALL_DATA} ${srcdir}/packages.h ${DEST}/include/afs/packages.h
338         ${INSTALL_DATA} ${srcdir}/afsutil.h ${DEST}/include/afs/afsutil.h
339         ${INSTALL_DATA} ${srcdir}/afsutil_prototypes.h ${DEST}/include/afs/afsutil_prototypes.h
340         ${INSTALL_DATA} ${srcdir}/pthread_glock.h ${DEST}/include/afs/pthread_glock.h
341         ${INSTALL_DATA} ${srcdir}/afs_atomlist.h ${DEST}/include/afs/afs_atomlist.h
342         ${INSTALL_DATA} ${srcdir}/afs_lhash.h ${DEST}/include/afs/afs_lhash.h
343         ${INSTALL_DATA} ${srcdir}/softsig.h ${DEST}/include/afs/softsig.h
344         ${INSTALL_DATA} ${srcdir}/work_queue.h ${DEST}/include/afs/work_queue.h
345         ${INSTALL_DATA} ${srcdir}/work_queue_types.h ${DEST}/include/afs/work_queue_types.h
346         ${INSTALL_DATA} ${srcdir}/thread_pool.h ${DEST}/include/afs/thread_pool.h
347         ${INSTALL_DATA} ${srcdir}/thread_pool_types.h ${DEST}/include/afs/thread_pool_types.h
348         ${INSTALL_DATA} ${srcdir}/tabular_output.h ${DEST}/include/afs/tabular_output.h
349         ${INSTALL_DATA} util.a ${DEST}/lib/afs/util.a
350         ${INSTALL_DATA} util.a ${DEST}/lib/afs/libafsutil.a
351         ${INSTALL_DATA} util_pic.a ${DEST}/lib/afs/libafsutil_pic.a
352         ${INSTALL_PROGRAM} sys ${DEST}/bin/sys
353
354 #
355 # Misc targets
356 #
357
358 clean:
359         $(RM) -f ${objects} sys dirpath.h
360         $(RM) -f util.a util_pic.a *.o core AFS_component_version_number.c
361
362 test:
363         cd test; $(MAKE)
364
365 include ../config/Makefile.version
366
367 check-splint:
368         sh $(HELPER_SPLINT) $(CFLAGS) \
369             assert.c base64.c casestrcpy.c ktime.c volparse.c hostparse.c \
370             hputil.c kreltime.c isathing.c get_krbrlm.c uuid.c serverLog.c \
371             dirpath.c fileutil.c netutils.c flipbase64.c \
372             afs_atomlist.c afs_lhash.c snprintf.c fstab.c