sgi_65-compilation-patches-20010131
[openafs.git] / src / vol / Makefile
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 SHELL=/bin/sh
9 COMPONENT=vol
10 include ../config/Makefile.${SYS_NAME}
11 include ../config/Makefile.version
12
13 INCDIRS= -I. -I${DESTDIR}include ${FSINCLUDES}
14 INSTALL = ${SRCDIR}bin/install
15 LDFLAGS = ${OPTMZ} ${PROF} ${LDIRS} ${XLDFLAGS}
16
17 LIBS= ${DESTDIR}lib/afs/libcmd.a vlib.a ${SRCDIR}lib/afs/util.a \
18         ${DESTDIR}lib/afs/libsys.a ${DESTDIR}lib/afs/libdir.a \
19         ${DESTDIR}lib/liblwp.a  ${DESTDIR}lib/afs/libacl.a ${XLIBS}
20
21 CFLAGS = -D${SYS_NAME} ${OPTMZ} ${INCDIRS} ${XCFLAGS} ${DBG} ${DBG_DEFS}
22
23 PROGS = salvager volinfo
24
25 PUBLICHEADERS=nfs.h vnode.h viceinode.h volume.h voldefs.h partition.h\
26         fssync.h ihandle.h namei_ops.h
27
28 VLIBOBJS=vnode.o volume.o vutil.o partition.o fssync.o purge.o \
29          clone.o nuke.o devname.o listinodes.o common.o ihandle.o \
30          namei_ops.o
31
32
33 OBJECTS=${VLIBOBJS} physio.o vol-salvage.o vol-info.o 
34
35 all:    ${DESTDIR}lib/afs/vlib.a \
36         ${DESTDIR}root.server/usr/afs/bin/salvager \
37         ${DESTDIR}root.server/usr/afs/bin/volinfo \
38         gi
39
40 system: install
41
42 kinstall ukinstall webinstall:
43         @echo No kernel source here.
44
45 ${DESTDIR}root.server/usr/afs/bin/salvager: salvager 
46         ${INSTALL} -s $? $@
47
48 ${DESTDIR}root.server/usr/afs/bin/volinfo: volinfo
49         ${INSTALL} -s $? $@
50
51 ${DESTDIR}lib/afs/vlib.a: vlib.a
52         ${INSTALL} $? $@
53
54 $(DESTDIR)root.server/usr/afs/bin/fs_conv_dux40D:  fs_conv_dux40D
55            ${INSTALL} -s $? $@
56
57 $(DESTDIR)root.server/usr/afs/bin/xfs_size_check:  xfs_size_check
58            ${INSTALL} -s $? $@
59
60 $(DESTDIR)root.server/usr/afs/bin/fs_conv_sol26:  fs_conv_sol26
61            ${INSTALL} -s $? $@
62
63 install: all $(FS_CONV_OSF40D) $(XFS_SIZE_CHECK) $(FS_CONV_SOL26)
64         ${INSTALL} ${PUBLICHEADERS} ${DESTDIR}include/afs
65
66
67 ${OBJECTS}: ${PUBLICHEADERS} ${SRCDIR}include/lwp.h ${SRCDIR}include/lock.h \
68          ${SRCDIR}include/afs/afsint.h vutils.h salvage.h\
69         AFS_component_version_number.c
70
71 vol-salvage.o vutil.o: volinodes.h
72
73 vlib.a: ${VLIBOBJS} AFS_component_version_number.o
74         rm -f vlib.a
75         $(AR) r vlib.a ${VLIBOBJS} AFS_component_version_number.o
76         $(RANLIB) vlib.a
77
78 # new salvager:  remove references to /vice by linking with novice.o
79 salvager: vol-salvage.o physio.o vlib.a
80         case ${SYS_NAME} in \
81                 *linux* ) \
82                         ${CC} ${LDFLAGS} -o salvager vol-salvage.o physio.o \
83                                 ${LIBS}  ;; \
84                 *) \
85                         ${CC} ${LDFLAGS} -o salvager vol-salvage.o physio.o \
86                                 ${LIBS};; \
87         esac
88
89 vol-salvage: vol-salvage.o
90 vol-info: vol-info.o physio.o ihandle.o
91
92 listinodes.o: listinodes.c AFS_component_version_number.c
93         case ${SYS_NAME} in                             \
94                 hp?00_ux101 | hp_ux10? )                \
95                         ${CC} ${CFLAGS} -D_FILE64 -c listinodes.c \
96                                 ;;                      \
97                 * )     ${CC} ${CFLAGS} -c listinodes.c \
98                                 ;;                      \
99         esac
100
101 gi: ${DESTDIR}/lib/afs/libsys.a
102         case ${SYS_NAME} in \
103                 *linux* | sgi_* ) \
104                         echo "Don't build gi on ${SYS_NAME}";; \
105                 *) \
106                         ${CC} ${CFLAGS} -c gi.c ; \
107                         ${CC} ${LDFLAGS} -o gi gi.o ${DESTDIR}/lib/afs/libsys.a;; \
108         esac
109
110 volinfo: vol-info.o physio.o ihandle.o
111         case ${SYS_NAME} in \
112                 *linux*) \
113                         ${CC} ${CFLAGS} ${DBG} -o volinfo vol-info.o physio.o \
114                                 ihandle.o ${LIBS}  ;; \
115                 *) \
116                         ${CC} ${CFLAGS} ${DBG} -o volinfo vol-info.o physio.o \
117                                  ihandle.o ${LIBS} ;; \
118         esac
119
120
121 fs_conv_dux40D: fs_conv_411.o
122         ${CC} ${CFLAGS} ${DESTDIR}lib/afs/libcmd.a -o fs_conv_dux40D fs_conv_411.o  ${LIBS} 
123
124 fs_conv_sol26: fs_conv_411.o vlib.a 
125         ${CC} ${CFLAGS} ${DESTDIR}lib/afs/libcmd.a -o fs_conv_sol26 fs_conv_411.o  ${LIBS} 
126
127 fs_conv_411.o: fs_conv_411.c AFS_component_version_number.c
128         ${CC} ${CFLAGS} -c fs_conv_411.c
129
130 xfs_size_check: xfs_size_check.c
131         ${CC} ${CFLAGS} -o xfs_size_check xfs_size_check.c
132
133 clean:
134         rm -f *.o *.a AFS_component_version_number.c
135         rm -f ${SCMPROGS} ${STAGEPROGS} core
136
137 beancount:
138         wc -l *.c *.h
139
140 test:
141         cd test; $(MAKE)