6e0b920fe9c70753bd44f4fd28c3a0a2fb361a9e
[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
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 #
107 # Installation targets
108 #
109 install: vlib.a salvager volinfo fssync-debug
110         ${INSTALL} -d ${DESTDIR}${libdir}/afs
111         ${INSTALL} -d ${DESTDIR}${afssrvlibexecdir}
112         ${INSTALL} -d ${DESTDIR}${afssrvsbindir}
113         ${INSTALL} -d ${DESTDIR}${includedir}/afs
114         ${INSTALL_DATA} vlib.a ${DESTDIR}${libdir}/afs/vlib.a
115         ${INSTALL_DATA} vlib.a ${DESTDIR}${libdir}/afs/libvlib.a
116         ${INSTALL_PROGRAM} salvager ${DESTDIR}${afssrvlibexecdir}/salvager
117         ${INSTALL_PROGRAM} volinfo ${DESTDIR}${afssrvsbindir}/volinfo
118         ${INSTALL_DATA} nfs.h ${DESTDIR}${includedir}/afs/nfs.h
119         ${INSTALL_DATA} vnode.h ${DESTDIR}${includedir}/afs/vnode.h
120         ${INSTALL_DATA} vnode_inline.h ${DESTDIR}${includedir}/afs/vnode_inline.h
121         ${INSTALL_DATA} viceinode.h ${DESTDIR}${includedir}/afs/viceinode.h
122         ${INSTALL_DATA} volume.h ${DESTDIR}${includedir}/afs/volume.h
123         ${INSTALL_DATA} volume_inline.h ${DESTDIR}${includedir}/afs/volume_inline.h
124         ${INSTALL_DATA} voldefs.h ${DESTDIR}${includedir}/afs/voldefs.h
125         ${INSTALL_DATA} partition.h ${DESTDIR}${includedir}/afs/partition.h
126         ${INSTALL_DATA} fssync.h ${DESTDIR}${includedir}/afs/fssync.h
127         ${INSTALL_DATA} salvsync.h ${DESTDIR}${includedir}/afs/salvsync.h
128         ${INSTALL_DATA} daemon_com.h ${DESTDIR}${includedir}/afs/daemon_com.h
129         ${INSTALL_DATA} ihandle.h ${DESTDIR}${includedir}/afs/ihandle.h
130         ${INSTALL_DATA} namei_ops.h ${DESTDIR}${includedir}/afs/namei_ops.h
131         set -x; if test "@DEMAND_ATTACH@" = "no" ; then \
132                 ${INSTALL_PROGRAM} fssync-debug \
133                         ${DESTDIR}${afssrvsbindir}/fssync-debug ; \
134         fi
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_DATA} nfs.h ${DEST}/include/afs/nfs.h
149         ${INSTALL_DATA} vnode.h ${DEST}/include/afs/vnode.h
150         ${INSTALL_DATA} vnode_inline.h ${DEST}/include/afs/vnode_inline.h
151         ${INSTALL_DATA} viceinode.h ${DEST}/include/afs/viceinode.h
152         ${INSTALL_DATA} volume.h ${DEST}/include/afs/volume.h
153         ${INSTALL_DATA} volume_inline.h ${DEST}/include/afs/volume_inline.h
154         ${INSTALL_DATA} voldefs.h ${DEST}/include/afs/voldefs.h
155         ${INSTALL_DATA} partition.h ${DEST}/include/afs/partition.h
156         ${INSTALL_DATA} fssync.h ${DEST}/include/afs/fssync.h
157         ${INSTALL_DATA} salvsync.h ${DEST}/include/afs/salvsync.h
158         ${INSTALL_DATA} daemon_com.h ${DEST}/include/afs/daemon_com.h
159         ${INSTALL_DATA} ihandle.h ${DEST}/include/afs/ihandle.h
160         ${INSTALL_DATA} namei_ops.h ${DEST}/include/afs/namei_ops.h
161         set -x; if test "@DEMAND_ATTACH@" = "no" ; then \
162                 ${INSTALL_PROGRAM} fssync-debug \
163                         ${DEST}/root.server/usr/afs/bin/fssync-debug ; \
164         fi
165         set -x; if test x"$(install_XFS_SIZE_CHECK)" != x"" ; then \
166                 ${INSTALL_PROGRAM} xfs_size_check \
167                         $(DEST)/root.server/usr/afs/bin/xfs_size_check ; \
168         fi
169
170 #
171 # Build targets
172 #
173 ${OBJECTS}: ${PUBLICHEADERS} ${TOP_INCDIR}/lwp.h ${TOP_INCDIR}/lock.h ${TOP_INCDIR}/afs/afsint.h vutils.h salvage.h AFS_component_version_number.c
174
175 vol-salvage.o vutil.o: volinodes.h
176 vol-salvage.o salvager.o: vol-salvage.h
177 vol-salvage.o: salvsync.h daemon_com.h
178
179 vlib.a: ${VLIBOBJS} AFS_component_version_number.o
180         $(RM) -f $@
181         $(AR) crv $@ ${VLIBOBJS} AFS_component_version_number.o
182         $(RANLIB) $@
183
184 # new salvager:  remove references to /vice by linking with novice.o
185 salvager: vol-salvage.o physio.o vlib.a salvager.o ${LIBS}
186         ${CC} ${LDFLAGS} -o salvager vol-salvage.o physio.o salvager.o ${LIBS} ${XLIBS}
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} ${CFLAGS} -D_FILE64 -c ${srcdir}/listinodes.c \
195                                 ;;                      \
196                 hp_ux11* )              \
197                         ${CC} ${CFLAGS} -D_FILE_OFFSET_BITS=64 -c ${srcdir}/listinodes.c \
198                                 ;;                      \
199                 * )     ${CC} ${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} ${CFLAGS} -c ${srcdir}/gi.c ; \
209                         ${CC} ${LDFLAGS} -o gi gi.o ${TOP_LIBDIR}/libsys.a;; \
210         esac
211
212 namei_map: ${TOP_LIBDIR}/libsys.a namei_map.o
213         ${CC} ${CFLAGS} -o namei_map namei_map.o ${TOP_LIBDIR}/libafsutil.a ${LIBS} ${XLIBS}
214
215 volinfo: vol-info.o physio.o ihandle.o ${LIBS}
216         ${CC} ${CFLAGS} -o volinfo vol-info.o physio.o \
217                 ihandle.o ${LIBS} ${XLIBS}
218
219 fssync-debug: fssync-debug.o physio.o AFS_component_version_number.c ${LIBS}
220         ${CC} ${LDFLAGS} -o fssync-debug fssync-debug.o physio.o ${LIBS} ${XLIBS}
221
222 vol-bless: vol-bless.o physio.o ihandle.o ${LIBS}
223         ${CC} ${CFLAGS} -o vol-bless vol-bless.o physio.o ${LIBS} ${XLIBS}
224
225 xfs_size_check: xfs_size_check.c
226         ${CC} ${CFLAGS} -o xfs_size_check ${srcdir}/xfs_size_check.c
227
228 #
229 # Misc. targets
230 #
231 clean:
232         $(RM) -f *.o *.a AFS_component_version_number.c
233         $(RM) -f ${SCMPROGS} ${STAGEPROGS} core salvager volinfo gi
234
235 test:
236         cd test; $(MAKE)
237
238 include ../config/Makefile.version
239
240 check-splint::
241         sh $(HELPER_SPLINT) $(CFLAGS) \
242             vnode.c volume.c vutil.c partition.c fssync-server.c fssync-client.c \
243             clone.c nuke.c devname.c listinodes.c common.c ihandle.c \
244             namei_ops.c salvsync-server.c salvsync-client.c daemon_com.c purge.c \
245             physio.c vol-salvage.c vol-info.c vol-bless.c fssync-debug.c