Refactor afs_NewVCache
[openafs.git] / src / libafs / MakefileProto.SOLARIS.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 srcdir=@srcdir@
9 include @TOP_OBJDIR@/src/config/Makefile.config
10 INSTALL = @INSTALL@
11 INSTALL_DATA = @INSTALL_DATA@
12 INSTALL_PROGRAM = @INSTALL_PROGRAM@
13 INSTALL_SCRIPT = @INSTALL_SCRIPT@
14
15
16 # OS specific object files:
17 AFS_OS_OBJS = \
18         osi_gcpags.o \
19         osi_groups.o \
20         osi_inode.o \
21         osi_file.o \
22         osi_sleep.o \
23         osi_vcache.o \
24         osi_vm.o \
25         osi_vnodeops.o
26
27 AFS_OS_NFSOBJS = \
28         osi_vfsops_nfs.o
29
30 AFS_OS_NONFSOBJS = \
31         osi_vfsops.o
32
33 # System specific build commands and flags
34 DEFINES= -DAFSDEBUG -DKERNEL -DAFS -DVICE -DNFS -DUFS -DINET -DQUOTA -DGETMOUNT
35 #These are redundant
36 #LD = /usr/ccs/bin/ld
37 #LORDER = /usr/ccs/bin/lorder
38 #CC = /opt/SUNWspro/bin/cc
39 KDEFS= -D_KERNEL -DSYSV -dn ${ARCH_DEFS}
40
41 <sun4x_57 sun4x_58 sun4x_59 sun4x_510 sun4x_511>
42 KDEFS_32 = -xarch=v8
43 KDEFS_64 = -xarch=v9 
44
45 <sunx86_57 sunx86_58 sunx86_59 sunx86_510 sunx86_511>
46 KDEFS_32 = 
47 KDEFS_64 = -xarch=amd64 -xmodel=kernel
48
49 <all>
50 CFLAGS=-I. -I.. -I${TOP_OBJDIR}/src/config ${FSINCLUDES} $(DEFINES) $(KDEFS) $(KOPTS) ${DBUG}
51
52 # Name of directory to hold object files and libraries.
53 <all -sun4x_57 -sun4x_58 -sun4x_59 -sun4x_510 -sun4x_511 -sunx86_57 -sunx86_58 -sunx86_59 -sunx86_510 -sunx86_511>
54 KOBJ = MODLOAD
55 <sun4x_57 sun4x_58 sun4x_59 sunx86_57 sunx86_58 sunx86_59 sunx86_510 sunx86_511>
56 KOBJ = MODLOAD32 MODLOAD64
57 <sun4x_510 sun4x_511>
58 KOBJ = MODLOAD64
59
60 # This tells Makefile.common to use it's single directory build target.
61 <all -sun4x_57 -sun4x_58 -sun4x_59 -sun4x_510 -sun4x_511 -sunx86_57 -sunx86_58 -sunx86_59 -sunx86_510 -sunx86_511>
62 COMPDIRS = single_compdir
63 INSTDIRS = single_instdir
64 DESTDIRS = single_destdir
65
66 <sun4x_57 sun4x_58 sun4x_59 sun4x_510 sun4x_511 sunx86_57 sunx86_58 sunx86_59 sunx86_510 sunx86_511>
67 COMPDIRS = solaris_compdirs
68 INSTDIRS = solaris_instdirs
69 DESTDIRS = solaris_destdirs
70
71 <all>
72 include Makefile.common
73
74
75 setup:
76         -$(RM) -f  h net netinet rpc ufs nfs  machine sys inet
77         -ln -fs /usr/include/sys h
78         -ln -fs /usr/include/net net
79         -ln -fs /usr/include/netinet netinet
80         -ln -fs /usr/include/rpc rpc
81         -ln -fs /usr/include/sys sys
82         -ln -fs /usr/include/nfs nfs
83         -ln -fs /usr/include/inet inet
84         -ln -fs /usr/include/ufs ufs
85         for t in ${KOBJ} ; do \
86                 echo Making directory: $$t; \
87                 mkdir -p $$t; \
88                 $(RM) -f $$t/Makefile.common $$t/Makefile $$t/config ; \
89                 ln -fs ../Makefile.common $$t/Makefile.common ; \
90                 ln -fs ../Makefile $$t/Makefile ;\
91                 ln -fs ../config $$t/config ;\
92         done
93
94
95 ## This is the target for a Solaris 7. Here we build both the 32 bit and
96 ## the 64 bit libafs in MODLOAD32 and MODLOAD64 directories respectively
97
98 <sun4x_57 sun4x_58 sun4x_59 sun4x_510 sun4x_511 sunx86_57 sunx86_58 sunx86_59 sunx86_510 sunx86_511>
99 ${COMPDIRS} ${INSTDIRS} ${DESTDIRS}:
100         for t in ${KOBJ} ; do \
101                 echo Building directory: $$t ; \
102                 case $$t in \
103                         MODLOAD32) \
104                          ARCH_DEFS="${KDEFS_32}" ; \
105                          BITS="" ;; \
106                         MODLOAD64) \
107                          ARCH_DEFS="${KDEFS_64}" ; \
108                          BITS="64" ;; \
109                 esac ; \
110                 export ARCH_DEFS ; \
111                 export BITS ; \
112                 cd $$t  ; \
113                 $(MAKE) $@_libafs ; \
114                 cd ../ ;\
115         done
116
117 solaris_compdirs_libafs: depsrcs libafs
118 solaris_instdirs_libafs: install_libafs
119 solaris_destdirs_libafs: dest_libafs
120
121 <all>
122
123 # Below this line are targets when in the COMMON directory:
124 LIBAFS = libafs.o
125 LIBAFSNONFS = libafs.nonfs.o
126
127 <all -sun4x_57 -sun4x_58 -sun4x_59>
128 INST_LIBAFS = ${DESTDIR}${afskerneldir}/${LIBAFS}
129 INST_LIBAFSNONFS = ${DESTDIR}${afskerneldir}/${LIBAFSNONFS}
130
131 DEST_LIBAFS = ${DEST}/root.client/usr/vice/etc/modload/${LIBAFS}
132 DEST_LIBAFSNONFS = ${DEST}/root.client/usr/vice/etc/modload/${LIBAFSNONFS}
133
134 <sun4x_57 sun4x_58 sun4x_59 sun4x_510 sun4x_511 sunx86_57 sunx86_58 sunx86_59 sunx86_510 sunx86_511>
135 INST_LIBAFSNONFS = ${DESTDIR}${afskerneldir}/libafs${BITS}.nonfs.o
136 INST_LIBAFS = ${DESTDIR}${afskerneldir}/libafs${BITS}.o
137
138 DEST_LIBAFSNONFS = ${DEST}/root.client/usr/vice/etc/modload/libafs${BITS}.nonfs.o
139 DEST_LIBAFS = ${DEST}/root.client/usr/vice/etc/modload/libafs${BITS}.o
140
141 <all>
142
143 # Without this line, gmake tries to build libafs.o
144 .PHONY: libafs
145
146 libafs: $(LIBAFSNONFS) $(LIBAFS)
147
148 install_libafs: $(LIBAFS) $(LIBAFSNONFS)
149         ${INSTALL} -d ${DESTDIR}${afskerneldir}
150         ${INSTALL} -m 644 $(LIBAFS) $(INST_LIBAFS)
151         ${INSTALL} -m 644 $(LIBAFSNONFS) $(INST_LIBAFSNONFS)
152
153 dest_libafs: $(LIBAFS) $(LIBAFSNONFS)
154         ${INSTALL} -d ${DEST}/root.client/usr/vice/etc/modload
155         ${INSTALL} -m 644 $(LIBAFS) $(DEST_LIBAFS)
156         ${INSTALL} -m 644 $(LIBAFSNONFS) $(DEST_LIBAFSNONFS)
157
158 ${LIBAFS}: $(AFSAOBJS) $(AFSNFSOBJS)
159         $(RM) -f $@
160         $(LD) -r -o $@ $(AFSAOBJS) ${AFSNFSOBJS}
161
162 ${LIBAFSNONFS}:  $(AFSAOBJS) $(AFSNONFSOBJS)
163         $(RM) -f $@
164         $(LD) -r -o $@  $(AFSAOBJS) ${AFSNONFSOBJS}
165