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