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