DEVEL15-tubik-makefiles-fun-20080402
[openafs.git] / src / tbudb / 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
9 srcdir=@srcdir@
10 include @TOP_OBJDIR@/src/config/Makefile.config
11
12 CCRULE=${MT_CC} ${CFLAGS} ${MT_CFLAGS} -c $?
13
14 RX=../rx
15 UTIL=../util
16 BUDB=../budb
17
18 RXOBJS= rx_pthread.o rxkad_errs.o
19
20 UTILOBJS=assert.o uuid.o serverLog.o fileutil.o netutils.o dirpath.o \
21      volparse.o flipbase64.o softsig.o hostparse.o snprintf.o pthread_glock.o
22
23
24 INCLS=\
25         ${TOP_INCDIR}/lock.h \
26         ${TOP_INCDIR}/ubik.h \
27         ${TOP_INCDIR}/lwp.h \
28         ${TOP_INCDIR}/des.h \
29         ${TOP_INCDIR}/rx/rx.h \
30         ${TOP_INCDIR}/rx/xdr.h \
31         ${TOP_INCDIR}/rx/rxkad.h \
32         ${TOP_INCDIR}/afs/auth.h \
33         ${TOP_INCDIR}/afs/cellconfig.h \
34         ${TOP_INCDIR}/afs/com_err.h \
35         ${TOP_INCDIR}/afs/bubasics.h \
36         budb.h budb_client.h ${BUDB}/database.h
37
38 # library ordering defined by top level makefile
39 LIBS=${RXOBJS} ${UTILOBJS} \
40         ${TOP_LIBDIR}/libbubasics.a \
41         ${TOP_LIBDIR}/libubik_pthread.a \
42         ${TOP_LIBDIR}/libafsauthent.a \
43         ${TOP_LIBDIR}/libafsrpc.a \
44         ${TOP_LIBDIR}/libcmd.a \
45         ${TOP_LIBDIR}/libcom_err.a \
46         ${TOP_LIBDIR}/libafsutil.a \
47         ${MT_LIBS}
48
49 COMMON_OBJS = database.o db_alloc.o db_dump.o db_hash.o struct_ops.o ol_verify.o
50
51 SERVER_OBJS = ${COMMON_OBJS} budb.ss.o budb.xdr.o dbs_dump.o db_lock.o db_text.o \
52         procs.o server.o budb_errs.o
53
54 all: ${TOP_LIBDIR}/libbudb.a ${TOP_INCDIR}/afs/budb.h ${TOP_INCDIR}/afs/budb_errs.h ${TOP_INCDIR}/afs/budb_client.h budb_server ${INCLS}
55
56 #
57 # budb_errs.o actually depends on neither budb_client.h nor budb_errs.h
58 # but generating either of them will rebuild budb_errs.c
59 #
60 budb_errs.o: budb_errs.c budb_client.h budb_errs.h
61
62 budb_errs.c budb_client.h: ${BUDB}/budb_errs.et ${BUDB}/budb_client.p.h
63         $(RM) -f budb_client.h budb_errs.c; ${COMPILE_ET} -p ${BUDB} budb_errs -h budb_client
64
65 budb_errs.h: ${BUDB}/budb_errs.et
66         ${COMPILE_ET} -p ${BUDB} budb_errs
67
68 #
69 # Build targets
70 #
71
72 rx_pthread.o: ${RX}/rx_pthread.c
73         ${CCRULE}
74
75 rxkad_errs.o: ../rxkad/rxkad_errs.c
76         ${CCRULE}
77
78 # get the pthreaded util stuff compiled here.  we do this instead of
79 # using the non-pthreaded libutil.a.  There probably should be a
80 # pthreaded version of this library, as we are doing with ubik itself, but...
81 #
82
83 assert.o: ${UTIL}/assert.c
84         ${CCRULE}
85
86 uuid.o: ${UTIL}/uuid.c
87         ${CCRULE}
88
89 serverLog.o: ${UTIL}/serverLog.c
90         ${CCRULE}
91
92 fileutil.o: ${UTIL}/fileutil.c
93         ${CCRULE}
94
95 volparse.o: ${UTIL}/volparse.c
96         ${CCRULE}
97
98 flipbase64.o: ${UTIL}/flipbase64.c
99         ${CCRULE}
100
101 netutils.o: ${UTIL}/netutils.c
102         ${CCRULE}
103
104 dirpath.o: ${UTIL}/dirpath.c
105         ${CCRULE}
106
107 softsig.o: ${UTIL}/softsig.c
108         ${CCRULE}
109
110 hostparse.o: ${UTIL}/hostparse.c
111         ${CCRULE}
112
113 snprintf.o: ${UTIL}/snprintf.c
114         ${CCRULE}
115
116 pthread_glock.o: ${UTIL}/pthread_glock.c
117         ${CCRULE}
118
119
120 database.o: ${BUDB}/database.c
121         ${CCRULE}
122
123 db_alloc.o: ${BUDB}/db_alloc.c
124         ${CCRULE}
125
126 db_dump.o: ${BUDB}/db_dump.c
127         ${CCRULE}
128
129 dbs_dump.o: ${BUDB}/dbs_dump.c
130         ${CCRULE}
131
132 db_lock.o:  ${BUDB}/db_lock.c
133         ${CCRULE}
134
135 db_text.o:  ${BUDB}/db_text.c
136         ${CCRULE}
137
138 db_hash.o: ${BUDB}/db_hash.c
139         ${CCRULE}
140
141 ol_verify.o: ${BUDB}/ol_verify.c
142         ${CCRULE}
143
144 procs.o: ${BUDB}/procs.c
145         ${CCRULE}
146
147 struct_ops.o: ${BUDB}/struct_ops.c
148         ${CCRULE}
149
150 server.o: ${BUDB}/server.c
151         ${CCRULE}
152
153
154 budb_server: $(SERVER_OBJS) ${LIBS}
155         ${CC} ${LDFLAGS} -o budb_server $(SERVER_OBJS) ${LIBS} ${MT_LIBS} ${XLIBS}
156
157 budb.cs.c: ${BUDB}/budb.rg
158         ${RXGEN} -u -C -o $@ ${BUDB}/budb.rg
159
160 budb.ss.c: ${BUDB}/budb.rg
161         ${RXGEN} -S -o $@ ${BUDB}/budb.rg
162
163 budb.xdr.c: ${BUDB}/budb.rg
164         ${RXGEN} -c -o $@ ${BUDB}/budb.rg
165
166 budb.h: ${BUDB}/budb.rg
167         ${RXGEN} -u -h -o $@ ${BUDB}/budb.rg
168
169 budb.cs.c: budb.h
170 budb.xdr.c: budb.h
171 budb.ss.c: budb.h
172
173 libbudb.a: budb_errs.o budb.cs.o budb.xdr.o struct_ops.o AFS_component_version_number.o
174         -$(RM) -f $@
175         $(AR) crv $@ budb_errs.o budb.cs.o budb.xdr.o struct_ops.o AFS_component_version_number.o
176         $(RANLIB) $@
177
178 #
179 # Install targets
180 #
181 install: \
182         ${DESTDIR}${afssrvlibexecdir}/buserver
183
184 ${DEST}/root.server/usr/afs/bin/buserver: budb_server
185         ${INSTALL} -f $? $@
186
187 #
188 # Misc targets
189 #
190 clean:
191         $(RM) -f *.o *~ budb_errs.[ch] budb.h budb_client.h *.a *.xdr.c \
192                 *.ss.c *.cs.c core budb_server AFS_component_version_number.c
193
194 include ../config/Makefile.version
195 ${DESTDIR}${afssrvlibexecdir}/buserver: budb_server
196         ${INSTALL} -f $? $@
197
198 dest: \
199         ${DEST}/root.server/usr/afs/bin/buserver
200