DEVEL15-vol-split-nearino-20090324
[openafs.git] / src / volser / 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 HELPER_SPLINT=@HELPER_SPLINT@
11
12
13 VINCLS=${TOP_INCDIR}/afs/partition.h ${TOP_INCDIR}/afs/volume.h \
14         ${TOP_INCDIR}/afs/vlserver.h vol.h dump.h volser.h  lockdata.h
15
16 RINCLS=${TOP_INCDIR}/rx/rx.h ${TOP_INCDIR}/rx/xdr.h \
17        ${TOP_INCDIR}/afs/keys.h ${TOP_INCDIR}/afs/cellconfig.h \
18         ${TOP_INCDIR}/ubik.h ${TOP_INCDIR}/afs/cmd.h
19
20 INTINCLS=volint.h volser.h 
21
22 LIBS=\
23         ${TOP_LIBDIR}/libaudit.a \
24         ${TOP_LIBDIR}/vlib.a \
25         ${TOP_LIBDIR}/libacl.a \
26         ${TOP_LIBDIR}/libsys.a \
27         ${TOP_LIBDIR}/libvldb.a \
28         ${TOP_LIBDIR}/libubik.a \
29         ${TOP_LIBDIR}/libauth.a \
30         ${TOP_LIBDIR}/libcmd.a \
31         ${TOP_LIBDIR}/librxkad.a \
32         ${TOP_LIBDIR}/libdes.a \
33         ${TOP_LIBDIR}/librxstat.a \
34         ${TOP_LIBDIR}/librx.a \
35         ${TOP_LIBDIR}/liblwp.a \
36         ${TOP_LIBDIR}/libsys.a \
37         ${TOP_LIBDIR}/libcom_err.a \
38         ${TOP_LIBDIR}/libkauth.a \
39         ${TOP_LIBDIR}/libusd.a \
40         ${TOP_LIBDIR}/util.a
41
42 VOLDUMP_LIBS = \
43         ../vol/ihandle.o \
44         ../vol/physio.o \
45         ../vol/vlib.a \
46         ${TOP_LIBDIR}/libcmd.a \
47         ${TOP_LIBDIR}/util.a \
48         ${TOP_LIBDIR}/libsys.a \
49         ${TOP_LIBDIR}/libdir.a \
50         ${TOP_LIBDIR}/liblwp.a  \
51         ${TOP_LIBDIR}/libacl.a
52
53 VSOBJS=vsprocs.o vsutils.o lockprocs.o volint.xdr.o volerr.o 
54 SOBJS=volmain.o volprocs.o physio.o common.o voltrans.o volerr.o \
55  volint.cs.o dumpstuff.o volint.ss.o volint.xdr.o vol_split.o
56
57 all: volserver vos restorevol voldump \
58         ${TOP_INCDIR}/afs/volser.h \
59         ${TOP_INCDIR}/afs/vsutils_prototypes.h \
60         ${TOP_INCDIR}/afs/volint.h \
61         ${TOP_LIBDIR}/libvolser.a
62
63 restorevol: restorevol.c
64         ${CC} ${CFLAGS} -o restorevol ${srcdir}/restorevol.c \
65                 ${TOP_LIBDIR}/libcmd.a ${TOP_LIBDIR}/util.a ${XLIBS}
66
67 vos: vos.o ${VSOBJS} libvolser.a ${LIBS}
68         ${CC} ${LDFLAGS} -o vos vos.o $(VSOBJS) libvolser.a ${LIBS} ${XLIBS}
69
70 volserver: $(SOBJS) $(LIBS) ${TOP_LIBDIR}/libdir.a
71         ${CC} ${DBUG} -o volserver $(SOBJS) ${TOP_LIBDIR}/libdir.a \
72                 ${LDFLAGS} $(LIBS) ${XLIBS}
73
74 voldump: vol-dump.o ${VOLDUMP_LIBS}
75         ${CC} ${CFLAGS} -o voldump vol-dump.o ${VOLDUMP_LIBS} ${XLIBS}
76
77 libvolser.a: volint.cs.o  $(VSOBJS) volint.ss.o AFS_component_version_number.o
78         -$(RM) -f $@
79         $(AR) crv $@ volint.cs.o $(VSOBJS) volint.ss.o AFS_component_version_number.o 
80         $(RANLIB) $@
81
82 volser.h volerr.c: volerr.et volser.p.h
83         $(RM) -f volser.h volerr.c
84         ${COMPILE_ET} -p ${srcdir} volerr -h volser
85
86 volint.cs.c: volint.xg
87         ${RXGEN} -A -x -C -o $@ ${srcdir}/volint.xg
88
89 volint.ss.c: volint.xg
90         ${RXGEN} -A -x -S -o $@ ${srcdir}/volint.xg
91
92 volint.xdr.c: volint.xg
93         ${RXGEN} -A -x -c -o $@ ${srcdir}/volint.xg
94
95 volint.h: volint.xg
96         ${RXGEN} -A -x -h -o $@ ${srcdir}/volint.xg
97
98 volint.cs.c: volint.h
99 volint.ss.c: volint.h
100 volint.xdr.c: volint.h
101
102 #
103 # Dependencies
104 #
105 volint.cs.o: volint.cs.c ${INTINCLS}
106 volint.ss.o: volint.ss.c ${INTINCLS}
107 volint.xdr.o: volint.xdr.c ${INTINCLS}
108 vsutils.o: vsutils.c ${VINCLS} ${RINCLS} ${INTINCLS}
109 volmain.o: volmain.c ${VINCLS} ${RINCLS} AFS_component_version_number.c
110 volprocs.o: volprocs.c ${VINCLS} ${RINCLS} ${INTINCLS}
111 dumpstuff.o: dumpstuff.c ${VINCLS} ${RINCLS} ${INTINCLS}
112 voldump.o: voldump.c ${VINCLS} ${RINCLS}
113 vos.o: vos.c ${VINCLS} ${RINCLS} ${INTINCLS} AFS_component_version_number.c
114 vsprocs.o: vsprocs.c ${VINCLS} ${RINCLS} ${INTINCLS}
115 physio.o: physio.c ${VINCLS}
116 common.o: common.c ${VINCLS}
117 lockprocs.o: lockprocs.c ${VINCLS} ${INTINCLS} ${RINCLS}
118 vol_split.o: vol_split.c ${VINCLS} ${INTINCLS} ${RINCLS}
119
120 #
121 # Installation targets
122 #
123 install: \
124         ${DESTDIR}${sbindir}/restorevol \
125         ${DESTDIR}${sbindir}/voldump \
126         ${DESTDIR}${includedir}/afs/volser.h \
127         ${DESTDIR}${includedir}/afs/volint.h \
128         ${DESTDIR}${sbindir}/vos \
129         ${DESTDIR}${afssrvsbindir}/vos \
130         ${DESTDIR}${afssrvlibexecdir}/volserver \
131         ${DESTDIR}${libdir}/afs/libvolser.a
132
133
134 ${DEST}/include/afs/volser.h: volser.h
135         ${INSTALL} $? $@
136
137 ${DEST}/include/afs/vsutils_prototypes.h: vsutils_prototypes.h
138         ${INSTALL} $? $@
139
140 ${DEST}/include/afs/volint.h: volint.h
141         ${INSTALL} $? $@
142
143 ${DEST}/etc/restorevol: restorevol
144         ${INSTALL} $? $@
145
146 ${DEST}/etc/voldump: voldump
147         ${INSTALL} $? $@
148
149 ${DEST}/etc/vos ${DEST}/root.server/usr/afs/bin/vos: vos
150         ${INSTALL} $? $@
151
152 ${DEST}/lib/afs/libvolser.a: libvolser.a
153         ${INSTALL} $? $@
154
155 ${DEST}/root.server/usr/afs/bin/volserver: volserver
156         @case ${SYS_NAME} in \
157         alpha_dux4*|*linux*|rs_aix*|sgi_6*|sun4x*|sunx86*) \
158         echo "Don't install volserver for ${SYS_NAME}" ;; \
159         *_darwin_[1-6][0-9]) \
160         echo ${INSTALL} -ns $? $@ ; \
161         ${INSTALL} -ns $? $@ ;; \
162         *_darwin_*) \
163         echo "Don't install volserver for ${SYS_NAME}" ;; \
164         *) \
165         echo ${INSTALL} -ns $? $@ ; \
166         ${INSTALL} -ns $? $@ ;; \
167         esac
168
169 #
170 # Misc targets
171
172 clean:
173         $(RM) -f *.o *.a core volserver volint.ss.c volint.cs.c volint.h \
174         volint.xdr.c vos volser.h volerr.c AFS_component_version_number.c restorevol voldump
175
176 include ../config/Makefile.version
177
178 ${DESTDIR}${sbindir}/restorevol: restorevol
179         ${INSTALL} $? $@
180
181 ${DESTDIR}${sbindir}/voldump: voldump
182         ${INSTALL} $? $@
183
184 ${DESTDIR}${includedir}/afs/volser.h: volser.h
185         ${INSTALL} $? $@
186
187 ${TOP_INCDIR}/afs/volser.h: volser.h
188         ${INSTALL} $? $@
189
190 ${DESTDIR}${includedir}/afs/vsutils_prototypes.h: vsutils_prototypes.h
191         ${INSTALL} $? $@
192
193 ${TOP_INCDIR}/afs/vsutils_prototypes.h: vsutils_prototypes.h
194         ${INSTALL} $? $@
195
196 ${DESTDIR}${includedir}/afs/volint.h: volint.h
197         ${INSTALL} $? $@
198
199 ${TOP_INCDIR}/afs/volint.h: volint.h
200         ${INSTALL} $? $@
201
202 ${DESTDIR}${sbindir}/vos: vos
203         ${INSTALL} $? $@
204
205 ${DESTDIR}${afssrvsbindir}/vos: vos
206         ${INSTALL} $? $@
207
208 ${DESTDIR}${afssrvlibexecdir}/volserver: volserver
209         @case ${SYS_NAME} in \
210         alpha_dux4*|*linux*|rs_aix*|sgi_6*|sun4x*|sunx86*) \
211         echo "Don't install volserver for ${SYS_NAME}" ;; \
212         *_darwin_[1-6][0-9]) \
213         echo ${INSTALL} -ns $? $@ ; \
214         ${INSTALL} -ns $? $@ ;; \
215         *_darwin_*) \
216         echo "Don't install volserver for ${SYS_NAME}" ;; \
217         *) \
218         echo ${INSTALL} -ns $? $@ ; \
219         ${INSTALL} -ns $? $@ ;; \
220         esac
221
222 ${DESTDIR}${libdir}/afs/libvolser.a: libvolser.a
223         ${INSTALL} $? $@
224
225 ${TOP_LIBDIR}/libvolser.a: libvolser.a
226         ${INSTALL} $? $@
227
228 dest: \
229         ${DEST}/etc/restorevol \
230         ${DEST}/etc/voldump \
231         ${DEST}/include/afs/volser.h \
232         ${DEST}/include/afs/vsutils_prototypes.h \
233         ${DEST}/include/afs/volint.h \
234         ${DEST}/etc/vos \
235         ${DEST}/root.server/usr/afs/bin/vos \
236         ${DEST}/root.server/usr/afs/bin/volserver \
237         ${DEST}/lib/afs/libvolser.a
238
239
240 check-splint::
241         sh $(HELPER_SPLINT) $(CFLAGS) \
242             vos.c restorevol.c \
243             vsprocs.c vsutils.c lockprocs.c volerr.c \
244             volmain.c volprocs.c physio.c common.c voltrans.c \
245             dumpstuff.c vol_split.c