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