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