f8dcbfc0003cc275ceeec084c930887f823fbbde
[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@
9 include @TOP_OBJDIR@/src/config/Makefile.config
10 include @TOP_OBJDIR@/src/config/Makefile.pthread
11
12 HELPER_SPLINT=@HELPER_SPLINT@
13 ENABLE_PTHREADED_UBIK=@ENABLE_PTHREADED_UBIK@
14
15 UBIK=$(srcdir)/../ubik
16 RX=$(srcdir)/../rx
17 UTIL=$(srcdir)/../util
18
19 LIBOBJS=disk.o  remote.o beacon.o recovery.o ubik.o  vote.o lock.o phys.o \
20         ubik_int.cs.o ubik_int.ss.o ubik_int.xdr.o ubikcmd.o \
21         ubikclient.o uerrors.o uinit.o
22
23 INCLS=${TOP_INCDIR}/lwp.h ${TOP_INCDIR}/lock.h \
24         ${TOP_INCDIR}/rx/rx.h ${TOP_INCDIR}/rx/xdr.h \
25         ${TOP_INCDIR}/lock.h ubik.h ubik_int.h utst_int.h
26
27 RXOBJS = rx_pthread.o
28
29 UTILOBJS=uuid.o serverLog.o fileutil.o dirpath.o \
30        volparse.o flipbase64.o softsig.o hostparse.o pthread_glock.o \
31        pthread_threadname.o
32
33 LIBS=${RXOBJS} ${UTILOBJS} ${TOP_LIBDIR}/libafsauthent.a ${TOP_LIBDIR}/libafsrpc.a \
34      $(top_builddir)/src/comerr/liboafs_comerr.la \
35      $(TOP_LIBDIR)/libcmd.a \
36      ${TOP_LIBDIR}/libsys.a \
37      $(top_builddir)/src/opr/liboafs_opr.la \
38      ${XLIBS} ${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 CFLAGS_rx_pthread.o = -DDPF_FSLOG
52 rx_pthread.o: ${RX}/rx_pthread.c
53         $(AFS_CCRULE) $(RX)/rx_pthread.c
54
55 #
56 # get the pthreaded util stuff compiled here.  we do this instead of
57 # using the non-pthreaded libutil.a.  There probably should be a
58 # pthreaded version of this library, as we are doing with ubik itself, but...
59 #
60
61 uuid.o: ${UTIL}/uuid.c
62         $(AFS_CCRULE) $(UTIL)/uuid.c
63
64 serverLog.o: ${UTIL}/serverLog.c
65         $(AFS_CCRULE) $(UTIL)/serverLog.c
66
67 fileutil.o: ${UTIL}/fileutil.c
68         $(AFS_CCRULE) $(UTIL)/fileutil.c
69
70 volparse.o: ${UTIL}/volparse.c
71         $(AFS_CCRULE) $(UTIL)/volparse.c
72
73 flipbase64.o: ${UTIL}/flipbase64.c
74         $(AFS_CCRULE) $(UTIL)/flipbase64.c
75
76 dirpath.o: ${UTIL}/dirpath.c
77         $(AFS_CCRULE) $(UTIL)/dirpath.c
78
79 softsig.o: ${UTIL}/softsig.c
80         $(AFS_CCRULE) $(UTIL)/softsig.c
81
82 hostparse.o: ${UTIL}/hostparse.c
83         $(AFS_CCRULE) $(UTIL)/hostparse.c
84
85 pthread_glock.o: ${UTIL}/pthread_glock.c
86         $(AFS_CCRULE) $(UTIL)/pthread_glock.c
87
88 pthread_threadname.o: ${UTIL}/pthread_threadname.c
89         $(AFS_CCRULE) $(UTIL)/pthread_threadname.c
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         $(LT_LDRULE_static) utst_server.o utst_int.ss.o utst_int.xdr.o \
97                 libubik_pthread.a $(LIBS) $(LIB_hcrypto) $(LIB_roken)
98
99 utst_client: utst_client.o utst_int.cs.o utst_int.xdr.o libubik_pthread.a ${RXOBJS} ${UTILOBJS}
100         $(LT_LDRULE_static) utst_client.o utst_int.cs.o utst_int.xdr.o \
101                 libubik_pthread.a $(LIBS) $(LIB_hcrypto) $(LIB_roken)
102
103 udebug: udebug.o libubik_pthread.a ${RXOBJS} ${UTILOBJS}
104         $(LT_LDRULE_static) udebug.o libubik_pthread.a \
105                 $(LIBS) $(LIB_hcrypto) $(LIB_roken)
106
107 ubik_int.cs.c: ${UBIK}/ubik_int.xg
108         ${RXGEN} -A -x -C -o $@ ${UBIK}/ubik_int.xg
109
110 ubik_int.ss.c: ${UBIK}/ubik_int.xg
111         ${RXGEN} -A -x -S -o $@ ${UBIK}/ubik_int.xg
112
113 ubik_int.xdr.c: ${UBIK}/ubik_int.xg
114         ${RXGEN} -A -x -c -o $@ ${UBIK}/ubik_int.xg
115
116 ubik_int.h: ${UBIK}/ubik_int.xg
117         ${RXGEN} -A -x -h -o $@ ${UBIK}/ubik_int.xg
118
119 ubik_int.cs.c: ubik_int.h
120 ubik_int.ss.c: ubik_int.h
121 ubik_int.xdr.c: ubik_int.h
122
123 Kubik_int.cs.c: ${UBIK}/ubik_int.xg Kubik_int.h
124         ${RXGEN} -A -x -k -C -o Kubik_int.cs.c ${UBIK}/ubik_int.xg
125  
126 Kubik_int.xdr.c: ${UBIK}/ubik_int.xg
127         ${RXGEN} -A -x -k -c -o Kubik_int.xdr.c ${UBIK}/ubik_int.xg
128  
129 Kubik_int.h: ${UBIK}/ubik_int.xg
130         ${RXGEN} -A -x -k -h -o Kubik_int.h ${UBIK}/ubik_int.xg
131
132 utst_int.ss.o: utst_int.ss.c
133 utst_int.cs.o: utst_int.cs.c
134 utst_int.xdr.o: utst_int.xdr.c
135
136 utst_int.cs.c: ${UBIK}/utst_int.xg
137         ${RXGEN} -A -C -u -o $@ ${UBIK}/utst_int.xg
138
139 utst_int.ss.c: ${UBIK}/utst_int.xg
140         ${RXGEN} -A -S -o $@ ${UBIK}/utst_int.xg
141
142 utst_int.xdr.c: ${UBIK}/utst_int.xg
143         ${RXGEN} -A -c -o $@ ${UBIK}/utst_int.xg
144
145 utst_int.h: ${UBIK}/utst_int.xg
146         ${RXGEN} -A -h -u -o $@ ${UBIK}/utst_int.xg
147
148 utst_int.cs.c: utst_int.h
149 utst_int.ss.c: utst_int.h
150 utst_int.xdr.c: utst_int.h
151
152 utst_server.o: ${UBIK}/utst_server.c
153         ${AFS_CCRULE} ${UBIK}/utst_server.c
154
155 utst_client.o: ${UBIK}/utst_client.c
156         ${AFS_CCRULE} ${UBIK}/utst_client.c
157
158 udebug.o: ${UBIK}/udebug.c
159         ${AFS_CCRULE} ${UBIK}/udebug.c
160
161 uerrors.c ubik.h: ${UBIK}/uerrors.et ${UBIK}/ubik.p.h
162         $(RM) -f ubik.h uerrors.c
163         ${COMPILE_ET} -p ${UBIK} uerrors -h ubik
164
165 libubik_pthread.a: ${INCLS} ${LIBOBJS} AFS_component_version_number.o
166         -$(RM) -f $@
167         $(AR) crc $@ ${LIBOBJS} AFS_component_version_number.o
168         $(RANLIB) $@
169
170 disk.o: ${UBIK}/disk.c
171         $(AFS_CCRULE) $(UBIK)/disk.c
172
173 uinit.o: ${UBIK}/uinit.c
174         $(AFS_CCRULE) $(UBIK)/uinit.c
175
176 remote.o: ${UBIK}/remote.c
177         $(AFS_CCRULE) $(UBIK)/remote.c
178
179 beacon.o: ${UBIK}/beacon.c
180         $(AFS_CCRULE) $(UBIK)/beacon.c
181
182 lock.o: ${UBIK}/lock.c
183         $(AFS_CCRULE) $(UBIK)/lock.c
184
185 recovery.o: ${UBIK}/recovery.c
186         $(AFS_CCRULE) $(UBIK)/recovery.c
187
188 ubik.o: ${UBIK}/ubik.c
189         $(AFS_CCRULE) $(UBIK)/ubik.c
190
191 phys.o: ${UBIK}/phys.c
192         $(AFS_CCRULE) $(UBIK)/phys.c
193
194 vote.o: ${UBIK}/vote.c
195         $(AFS_CCRULE) $(UBIK)/vote.c
196
197 ubikcmd.o: ${UBIK}/ubikcmd.c
198         $(AFS_CCRULE) $(UBIK)/ubikcmd.c
199
200 ubikclient.o: ${UBIK}/ubikclient.c
201         $(AFS_CCRULE) $(UBIK)/ubikclient.c
202 ubik_int.xdr.o: ubik_int.xdr.c
203
204 #
205 # Installation targets
206 #
207 test: all
208
209 install: libubik_pthread.a ubik.h ubik_int.h udebug
210         ${INSTALL} -d ${DESTDIR}${libdir}
211         ${INSTALL} -d ${DESTDIR}${includedir}
212         ${INSTALL} -d ${DESTDIR}${bindir}
213         ${INSTALL} -d ${DESTDIR}${afssrvbindir}
214         ${INSTALL_DATA} libubik_pthread.a ${DESTDIR}${libdir}/libubik_pthread.a
215         if [ "x$(ENABLE_PTHREADED_UBIK)" = "xyes" ] ; then                 \
216             $(LT_INSTALL_PROGRAM) udebug ${DESTDIR}${bindir}/udebug;          \
217             $(LT_INSTALL_PROGRAM) udebug ${DESTDIR}${afssrvbindir}/udebug;    \
218             ${INSTALL_DATA} ubik.h ${DESTDIR}${includedir}/ubik.h;         \
219             ${INSTALL_DATA} ubik_int.h ${DESTDIR}${includedir}/ubik_int.h; \
220         fi
221
222 dest: libubik_pthread.a ubik.h ubik_int.h udebug
223         ${INSTALL} -d ${DEST}/lib
224         ${INSTALL} -d ${DEST}/include
225         ${INSTALL} -d ${DEST}/root.server/usr/afs/bin
226         ${INSTALL_DATA} libubik_pthread.a ${DEST}/lib/libubik_pthread.a
227         if [ "x$(ENABLE_PTHREADED_UBIK)" = "xyes" ] ; then                    \
228             ${INSTALL_PROGRAM} udebug ${DEST}/bin/udebug;                     \
229             ${INSTALL_PROGRAM} udebug ${DEST}/root.server/usr/afs/bin/udebug; \
230             ${INSTALL_DATA} ubik.h ${DEST}/include/ubik.h;                    \
231             ${INSTALL_DATA} ubik_int.h ${DEST}/include/ubik_int.h;            \
232         fi
233 #
234 # Misc. targets
235 #
236 clean:
237         $(LT_CLEAN)
238         $(RM) -f *.o utst_server utst_client udebug *.a *.cs.c *.ss.c *.xdr.c
239         $(RM) -f utst_int.h ubik_int.h uerrors.c ubik.h core AFS_component_version_number.c Kubik_int.h
240
241 include ../config/Makefile.version
242
243 ${TOP_LIBDIR}/libubik_pthread.a: libubik_pthread.a
244         ${INSTALL} $? $@
245
246 ${TOP_INCDIR}/ubik.h: ubik.h
247         ${INSTALL} $? $@
248
249 ${TOP_INCDIR}/ubik_int.h: ubik_int.h
250         ${INSTALL} $? $@
251
252