tubik: Fix objdir builds
[openafs.git] / src / tvlserver / 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 INSTALL = @INSTALL@
11 INSTALL_DATA = @INSTALL_DATA@
12 INSTALL_PROGRAM = @INSTALL_PROGRAM@
13 INSTALL_SCRIPT = @INSTALL_SCRIPT@
14 HELPER_SPLINT=@HELPER_SPLINT@
15 ENABLE_PTHREADED_UBIK=@ENABLE_PTHREADED_UBIK@
16
17 CC=${MT_CC}
18 CFLAGS=${COMMON_CFLAGS} ${MT_CFLAGS} 
19 CCRULE=${CC} ${CFLAGS} -c $<
20
21 RX=../rx
22 UTIL=../util
23 VLSERVER=../vlserver
24
25 RXOBJS= rx_pthread.o rxkad_errs.o
26
27 UTILOBJS=assert.o uuid.o serverLog.o fileutil.o netutils.o dirpath.o \
28      volparse.o flipbase64.o softsig.o hostparse.o snprintf.o \
29      pthread_glock.o get_krbrlm.o
30
31 INCLS=${TOP_INCDIR}/ubik.h \
32              ${TOP_INCDIR}/lwp.h \
33              ${TOP_INCDIR}/lock.h  \
34              ${TOP_INCDIR}/rx/rx.h \
35              ${TOP_INCDIR}/rx/xdr.h \
36              ${TOP_INCDIR}/afs/keys.h \
37              ${TOP_INCDIR}/afs/cellconfig.h \
38         vlserver.h vldbint.h
39
40 LIBS=   ${TOP_LIBDIR}/libubik_pthread.a \
41         ${TOP_LIBDIR}/libafsauthent.a \
42         ${TOP_LIBDIR}/libcmd.a \
43         ${TOP_LIBDIR}/libafsrpc.a \
44         ${TOP_LIBDIR}/libafsutil.a 
45
46 OBJS=vldbint.xdr.o vldbint.cs.o vl_errors.o ${RXOBJS} ${UTILOBJS} 
47
48
49 all: \
50         vlserver vlclient vlserver cnvldb vldb_check \
51         Kvldbint.cs.c Kvldbint.xdr.c vldbint.h 
52
53 depinstall:
54
55 rx_pthread.o: ${RX}/rx_pthread.c
56         ${CCRULE}
57
58 rxkad_errs.o: ../rxkad/rxkad_errs.c
59         ${CCRULE}
60
61 #
62 # get the pthreaded util stuff compiled here.  we do this instead of
63 # using the non-pthreaded libutil.a.  There probably should be a
64 # pthreaded version of this library, as we are doing with ubik itself, but...
65 #
66
67 assert.o: ${UTIL}/assert.c
68         ${CCRULE}
69
70 uuid.o: ${UTIL}/uuid.c
71         ${CCRULE}
72
73 serverLog.o: ${UTIL}/serverLog.c
74         ${CCRULE}
75
76 fileutil.o: ${UTIL}/fileutil.c
77         ${CCRULE}
78
79 volparse.o: ${UTIL}/volparse.c
80         ${CCRULE}
81
82 flipbase64.o: ${UTIL}/flipbase64.c
83         ${CCRULE}
84
85 netutils.o: ${UTIL}/netutils.c
86         ${CCRULE}
87
88 dirpath.o: ${UTIL}/dirpath.c
89         ${CCRULE}
90
91 softsig.o: ${UTIL}/softsig.c
92         ${CCRULE}
93
94 hostparse.o: ${UTIL}/hostparse.c
95         ${CCRULE}
96
97 snprintf.o: ${UTIL}/snprintf.c
98         ${CCRULE}
99
100 pthread_glock.o: ${UTIL}/pthread_glock.c
101         ${CCRULE}
102
103 get_krbrlm.o: ${UTIL}/get_krbrlm.c
104         ${CCRULE}
105
106 #
107 # Other stuff
108 #
109
110
111 vldb_check: vldb_check.o ${LIBS} AFS_component_version_number.o
112         $(CC) ${LDFLAGS} -o vldb_check vldb_check.o AFS_component_version_number.o ${LIBS} ${MT_LIBS} ${XLIBS} 
113
114 vldb_check.o: ${VLSERVER}/vldb_check.c 
115         ${CCRULE}
116
117 cnvldb: cnvldb.o ${LIBS} 
118         $(CC) ${LDFLAGS} -o cnvldb cnvldb.o ${LIBS} ${MT_LIBS} ${XLIBS}
119
120 cnvldb.o: ${VLSERVER}/cnvldb.c
121         ${CCRULE}
122
123 sascnvldb: sascnvldb.o ${LIBS} 
124         $(CC) ${LDFLAGS} -o sascnvldb sascnvldb.o ${LIBS} ${MT_LIBS} ${XLIBS}
125
126 sascnvldb.o: ${VLSERVER}/sascnvldb.c
127         ${CCRULE}
128
129 vlserver: vlserver.o vlutils.o vlprocs.o vldbint.ss.o vldbint.xdr.o $(LIBS)
130         $(CC) ${LDFLAGS} -o vlserver vlserver.o vlutils.o vlprocs.o vldbint.ss.o \
131                 vldbint.xdr.o $(LIBS) ${MT_LIBS} ${XLIBS} ${TOP_LIBDIR}/libaudit.a
132
133 vlserver.o: ${VLSERVER}/vlserver.c ${INCLS} AFS_component_version_number.o
134         ${CCRULE}
135
136 vlutils.o: ${VLSERVER}/vlutils.c ${INCLS}
137         ${CCRULE}
138
139 vlprocs.o: ${VLSERVER}/vlprocs.c ${INCLS}
140         ${CCRULE}
141
142 vldbint.ss.o: vldbint.ss.c 
143         ${CCRULE}
144
145 vldbint.cs.o: vldbint.cs.c 
146         ${CCRULE}
147
148 vldbint.xdr.o: vldbint.xdr.c 
149         ${CCRULE}
150
151 vldbint.cs.c: ${VLSERVER}/vldbint.xg
152         ${RXGEN} -A -u -x -C -o $@ ${srcdir}/${VLSERVER}/vldbint.xg
153
154 vldbint.ss.c: ${VLSERVER}/vldbint.xg
155         ${RXGEN} -A -x -S -o $@ ${srcdir}/${VLSERVER}/vldbint.xg
156
157 vldbint.xdr.c: ${VLSERVER}/vldbint.xg
158         ${RXGEN} -A -x -c -o $@ ${srcdir}/${VLSERVER}/vldbint.xg
159
160 vldbint.h: ${VLSERVER}/vldbint.xg
161         ${RXGEN} -A -u -x -h -o $@ ${srcdir}/${VLSERVER}/vldbint.xg
162
163 vldbint.cs.c: vldbint.h
164 vldbint.ss.c: vldbint.h
165 vldbint.xdr.c: vldbint.h
166
167 Kvldbint.cs.c: ${VLSERVER}/vldbint.xg
168         ${RXGEN} -A -x -k -C -o $@ ${srcdir}/${VLSERVER}/vldbint.xg
169
170 Kvldbint.xdr.c: ${VLSERVER}/vldbint.xg
171         ${RXGEN} -A -x -k -c -o $@ ${srcdir}/${VLSERVER}/vldbint.xg
172
173 vlclient: vlclient.o $(OBJS) $(LIBS) ${INCLS}
174         $(CC) ${LDFLAGS} -o vlclient vlclient.o $(OBJS) $(LIBS) ${MT_LIBS} ${XLIBS} ${TOP_LIBDIR}/libcmd.a
175
176 vlclient.o: ${VLSERVER}/vlclient.c
177         ${CCRULE}
178
179 vl_errors.o: vl_errors.c
180         ${CCRULE}
181
182 vlserver.h vl_errors.c: ${VLSERVER}/vl_errors.et ${VLSERVER}/vlserver.p.h
183         $(RM) -f vlserver.h vl_errors.c; ${COMPILE_ET} -p ${srcdir}/${VLSERVER} vl_errors -h vlserver
184
185 system: install
186
187 install: vlserver cnvldb vldb_check
188         if [ "x$(ENABLE_PTHREADED_UBIK)" = "xyes" ] ; then \
189                 ${INSTALL_PROGRAM} vlserver ${DESTDIR}${afssrvlibexecdir}/vlserver; \
190                 ${INSTALL_PROGRAM} cnvldb ${DESTDIR}${afssrvsbindir}/vldb_convert; \
191                 ${INSTALL_PROGRAM} vldb_check ${DESTDIR}${afssrvsbindir}/vldb_check; \
192         fi
193
194 dest: vlserver cnvldb vldb_check
195         if [ "x$(ENABLE_PTHREADED_UBIK)" = "xyes" ] ; then \
196                 ${INSTALL_PROGRAM} vlserver ${DEST}/root.server/usr/afs/bin/vlserver; \
197                 ${INSTALL_PROGRAM} cnvldb ${DEST}/etc/vldb_convert; \
198                 ${INSTALL_PROGRAM} vldb_check ${DEST}/etc/vldb_check; \
199         fi
200
201 #
202 # Misc targets
203 #
204 include ../config/Makefile.version
205
206 clean:
207         $(RM) -f *.o *.a *.otl *.xdr.c *.cs.c *.ss.c core \
208                 vlserver vlclient cnvldb vldbint.h vlserver.h vldb_check \
209                 vl_errors.c AFS_component_version_number.c