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