tubik-build-fix-20080624
[openafs.git] / src / tubik / 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@/../ubik
9 include @TOP_OBJDIR@/src/config/Makefile.config
10 INSTALL = @INSTALL@
11 INSTALL_DATA = @INSTALL_DATA@
12 INSTALL_PROGRAM = @INSTALL_PROGRAM@
13 INSTALL_SCRIPT = @INSTALL_SCRIPT@
14 HELPER_SPLINT=@HELPER_SPLINT@
15
16 CCRULE=${MT_CC} ${CFLAGS} ${MT_CFLAGS} -c $?
17
18 RX=../rx
19 UTIL=../util
20
21 LIBOBJS=disk.o  remote.o beacon.o recovery.o ubik.o  vote.o lock.o phys.o \
22         ubik_int.cs.o ubik_int.ss.o ubik_int.xdr.o ubikcmd.o \
23         ubikclient.o uerrors.o uinit.o
24
25 INCLS=${TOP_INCDIR}/lwp.h ${TOP_INCDIR}/lock.h \
26         ${TOP_INCDIR}/rx/rx.h ${TOP_INCDIR}/rx/xdr.h \
27         ${TOP_INCDIR}/lock.h ubik.h ubik_int.h utst_int.h
28
29 RXOBJS = rx_pthread.o
30
31 UTILOBJS=assert.o uuid.o serverLog.o fileutil.o netutils.o dirpath.o \
32        volparse.o flipbase64.o softsig.o hostparse.o snprintf.o \
33        pthread_glock.o strlcat.o strlcpy.o strnlen.o
34
35 LIBS=${RXOBJS} ${UTILOBJS} ${TOP_LIBDIR}/libafsrpc.a ${TOP_LIBDIR}/liblwp.a \
36      ${TOP_LIBDIR}/libcom_err.a ${TOP_LIBDIR}/libcmd.a \
37      ${TOP_LIBDIR}/libsys.a ${XLIBS} \
38      ${LDFLAGS} ${MT_LIBS}
39
40 all: depinstall ${TOP_LIBDIR}/libubik_pthread.a udebug utst_server utst_client
41
42 depinstall: \
43         ubik_int.cs.c ubik_int.xdr.c \
44         ${TOP_INCDIR}/ubik.h \
45         ${TOP_INCDIR}/ubik_int.h
46
47 #
48 # get the pthreaded rx stuff compiled here
49 #
50
51 rx_pthread.o: ${RX}/rx_pthread.c
52         ${CCRULE} -DDPF_FSLOG
53
54 #
55 # get the pthreaded util stuff compiled here.  we do this instead of
56 # using the non-pthreaded libutil.a.  There probably should be a
57 # pthreaded version of this library, as we are doing with ubik itself, but...
58 #
59
60 assert.o: ${UTIL}/assert.c
61         ${CCRULE}
62
63 uuid.o: ${UTIL}/uuid.c
64         ${CCRULE}
65
66 serverLog.o: ${UTIL}/serverLog.c
67         ${CCRULE}
68
69 fileutil.o: ${UTIL}/fileutil.c
70         ${CCRULE}
71
72 volparse.o: ${UTIL}/volparse.c
73         ${CCRULE}
74
75 strlcat.o: ${UTIL}/strlcat.c
76         ${CCRULE}
77
78 strlcpy.o: ${UTIL}/strlcpy.c
79         ${CCRULE}
80
81 strnlen.o: ${UTIL}/strnlen.c
82         ${CCRULE}
83
84 flipbase64.o: ${UTIL}/flipbase64.c
85         ${CCRULE}
86
87 netutils.o: ${UTIL}/netutils.c
88         ${CCRULE}
89
90 dirpath.o: ${UTIL}/dirpath.c
91         ${CCRULE}
92
93 softsig.o: ${UTIL}/softsig.c
94         ${CCRULE}
95
96 hostparse.o: ${UTIL}/hostparse.c
97         ${CCRULE}
98
99 snprintf.o: ${UTIL}/snprintf.c
100         ${CCRULE}
101
102 pthread_glock.o: ${UTIL}/pthread_glock.c
103         ${CCRULE}
104
105
106 #
107 # insert comments here
108 #
109
110 utst_server: utst_server.o utst_int.ss.o utst_int.xdr.o libubik_pthread.a ${RXOBJS} ${UTILOBJS}
111         ${CC} ${CFLAGS} -o utst_server utst_server.o utst_int.ss.o utst_int.xdr.o libubik_pthread.a $(LIBS)
112
113 utst_client: utst_client.o utst_int.cs.o utst_int.xdr.o libubik_pthread.a ${RXOBJS} ${UTILOBJS}
114         ${CC} ${CFLAGS} -o utst_client utst_client.o utst_int.cs.o utst_int.xdr.o libubik_pthread.a $(LIBS)
115
116 udebug: udebug.o libubik_pthread.a ${RXOBJS} ${UTILOBJS}
117         ${CC} ${CFLAGS} -o udebug udebug.o libubik_pthread.a $(LIBS)
118
119 ubik_int.cs.c: ${srcdir}/ubik_int.xg
120         ${RXGEN} -x -C -o $@ ${srcdir}/ubik_int.xg
121
122 ubik_int.ss.c: ${srcdir}/ubik_int.xg
123         ${RXGEN} -x -S -o $@ ${srcdir}/ubik_int.xg
124
125 ubik_int.xdr.c: ${srcdir}/ubik_int.xg
126         ${RXGEN} -x -c -o $@ ${srcdir}/ubik_int.xg
127
128 ubik_int.h: ${srcdir}/ubik_int.xg
129         ${RXGEN} -x -h -o $@ ${srcdir}/ubik_int.xg
130
131 ubik_int.cs.c: ubik_int.h
132 ubik_int.ss.c: ubik_int.h
133 ubik_int.xdr.c: ubik_int.h
134
135 Kubik_int.cs.c: ${srcdir}/ubik_int.xg Kubik_int.h
136         ${RXGEN} -x -k -C -o Kubik_int.cs.c ${srcdir}/ubik_int.xg
137  
138 Kubik_int.xdr.c: ${srcdir}/ubik_int.xg
139         ${RXGEN} -x -k -c -o Kubik_int.xdr.c ${srcdir}/ubik_int.xg
140  
141 Kubik_int.h: ${srcdir}/ubik_int.xg
142         ${RXGEN} -x -k -h -o Kubik_int.h ${srcdir}/ubik_int.xg
143
144 #utst_int.ss.o: utst_int.ss.c utst_int.xdr.c
145 #       ${CCRULE}
146
147 #utst_int.cs.o: utst_int.cs.c utst_int.xdr.c
148 #       ${CCRULE}
149
150 #utst_int.xdr.o: utst_int.xdr.c utst_int.h
151 #       ${CCRULE}
152
153 utst_int.cs.c: ${srcdir}/utst_int.xg
154         ${RXGEN} -C -o $@ ${srcdir}/utst_int.xg
155
156 utst_int.ss.c: ${srcdir}/utst_int.xg
157         ${RXGEN} -S -o $@ ${srcdir}/utst_int.xg
158
159 utst_int.xdr.c: ${srcdir}/utst_int.xg
160         ${RXGEN} -c -o $@ ${srcdir}/utst_int.xg
161
162 utst_int.h: ${srcdir}/utst_int.xg
163         ${RXGEN} -h -o $@ ${srcdir}/utst_int.xg
164
165 utst_int.cs.c: utst_int.h
166 utst_int.ss.c: utst_int.h
167 utst_int.xdr.c: utst_int.h
168
169 utst_server.o: ${srcdir}/utst_server.c
170         ${CCRULE}
171
172 utst_client.o: ${srcdir}/utst_client.c
173         ${CCRULE}
174
175 udebug.o: ${srcdir}/udebug.c
176         ${CCRULE}
177
178 #       ${CC} ${CFLAGS} -I. -I${TOP_INCDIR} -I${TOP_INCDIR}/afs -c ${srcdir}/udebug.c
179
180 uerrors.o: uerrors.c
181         ${CCRULE}
182
183 uerrors.c ubik.h: ${srcdir}/uerrors.et ${srcdir}/ubik.p.h
184         $(RM) -f ubik.h uerrors.c
185         ${COMPILE_ET} -p ${srcdir} uerrors -h ubik
186
187 libubik_pthread.a: ${INCLS} ${LIBOBJS} AFS_component_version_number.o
188         -$(RM) -f $@
189         $(AR) crc $@ ${LIBOBJS} AFS_component_version_number.o
190         $(RANLIB) $@
191
192 disk.o: ${srcdir}/disk.c
193         ${CCRULE}
194
195 uinit.o: ${srcdir}/uinit.c
196         ${CCRULE}
197
198 remote.o: ${srcdir}/remote.c
199         ${CCRULE}
200
201 beacon.o: ${srcdir}/beacon.c
202         ${CCRULE}
203
204 lock.o: ${srcdir}/lock.c
205         ${CCRULE}
206
207 recovery.o: ${srcdir}/recovery.c
208         ${CCRULE}
209
210 ubik.o: ${srcdir}/ubik.c
211         ${CCRULE}
212
213 phys.o: ${srcdir}/phys.c
214         ${CCRULE}
215
216 vote.o: ${srcdir}/vote.c
217         ${CCRULE}
218
219 ubikcmd.o: ${srcdir}/ubikcmd.c
220         ${CCRULE}
221
222 ubikclient.o: ${srcdir}/ubikclient.c
223         ${CCRULE}
224
225 ubik_int.ss.o: ubik_int.ss.c
226         ${CCRULE}
227
228 ubik_int.cs.o: ubik_int.cs.c
229         ${CCRULE}
230
231 ubik_int.xdr.o: ubik_int.xdr.c
232         ${CCRULE}
233
234 utst_int.ss.o: utst_int.ss.c 
235         ${CCRULE}
236
237 utst_int.cs.o: utst_int.cs.c
238         ${CCRULE}
239
240 utst_int.xdr.o: utst_int.xdr.c
241         ${CCRULE}
242
243 #
244 # Installation targets
245 #
246 test: all
247
248 install: \
249         ${DESTDIR}${libdir}/libubik_pthread.a \
250         ${DESTDIR}${bindir}/udebug \
251         ${DESTDIR}${afssrvbindir}/udebug
252
253 ${DEST}/bin/udebug ${DEST}/root.server/usr/afs/bin/udebug: udebug
254         ${INSTALL} $? $@
255
256 ${DEST}/lib/libubik_pthread.a: libubik_pthread.a
257         ${INSTALL} $? $@
258
259 ${DEST}/include/ubik.h: ubik.h
260         ${INSTALL} $? $@
261
262 ${DEST}/include/ubik_int.h: ubik_int.h
263         ${INSTALL} $? $@
264
265 #
266 # Misc. targets
267 #
268 clean:
269         $(RM) -f *.o utst_server utst_client udebug *.a *.cs.c *.ss.c *.xdr.c
270         $(RM) -f utst_int.h ubik_int.h uerrors.c ubik.h core AFS_component_version_number.c Kubik_int.h
271
272 include ../config/Makefile.version
273
274
275 ${DESTDIR}${libdir}/libubik_pthread.a: libubik_pthread.a
276         ${INSTALL} $? $@
277
278 ${TOP_LIBDIR}/libubik_pthread.a: libubik_pthread.a
279         ${INSTALL} $? $@
280
281 ${DESTDIR}${includedir}/ubik.h: ubik.h
282         ${INSTALL} $? $@
283
284 ${TOP_INCDIR}/ubik.h: ubik.h
285         ${INSTALL} $? $@
286
287 ${DESTDIR}${includedir}/ubik_int.h: ubik_int.h
288         ${INSTALL} $? $@
289
290 ${TOP_INCDIR}/ubik_int.h: ubik_int.h
291         ${INSTALL} $? $@
292
293 ${DESTDIR}${bindir}/udebug: udebug
294         ${INSTALL} $? $@
295
296 ${DESTDIR}${afssrvbindir}/udebug: udebug
297         ${INSTALL} $? $@
298
299 dest: \
300         ${DEST}/lib/libubik_pthread.a \
301         ${DEST}/bin/udebug \
302         ${DEST}/root.server/usr/afs/bin/udebug
303