114a3049971b6fda9258448b985054756af2a9ea
[openafs.git] / src / vol / 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 # Portions Copyright (c) 2003 Apple Computer, Inc.
9
10 srcdir=@srcdir@
11 include @TOP_OBJDIR@/src/config/Makefile.config
12 HELPER_SPLINT=@HELPER_SPLINT@
13
14
15 LIBS=${TOP_LIBDIR}/libcmd.a vlib.a ${TOP_LIBDIR}/util.a \
16         ${TOP_LIBDIR}/libsys.a ${TOP_LIBDIR}/libdir.a \
17         ${TOP_LIBDIR}/liblwp.a  ${TOP_LIBDIR}/libacl.a
18
19 CFLAGS = ${COMMON_CFLAGS} -D${SYS_NAME} ${FSINCLUDES} ${XCFLAGS} ${ARCHFLAGS}
20
21 PUBLICHEADERS=nfs.h vnode.h viceinode.h volume.h voldefs.h partition.h\
22         fssync.h ihandle.h namei_ops.h
23
24 VLIBOBJS=vnode.o volume.o vutil.o partition.o fssync.o purge.o \
25          clone.o nuke.o devname.o listinodes.o common.o ihandle.o \
26          namei_ops.o
27
28 OBJECTS=${VLIBOBJS} physio.o vol-salvage.o vol-info.o vol-dump.o vol-bless.o
29
30 all: gi \
31         ${TOP_LIBDIR}/vlib.a \
32         ${TOP_LIBDIR}/libvlib.a \
33         salvager \
34         volinfo \
35         $(FS_CONV_OSF40D) \
36         $(XFS_SIZE_CHECK) \
37         $(FS_CONV_SOL26) \
38         ${TOP_INCDIR}/afs/nfs.h \
39         ${TOP_INCDIR}/afs/vnode.h \
40         ${TOP_INCDIR}/afs/viceinode.h \
41         ${TOP_INCDIR}/afs/volume.h \
42         ${TOP_INCDIR}/afs/voldefs.h \
43         ${TOP_INCDIR}/afs/partition.h \
44         ${TOP_INCDIR}/afs/fssync.h \
45         ${TOP_INCDIR}/afs/ihandle.h \
46         ${TOP_INCDIR}/afs/namei_ops.h
47
48 #
49 # Installation targets
50 #
51 install: \
52         ${DESTDIR}${libdir}/afs/vlib.a \
53         ${DESTDIR}${libdir}/afs/libvlib.a \
54         ${DESTDIR}${afssrvlibexecdir}/salvager \
55         ${DESTDIR}${afssrvsbindir}/volinfo \
56         $(install_FS_CONV_OSF40D) \
57         $(install_XFS_SIZE_CHECK) \
58         $(install_FS_CONV_SOL26) \
59         ${DESTDIR}${includedir}/afs/nfs.h \
60         ${DESTDIR}${includedir}/afs/vnode.h \
61         ${DESTDIR}${includedir}/afs/viceinode.h \
62         ${DESTDIR}${includedir}/afs/volume.h \
63         ${DESTDIR}${includedir}/afs/voldefs.h \
64         ${DESTDIR}${includedir}/afs/partition.h \
65         ${DESTDIR}${includedir}/afs/fssync.h \
66         ${DESTDIR}${includedir}/afs/ihandle.h \
67         ${DESTDIR}${includedir}/afs/namei_ops.h
68
69 ${DEST}/root.server/usr/afs/bin/salvager: salvager 
70         ${INSTALL} -s $? $@
71
72 ${DEST}/root.server/usr/afs/bin/volinfo: volinfo
73         ${INSTALL} -s $? $@
74
75 ${DEST}/lib/afs/vlib.a: vlib.a
76         ${INSTALL} $? $@
77
78 ${DEST}/lib/afs/libvlib.a: vlib.a
79         ${INSTALL} $? $@
80
81 ${DESTDIR}${afssrvsbindir}/fs_conv_dux40D:  fs_conv_dux40D
82         ${INSTALL} -s $? $@
83
84 ${DESTDIR}${afssrvsbindir}/xfs_size_check:  xfs_size_check
85         ${INSTALL} -s $? $@
86
87 ${DESTDIR}${afssrvsbindir}/fs_conv_sol26:  fs_conv_sol26
88         ${INSTALL} -s $? $@
89
90 $(DEST)/root.server/usr/afs/bin/fs_conv_dux40D:  fs_conv_dux40D
91         ${INSTALL} -s $? $@
92
93 $(DEST)/root.server/usr/afs/bin/xfs_size_check:  xfs_size_check
94         ${INSTALL} -s $? $@
95
96 $(DEST)/root.server/usr/afs/bin/fs_conv_sol26:  fs_conv_sol26
97         ${INSTALL} -s $? $@
98
99 ${DEST}/include/afs/nfs.h: nfs.h
100         ${INSTALL} $? $@
101
102 ${DEST}/include/afs/vnode.h: vnode.h
103         ${INSTALL} $? $@
104
105 ${DEST}/include/afs/viceinode.h: viceinode.h
106         ${INSTALL} $? $@
107
108 ${DEST}/include/afs/volume.h: volume.h
109         ${INSTALL} $? $@
110
111 ${DEST}/include/afs/voldefs.h: voldefs.h
112         ${INSTALL} $? $@
113
114 ${DEST}/include/afs/partition.h: partition.h
115         ${INSTALL} $? $@
116
117 ${DEST}/include/afs/fssync.h: fssync.h
118         ${INSTALL} $? $@
119
120 ${DEST}/include/afs/ihandle.h: ihandle.h
121         ${INSTALL} $? $@
122
123 ${DEST}/include/afs/namei_ops.h: namei_ops.h
124         ${INSTALL} $? $@
125
126 #
127 # Build targets
128 #
129 ${OBJECTS}: ${PUBLICHEADERS} ${TOP_INCDIR}/lwp.h ${TOP_INCDIR}/lock.h ${TOP_INCDIR}/afs/afsint.h vutils.h salvage.h AFS_component_version_number.c
130
131 vol-salvage.o vutil.o: volinodes.h
132
133 vlib.a: ${VLIBOBJS} AFS_component_version_number.o
134         $(RM) -f $@
135         $(AR) crv $@ ${VLIBOBJS} AFS_component_version_number.o
136         $(RANLIB) $@
137
138 # new salvager:  remove references to /vice by linking with novice.o
139 salvager: vol-salvage.o physio.o vlib.a
140         ${CC} ${LDFLAGS} -o salvager vol-salvage.o physio.o ${LIBS} ${XLIBS}
141
142 vol-salvage: vol-salvage.o
143 vol-info: vol-info.o physio.o ihandle.o
144
145 listinodes.o: listinodes.c AFS_component_version_number.c
146         case ${SYS_NAME} in                             \
147                 hp?00_ux101 | hp_ux10? )                \
148                         ${CC} ${CFLAGS} -D_FILE64 -c ${srcdir}/listinodes.c \
149                                 ;;                      \
150                 hp_ux11* )              \
151                         ${CC} ${CFLAGS} -D_FILE_OFFSET_BITS=64 -c ${srcdir}/listinodes.c \
152                                 ;;                      \
153                 * )     ${CC} ${CFLAGS} -c ${srcdir}/listinodes.c \
154                                 ;;                      \
155         esac
156
157 gi: ${TOP_LIBDIR}/libsys.a 
158         case ${SYS_NAME} in \
159                 *linux* | sgi_* | *fbsd* ) \
160                         echo "Don't build gi on ${SYS_NAME}";; \
161                 *) \
162                         ${CC} ${CFLAGS} -c ${srcdir}/gi.c ; \
163                         ${CC} ${LDFLAGS} -o gi gi.o ${TOP_LIBDIR}/libsys.a;; \
164         esac
165
166 volinfo: vol-info.o physio.o ihandle.o ${LIBS}
167         ${CC} ${CFLAGS} -o volinfo vol-info.o physio.o \
168                 ihandle.o ${LIBS} ${XLIBS}
169
170 vol-bless: vol-bless.o physio.o ihandle.o ${LIBS}
171         ${CC} ${CFLAGS} -o vol-bless vol-bless.o physio.o ${LIBS} ${XLIBS}
172
173 fs_conv_dux40D: fs_conv_411.o
174         ${CC} ${CFLAGS} ${TOP_LIBDIR}/libcmd.a -o fs_conv_dux40D fs_conv_411.o  ${LIBS} ${XLIBS}
175
176 fs_conv_sol26: fs_conv_411.o vlib.a 
177         ${CC} ${CFLAGS} ${TOP_LIBDIR}/libcmd.a -o fs_conv_sol26 fs_conv_411.o  ${LIBS} ${XLIBS}
178
179 fs_conv_411.o: fs_conv_411.c AFS_component_version_number.c
180         ${CC} ${CFLAGS} -c ${srcdir}/fs_conv_411.c
181
182 xfs_size_check: xfs_size_check.c
183         ${CC} ${CFLAGS} -o xfs_size_check ${srcdir}/xfs_size_check.c
184
185 #
186 # Misc. targets
187 #
188 clean:
189         $(RM) -f *.o *.a AFS_component_version_number.c
190         $(RM) -f ${SCMPROGS} ${STAGEPROGS} core salvager volinfo gi fs_conv_sol26 fs_conv_dux40D
191
192 test:
193         cd test; $(MAKE)
194
195 include ../config/Makefile.version
196 ${DESTDIR}${libdir}/afs/vlib.a: vlib.a
197         ${INSTALL} $? $@
198
199 ${TOP_LIBDIR}/vlib.a: vlib.a
200         ${INSTALL} $? $@
201
202 ${DESTDIR}${libdir}/afs/libvlib.a: vlib.a
203         ${INSTALL} $? $@
204
205 ${TOP_LIBDIR}/libvlib.a: vlib.a
206         ${INSTALL} $? $@
207
208 ${DESTDIR}${afssrvlibexecdir}/salvager: salvager
209         ${INSTALL} -s $? $@
210
211 ${DESTDIR}${afssrvsbindir}/volinfo: volinfo
212         ${INSTALL} -s $? $@
213
214 ${DESTDIR}${includedir}/afs/nfs.h: nfs.h
215         ${INSTALL} $? $@
216
217 ${TOP_INCDIR}/afs/nfs.h: nfs.h
218         ${INSTALL} $? $@
219
220 ${DESTDIR}${includedir}/afs/vnode.h: vnode.h
221         ${INSTALL} $? $@
222
223 ${TOP_INCDIR}/afs/vnode.h: vnode.h
224         ${INSTALL} $? $@
225
226 ${DESTDIR}${includedir}/afs/viceinode.h: viceinode.h
227         ${INSTALL} $? $@
228
229 ${TOP_INCDIR}/afs/viceinode.h: viceinode.h
230         ${INSTALL} $? $@
231
232 ${DESTDIR}${includedir}/afs/volume.h: volume.h
233         ${INSTALL} $? $@
234
235 ${TOP_INCDIR}/afs/volume.h: volume.h
236         ${INSTALL} $? $@
237
238 ${DESTDIR}${includedir}/afs/voldefs.h: voldefs.h
239         ${INSTALL} $? $@
240
241 ${TOP_INCDIR}/afs/voldefs.h: voldefs.h
242         ${INSTALL} $? $@
243
244 ${DESTDIR}${includedir}/afs/partition.h: partition.h
245         ${INSTALL} $? $@
246
247 ${TOP_INCDIR}/afs/partition.h: partition.h
248         ${INSTALL} $? $@
249
250 ${DESTDIR}${includedir}/afs/fssync.h: fssync.h
251         ${INSTALL} $? $@
252
253 ${TOP_INCDIR}/afs/fssync.h: fssync.h
254         ${INSTALL} $? $@
255
256 ${DESTDIR}${includedir}/afs/ihandle.h: ihandle.h
257         ${INSTALL} $? $@
258
259 ${TOP_INCDIR}/afs/ihandle.h: ihandle.h
260         ${INSTALL} $? $@
261
262 ${DESTDIR}${includedir}/afs/namei_ops.h: namei_ops.h
263         ${INSTALL} $? $@
264
265 ${TOP_INCDIR}/afs/namei_ops.h: namei_ops.h
266         ${INSTALL} $? $@
267
268 dest: \
269         ${DEST}/lib/afs/vlib.a \
270         ${DEST}/lib/afs/libvlib.a \
271         ${DEST}/root.server/usr/afs/bin/salvager \
272         ${DEST}/root.server/usr/afs/bin/volinfo \
273         $(dest_FS_CONV_OSF40D) \
274         $(dest_XFS_SIZE_CHECK) \
275         $(dest_FS_CONV_SOL26) \
276         ${DEST}/include/afs/nfs.h \
277         ${DEST}/include/afs/vnode.h \
278         ${DEST}/include/afs/viceinode.h \
279         ${DEST}/include/afs/volume.h \
280         ${DEST}/include/afs/voldefs.h \
281         ${DEST}/include/afs/partition.h \
282         ${DEST}/include/afs/fssync.h \
283         ${DEST}/include/afs/ihandle.h \
284         ${DEST}/include/afs/namei_ops.h
285
286 check-splint::
287         sh $(HELPER_SPLINT) $(CFLAGS) \
288             vnode.c volume.c vutil.c partition.c fssync.c purge.c \
289             clone.c nuke.c devname.c listinodes.c common.c ihandle.c \
290             namei_ops.c \
291             physio.c vol-salvage.c vol-info.c vol-bless.c