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