Tidy the vol directory
[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_DATA} nfs.h ${DESTDIR}${includedir}/afs/nfs.h
123         ${INSTALL_DATA} vnode.h ${DESTDIR}${includedir}/afs/vnode.h
124         ${INSTALL_DATA} vnode_inline.h ${DESTDIR}${includedir}/afs/vnode_inline.h
125         ${INSTALL_DATA} viceinode.h ${DESTDIR}${includedir}/afs/viceinode.h
126         ${INSTALL_DATA} volume.h ${DESTDIR}${includedir}/afs/volume.h
127         ${INSTALL_DATA} volume_inline.h ${DESTDIR}${includedir}/afs/volume_inline.h
128         ${INSTALL_DATA} voldefs.h ${DESTDIR}${includedir}/afs/voldefs.h
129         ${INSTALL_DATA} partition.h ${DESTDIR}${includedir}/afs/partition.h
130         ${INSTALL_DATA} fssync.h ${DESTDIR}${includedir}/afs/fssync.h
131         ${INSTALL_DATA} salvsync.h ${DESTDIR}${includedir}/afs/salvsync.h
132         ${INSTALL_DATA} daemon_com.h ${DESTDIR}${includedir}/afs/daemon_com.h
133         ${INSTALL_DATA} ihandle.h ${DESTDIR}${includedir}/afs/ihandle.h
134         ${INSTALL_DATA} namei_ops.h ${DESTDIR}${includedir}/afs/namei_ops.h
135         set -x; if test "@DEMAND_ATTACH@" = "no" ; then \
136                 ${INSTALL_PROGRAM} fssync-debug \
137                         ${DESTDIR}${afssrvsbindir}/fssync-debug ; \
138         fi
139         set -x; if test x"$(install_XFS_SIZE_CHECK)" != x"" ; then \
140                 ${INSTALL_PROGRAM} xfs_size_check \
141                         ${DESTDIR}${afssrvsbindir}/xfs_size_check ; \
142         fi
143
144 dest: vlib.a salvager volinfo fssync-debug
145         ${INSTALL} -d ${DEST}/lib/afs
146         ${INSTALL} -d ${DEST}/root.server/usr/afs/bin
147         ${INSTALL} -d ${DEST}/include/afs
148         ${INSTALL_DATA} vlib.a ${DEST}/lib/afs/vlib.a
149         ${INSTALL_DATA} vlib.a ${DEST}/lib/afs/libvlib.a
150         ${INSTALL_PROGRAM} salvager ${DEST}/root.server/usr/afs/bin/salvager
151         ${INSTALL_PROGRAM} volinfo ${DEST}/root.server/usr/afs/bin/volinfo
152         ${INSTALL_DATA} nfs.h ${DEST}/include/afs/nfs.h
153         ${INSTALL_DATA} vnode.h ${DEST}/include/afs/vnode.h
154         ${INSTALL_DATA} vnode_inline.h ${DEST}/include/afs/vnode_inline.h
155         ${INSTALL_DATA} viceinode.h ${DEST}/include/afs/viceinode.h
156         ${INSTALL_DATA} volume.h ${DEST}/include/afs/volume.h
157         ${INSTALL_DATA} volume_inline.h ${DEST}/include/afs/volume_inline.h
158         ${INSTALL_DATA} voldefs.h ${DEST}/include/afs/voldefs.h
159         ${INSTALL_DATA} partition.h ${DEST}/include/afs/partition.h
160         ${INSTALL_DATA} fssync.h ${DEST}/include/afs/fssync.h
161         ${INSTALL_DATA} salvsync.h ${DEST}/include/afs/salvsync.h
162         ${INSTALL_DATA} daemon_com.h ${DEST}/include/afs/daemon_com.h
163         ${INSTALL_DATA} ihandle.h ${DEST}/include/afs/ihandle.h
164         ${INSTALL_DATA} namei_ops.h ${DEST}/include/afs/namei_ops.h
165         set -x; if test "@DEMAND_ATTACH@" = "no" ; then \
166                 ${INSTALL_PROGRAM} fssync-debug \
167                         ${DEST}/root.server/usr/afs/bin/fssync-debug ; \
168         fi
169         set -x; if test x"$(install_XFS_SIZE_CHECK)" != x"" ; then \
170                 ${INSTALL_PROGRAM} xfs_size_check \
171                         $(DEST)/root.server/usr/afs/bin/xfs_size_check ; \
172         fi
173
174 #
175 # Build targets
176 #
177 ${OBJECTS}: ${PUBLICHEADERS} ${TOP_INCDIR}/lwp.h ${TOP_INCDIR}/lock.h ${TOP_INCDIR}/afs/afsint.h vutils.h salvage.h AFS_component_version_number.c
178
179 vol-salvage.o vutil.o: volinodes.h
180 vol-salvage.o salvager.o: vol-salvage.h
181 vol-salvage.o: salvsync.h daemon_com.h
182
183 vlib.a: ${VLIBOBJS} AFS_component_version_number.o
184         $(RM) -f $@
185         $(AR) crv $@ ${VLIBOBJS} AFS_component_version_number.o
186         $(RANLIB) $@
187
188 # new salvager:  remove references to /vice by linking with novice.o
189 salvager: vol-salvage.o physio.o vlib.a salvager.o ${LIBS}
190         ${CC} ${LDFLAGS} -o salvager vol-salvage.o physio.o salvager.o ${LIBS} ${XLIBS}
191
192 vol-salvage: vol-salvage.o
193 vol-info: vol-info.o physio.o ihandle.o
194
195 listinodes.o: listinodes.c AFS_component_version_number.c
196         case ${SYS_NAME} in                             \
197                 hp?00_ux101 | hp_ux10? )                \
198                         ${CC} ${CFLAGS} -D_FILE64 -c ${srcdir}/listinodes.c \
199                                 ;;                      \
200                 hp_ux11* )              \
201                         ${CC} ${CFLAGS} -D_FILE_OFFSET_BITS=64 -c ${srcdir}/listinodes.c \
202                                 ;;                      \
203                 * )     ${CC} ${CFLAGS} -c ${srcdir}/listinodes.c \
204                                 ;;                      \
205         esac
206
207 gi: ${TOP_LIBDIR}/libsys.a 
208         case ${SYS_NAME} in \
209                 *linux* | sgi_* | *fbsd* ) \
210                         echo "Don't build gi on ${SYS_NAME}";; \
211                 *) \
212                         ${CC} ${CFLAGS} -c ${srcdir}/gi.c ; \
213                         ${CC} ${LDFLAGS} -o gi gi.o ${TOP_LIBDIR}/libsys.a;; \
214         esac
215
216 namei_map: ${TOP_LIBDIR}/libsys.a namei_map.o
217         ${CC} ${CFLAGS} -o namei_map namei_map.o ${TOP_LIBDIR}/libafsutil.a ${LIBS} ${XLIBS}
218
219 volinfo: vol-info.o physio.o ihandle.o ${LIBS}
220         ${CC} ${CFLAGS} -o volinfo vol-info.o physio.o \
221                 ihandle.o ${LIBS} ${XLIBS}
222
223 fssync-debug: fssync-debug.o physio.o AFS_component_version_number.c ${LIBS}
224         ${CC} ${LDFLAGS} -o fssync-debug fssync-debug.o physio.o ${LIBS} ${XLIBS}
225
226 vol-bless: vol-bless.o physio.o ihandle.o ${LIBS}
227         ${CC} ${CFLAGS} -o vol-bless vol-bless.o physio.o ${LIBS} ${XLIBS}
228
229 xfs_size_check: xfs_size_check.c
230         ${CC} ${CFLAGS} -o xfs_size_check ${srcdir}/xfs_size_check.c
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
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