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