Build: link libaudit before util
[openafs.git] / src / vlserver / 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.lwp
11
12 ENABLE_PTHREADED_UBIK = @ENABLE_PTHREADED_UBIK@
13
14 INCLS=${TOP_INCDIR}/ubik.h \
15              ${TOP_INCDIR}/lwp.h \
16              ${TOP_INCDIR}/lock.h  \
17              ${TOP_INCDIR}/rx/rx.h \
18              ${TOP_INCDIR}/rx/xdr.h \
19              ${TOP_INCDIR}/afs/keys.h \
20              ${TOP_INCDIR}/afs/cellconfig.h \
21         vlserver.h vldbint.h
22
23 LIBS=\
24         ${TOP_LIBDIR}/libubik.a \
25         ${TOP_LIBDIR}/libauth.a \
26         ${TOP_LIBDIR}/librxkad.a \
27         ${TOP_LIBDIR}/librxstat.a \
28         ${TOP_LIBDIR}/librx.a \
29         ${TOP_LIBDIR}/liblwp.a \
30         ${TOP_LIBDIR}/libafscom_err.a \
31         ${TOP_LIBDIR}/libcmd.a \
32         ${TOP_LIBDIR}/libsys.a \
33         ${TOP_LIBDIR}/libaudit.a \
34         ${TOP_LIBDIR}/libafsutil.a \
35         $(TOP_LIBDIR)/libopr.a \
36         ${TOP_LIBDIR}/libafshcrypto_lwp.a
37
38 OBJS=vldbint.xdr.o vldbint.cs.o vl_errors.o
39
40
41 all: \
42         vlserver vlclient cnvldb vlserver cnvldb vldb_check \
43         Kvldbint.cs.c Kvldbint.xdr.c vldbint.h \
44         ${TOP_LIBDIR}/libvldb.a depinstall
45
46 generated: \
47         vl_errors.c vlserver.h \
48         Kvldbint.cs.c Kvldbint.xdr.c \
49         vldbint.cs.c vldbint.ss.c vldbint.xdr.c vldbint.h
50
51 depinstall: \
52         Kvldbint.cs.c Kvldbint.xdr.c vldbint.h \
53         ${TOP_INCDIR}/afs/vl_opcodes.h \
54         ${TOP_INCDIR}/afs/vlserver.h \
55         ${TOP_INCDIR}/afs/vldbint.h \
56         ${TOP_INCDIR}/afs/cnvldb.h 
57
58 ${TOP_LIBDIR}/libvldb.a: libvldb.a
59         ${INSTALL_DATA} $? $@
60
61 ${TOP_INCDIR}/afs/vl_opcodes.h: vl_opcodes.h
62         ${INSTALL_DATA} $? $@
63
64 ${TOP_INCDIR}/afs/vlserver.h: vlserver.h
65         ${INSTALL_DATA} $? $@
66
67 ${TOP_INCDIR}/afs/vldbint.h: vldbint.h
68         ${INSTALL_DATA} $? $@
69
70 ${TOP_INCDIR}/afs/cnvldb.h: cnvldb.h
71         ${INSTALL_DATA} $? $@
72
73 vldb_check: vldb_check.o ${LIBS}
74         $(AFS_LDRULE) vldb_check.o ${LIBS} $(LIB_roken) ${XLIBS}
75
76 vldb_check.o: vldb_check.c AFS_component_version_number.o
77
78 cnvldb: cnvldb.o ${LIBS}
79         $(AFS_LDRULE) cnvldb.o ${LIBS} $(LIB_roken) ${XLIBS}
80
81 cnvldb.o: cnvldb.c cnvldb.h AFS_component_version_number.o
82
83 sascnvldb: sascnvldb.o ${LIBS}
84         $(AFS_LDRULE) sascnvldb.o ${LIBS} $(LIB_roken) ${XLIBS}
85
86 sascnvldb.o: sascnvldb.c cnvldb.h AFS_component_version_number.o
87
88 vlserver: vlserver.o vlutils.o vlprocs.o vldbint.ss.o vldbint.xdr.o $(LIBS)
89         $(AFS_LDRULE) vlserver.o vlutils.o vlprocs.o vldbint.ss.o \
90                 vldbint.xdr.o \
91                 $(LIBS) $(LIB_roken) ${XLIBS}
92
93 vlserver.o: vlserver.c ${INCLS} AFS_component_version_number.o
94 vlutils.o: vlutils.c ${INCLS}
95 vlprocs.o: vlprocs.c ${INCLS}
96 vldbint.ss.o: vldbint.ss.c vldbint.xdr.c
97 vldbint.cs.o: vldbint.cs.c vldbint.xdr.c
98 vldbint.xdr.o: vldbint.xdr.c vldbint.h
99
100 vldbint.cs.c: vldbint.xg
101         ${RXGEN} -A -u -x -C -o $@ ${srcdir}/vldbint.xg
102
103 vldbint.ss.c: vldbint.xg
104         ${RXGEN} -A -x -S -o $@ ${srcdir}/vldbint.xg
105
106 vldbint.xdr.c: vldbint.xg
107         ${RXGEN} -A -x -c -o $@ ${srcdir}/vldbint.xg
108
109 vldbint.h: vldbint.xg
110         ${RXGEN} -A -u -x -h -o $@ ${srcdir}/vldbint.xg
111
112 vldbint.cs.c: vldbint.h
113 vldbint.ss.c: vldbint.h
114 vldbint.xdr.c: vldbint.h
115
116 Kvldbint.cs.c: vldbint.xg
117         ${RXGEN} -A -x -k -C -o $@ ${srcdir}/vldbint.xg
118
119 Kvldbint.xdr.c: vldbint.xg
120         ${RXGEN} -A -x -k -c -o $@ ${srcdir}/vldbint.xg
121
122 libvldb.a: $(OBJS) AFS_component_version_number.o
123         $(RM) -f $@
124         $(AR) crv $@ $(OBJS) AFS_component_version_number.o
125         $(RANLIB) $@
126
127 vlclient: vlclient.o libvldb.a $(LIBS)
128         $(AFS_LDRULE) vlclient.o libvldb.a \
129                 $(LIBS) ${TOP_LIBDIR}/libcmd.a $(LIB_roken) ${XLIBS}
130
131 vlclient.o: vlclient.c ${INCLS} AFS_component_version_number.o
132
133 vl_errors.o: vl_errors.c
134 vlserver.h vl_errors.c: vl_errors.et vlserver.p.h
135         $(RM) -f vlserver.h vl_errors.c; ${COMPILE_ET} -p ${srcdir} vl_errors -h vlserver
136
137 vlserver.o: vlserver.c
138
139 system: install
140
141 install: vlserver cnvldb vldb_check libvldb.a vl_opcodes.h vlserver.h \
142                 vldbint.h cnvldb.h
143         ${INSTALL} -d ${DESTDIR}${afssrvlibexecdir}
144         ${INSTALL} -d ${DESTDIR}${afssrvsbindir}
145         ${INSTALL} -d ${DESTDIR}${libdir}/afs
146         ${INSTALL} -d ${DESTDIR}${includedir}/afs
147         if [ "x$(ENABLE_PTHREADED_UBIK)" != "xyes" ] ; then \
148                 ${INSTALL_PROGRAM} vlserver ${DESTDIR}${afssrvlibexecdir}/vlserver; \
149                 ${INSTALL_PROGRAM} cnvldb ${DESTDIR}${afssrvsbindir}/vldb_convert; \
150                 ${INSTALL_PROGRAM} vldb_check ${DESTDIR}${afssrvsbindir}/vldb_check; \
151         fi;
152         ${INSTALL_DATA} libvldb.a ${DESTDIR}${libdir}/afs/libvldb.a
153         ${INSTALL_DATA} ${srcdir}/vl_opcodes.h ${DESTDIR}${includedir}/afs/vl_opcodes.h
154         ${INSTALL_DATA} vlserver.h ${DESTDIR}${includedir}/afs/vlserver.h
155         ${INSTALL_DATA} vldbint.h ${DESTDIR}${includedir}/afs/vldbint.h
156         ${INSTALL_DATA} ${srcdir}/cnvldb.h ${DESTDIR}${includedir}/afs/cnvldb.h
157
158 dest: vlserver cnvldb vldb_check libvldb.a vl_opcodes.h vlserver.h \
159                 vldbint.h cnvldb.h
160         ${INSTALL} -d ${DEST}/root.server/usr/afs/bin
161         ${INSTALL} -d ${DEST}/etc
162         ${INSTALL} -d ${DEST}/lib/afs
163         ${INSTALL} -d ${DEST}/include/afs
164         if [ "x$(ENABLE_PTHREADED_UBIK)" != "xyes" ] ; then \
165                 ${INSTALL_PROGRAM} vlserver ${DEST}/root.server/usr/afs/bin/vlserver; \
166                 ${INSTALL_PROGRAM} cnvldb ${DEST}/etc/vldb_convert; \
167                 ${INSTALL_PROGRAM} vldb_check ${DEST}/etc/vldb_check; \
168         fi;
169         ${INSTALL_DATA} libvldb.a ${DEST}/lib/afs/libvldb.a
170         ${INSTALL_DATA} ${srcdir}/vl_opcodes.h ${DEST}/include/afs/vl_opcodes.h
171         ${INSTALL_DATA} vlserver.h ${DEST}/include/afs/vlserver.h
172         ${INSTALL_DATA} vldbint.h ${DEST}/include/afs/vldbint.h
173         ${INSTALL_DATA} ${srcdir}/cnvldb.h ${DEST}/include/afs/cnvldb.h
174
175 #
176 # Misc targets
177 #
178 include ../config/Makefile.version
179
180 clean:
181         $(RM) -f *.o *.a *.otl *.xdr.c *.cs.c *.ss.c core \
182                 vlserver vlclient cnvldb vldbint.h vlserver.h vldb_check \
183                 vl_errors.c AFS_component_version_number.c