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