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