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