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