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