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