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