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