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