ab60fb548bbfd0a48d4b082a0437d837f37cf5a7
[openafs.git] / src / libafs / MakefileProto.AIX.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 # OS specific object files:
16 AFS_OS_OBJS = \
17         osi_assem.o \
18         osi_config.o \
19         osi_groups.o \
20         osi_file.o \
21         osi_inode.o \
22         osi_misc.o \
23         osi_sleep.o \
24         osi_timeout.o \
25         osi_vm.o
26
27 AFSNOIAUTHOBJS = \
28         afs_call.o \
29         afs_pioctl.o \
30         osi_vfsops.o \
31         osi_vnodeops.o
32
33
34 # Object files for iauth NFS->AFS authenticator.
35 AFSIAUTHOBJS = \
36         afs_call_iauth.o \
37         afs_nfsclnt_iauth.o \
38         afs_pioctl_iauth.o \
39         osi_vfsops_iauth.o \
40         osi_vnodeops_iauth.o
41
42 AFS_OS_CLEAN = \
43         *.exp \
44         export.h
45
46 # System specific build commands
47 STRIP = /bin/strip
48 DBUG  = -g
49 #OPT   = -O
50 OPT2   = -O
51
52 IMPORTS = -bI:/lib/kernex.exp -bI:/lib/syscalls.exp -bI:/lib/sockets.exp \
53         -bI:/lib/netinet.exp \
54         -bI:${TOP_LIBDIR}/extras.exp 
55 IMPORTS32 = -bI:${TOP_LIBDIR}/export.exp
56 IMPORTS64 = -bI:${TOP_LIBDIR}/export64.exp
57 KDEFS = -U_IBMR2 -D_POWER -D_AIX -DNLS -D_NLS -DMSG -D__STR31__ -Daiws \
58         -D_POWER_RS -D_POWER_PC -D_POWER_RS1 -D_POWER_RS2 -D_POWER_RSC \
59          -D_POWER_601 -D_POWER_603 -D_POWER_604 -D_THREADS -M  -D_KERNEL \
60         -D_POWER_MP -UKOFF -DAFSDEBUG -DVICE -DNFS -DUFS -DINET -DQUOTA \
61          -DGETMOUNT -H8 -DAFS -DAFS_COMMON -D_VOPS -D_SUN -DKERNEL
62 LDSTUFF= -b"binder:/usr/lib/bind glink:/usr/lib/glink.o" -bnoentry -b h:4 \
63         -D0 -T512
64 LDSTUFF64= -b"binder:/usr/lib/bind glink:/usr/lib/glink64.o" -bnoentry -b h:4 \
65         -D0 -T512
66 LDFLAGS = -m -eafs_config -bexport:${TOP_LIBDIR}/afs.exp ${IMPORTS} \
67          -lsys -lcsys  ${KLDOPTS}
68
69 CFLAGS=-I. -I.. -I${TOP_OBJDIR}/src/config ${FSINCLUDES} $(KDEFS) $(KOPTS) ${DBUG}
70
71 # Name of directory to hold object files and libraries.
72 KOBJ = MODLOAD MODLOAD64
73
74 # This tells Makefile.common to use it's single directory build target.
75 COMPDIRS = aix_compdirs
76 INSTDIRS = aix_instdirs
77 DESTDIRS = aix_destdirs
78
79 <rs_aix42>
80 KMODS=32 
81 <rs_aix50 rs_aix51 rs_aix52 rs_aix53>
82 KMODS=32 64
83 <rs_aix61>
84 KMODS=64
85 <all>
86
87 include Makefile.common
88
89 setup:
90         -$(RM) -f  h net netinet rpc ufs nfs  machine sys
91         ln -fs /usr/include/sys h
92         ln -fs /usr/include/net net
93         ln -fs /usr/include/netinet netinet
94         ln -fs /usr/include/rpc rpc
95         ln -fs /usr/include/sys sys
96         ln -fs /usr/include/nfs nfs
97         ln -fs /usr/include/jfs ufs
98         for m in ${KMODS} ; do \
99                 KDIR=MODLOAD-$$m ; \
100                 mkdir -p $${KDIR} ; \
101                 ln -fs ../Makefile $${KDIR}/Makefile ; \
102                 ln -fs ../Makefile.common $${KDIR}/Makefile.common ; \
103                 ln -fs ../config $${KDIR}/config ; \
104         done
105
106 ${COMPDIRS} ${INSTDIRS} ${DESTDIRS}:
107         for m in ${KMODS} ; do \
108                 KDIR=MODLOAD-$$m ; \
109                 echo Building in directory: $${KDIR} ; \
110                 if [ "$$m" = "32" ] ; then \
111                         KOPTS="-q32" ; \
112                         KLDOPTS="-b32" ; \
113                         KASOPTS="32" ; \
114                         TARG="afs.ext.32" ; \
115                 elif [ "$$m" = "64" ] ; then \
116                         KOPTS="-q64 -DAFS_64BIT_KERNEL -D__64BIT_KERNEL" ; \
117                         KLDOPTS="-b64" ; \
118                         KASOPTS="64" ; \
119                         TARG="afs.ext.64" ; \
120                 fi ; \
121                 cd $${KDIR} ; \
122                 $(MAKE) DEST="$${DEST}" KOPTS="$${KOPTS}"  KLDOPTS="$${KLDOPTS}" KASOPTS="$${KASOPTS}" $@_$${TARG} || exit $$?; \
123                 cd ../ ; \
124         done
125
126 aix_compdirs_afs.ext.32: afs.ext.32
127 aix_compdirs_afs.ext.64: afs.ext.64
128 aix_instdirs_afs.ext.32: install_afs.ext.32
129 aix_instdirs_afs.ext.64: install_afs.ext.64
130 aix_destdirs_afs.ext.32: dest_afs.ext.32
131 aix_destdirs_afs.ext.64: dest_afs.ext.64
132
133 dest_afs.ext.32: afs.ext.32
134         ${INSTALL} -d $(DEST)/root.client/usr/vice/etc/dkload
135         $(INSTALL) -m 644 afs.ext.32 $(DEST)/root.client/usr/vice/etc/dkload/afs.ext.32
136         -${STRIP} -X 32 $(DEST)/root.client/usr/vice/etc/dkload/afs.ext.32
137         $(INSTALL) -m 644 afs.ext.32.map $(DEST)/root.client/usr/vice/etc/dkload/afs.ext.32.map
138         echo Install for 32-bit Kernel Complete
139
140 dest_afs.ext.64: afs.ext.64
141         ${INSTALL} -d $(DEST)/root.client/usr/vice/etc/dkload
142         $(INSTALL) -m 644 afs.ext.64 $(DEST)/root.client/usr/vice/etc/dkload/afs.ext.64
143         -${STRIP} -X 64 $(DEST)/root.client/usr/vice/etc/dkload/afs.ext.32
144         $(INSTALL) -m 644 afs.ext.64.map $(DEST)/root.client/usr/vice/etc/dkload/afs.ext.64.map
145         echo Install for 64-bit Kernel Complete
146
147 install_afs.ext.32: afs.ext.32
148         ${INSTALL} -d $(DESTDIR)$(afskerneldir)
149         $(INSTALL) -m 644 afs.ext.32 $(DESTDIR)$(afskerneldir)/afs.ext.32
150         -${STRIP} -X 32 $(DESTDIR)$(afskerneldir)/afs.ext.32
151         $(INSTALL) -m 644 afs.ext.32.map $(DESTDIR)$(afskerneldir)/afs.ext.32.map
152         echo Install for 32-bit Kernel Complete
153
154 install_afs.ext.64: afs.ext.64
155         ${INSTALL} -d $(DESTDIR)$(afskerneldir)
156         $(DESTDIR)$(afskerneldir)/afs.ext.64
157         $(INSTALL) -m 644 afs.ext.64 $(DESTDIR)$(afskerneldir)/afs.ext.64
158         -${STRIP} -X 64 $(DESTDIR)$(afskerneldir)/afs.ext.64
159         $(INSTALL) -m 644 afs.ext.64.map $(DESTDIR)$(afskerneldir)/afs.ext.64.map
160         echo Install for 64-bit Kernel Complete
161
162 # Standard AFS->NFS translator support is removed in AFS 3.5 in favor of
163 # the iauth authentication mechanism. The model was changed by IBM in the
164 # middle of an OS release. So iauth is only supported on AIX 4.1.5 and 
165 # later 4.1.x (if they are ever made) and AIX 4.2.1 (and later AIX 4.2.x if
166 # they are ever made. AIX 4.3 also uses the iauth translator.
167
168 LIBAFSIAUTH = afs.ext.32.iauth
169
170 DEST_LIBAFSIAUTH = $(DEST)/root.client/usr/vice/etc/dkload/$(LIBAFSIAUTH)
171
172 INST_LIBAFSIAUTH = ${DESTDIR}${afskerneldir}/$(LIBAFSIAUTH)
173
174 $(DEST_LIBAFSIAUTH): $(LIBAFSIAUTH)
175
176 $(INST_LIBAFSIAUTH): $(LIBAFSIAUTH)
177
178
179 $(LIBAFSIAUTH): $(AFSAOBJS) $(AFSIAUTHOBJS)
180         ${LD} ${LDSTUFF} -bloadmap:afs.ext.iauth.loadmap \
181                 -bmap:afs.ext.iauth.map -o afs.ext.iauth \
182                 ${AFSAOBJS} ${AFSIAUTHOBJS} ${LIBS} ${LDFLAGS} ${IMPORTS32}
183
184 afs.ext.32: $(AFSAOBJS) $(AFSNOIAUTHOBJS)
185         ${LD} ${LDSTUFF} -bloadmap:afs.ext.32.loadmap \
186                 -bmap:afs.ext.32.map -o afs.ext.32 \
187                 ${AFSAOBJS} ${AFSNOIAUTHOBJS} ${LIBS} \
188                 ${LDFLAGS} ${IMPORTS32}
189
190 afs.ext.64: $(AFSAOBJS) $(AFSNOIAUTHOBJS)
191         ${LD} ${LDSTUFF64} -b64 -bloadmap:afs.ext.64.loadmap \
192                 -bmap:afs.ext.64.map -o afs.ext.64 \
193                 ${AFSAOBJS} ${AFSNOIAUTHOBJS} ${LIBS} \
194                 ${LDFLAGS} ${IMPORTS64}
195
196 libafs: $(LIBAFS) $(LIBAFS64) $(LIBAFSIAUTH)
197
198 install_libafs: $(INST_LIBAFSIAUTH)
199         ${INSTALL} -d ${DESTDIR}${afskerneldir}
200         $(INSTALL) -m 644 $(LIBAFSIAUTH) $(INST_LIBAFSIAUTH)
201         -${STRIP} $(INST_LIBAFSIAUTH)
202         $(INSTALL) -m 644 $(LIBAFSIAUTH).map $(INST_LIBAFSIAUTH).map
203
204 dest_libafs: $(DEST_LIBAFSIAUTH)
205         ${INSTALL} -d $(DEST)/root.client/usr/vice/etc/dkload
206         $(INSTALL) -m 644 $(LIBAFSIAUTH) $(DEST_LIBAFSIAUTH)
207         -${STRIP} $(DEST_LIBAFSIAUTH)
208         $(INSTALL) -m 644 $(LIBAFSIAUTH).map $(DEST_LIBAFSIAUTH).map
209
210 osi_assem.o:    osi_assem.s
211         ${AS} -a${KASOPTS} -o osi_assem.o osi_assem.s
212 osi_assem.s: $(TOP_SRCDIR)/afs/$(MKAFS_OSTYPE)/osi_assem32.s $(TOP_SRCDIR)/afs/$(MKAFS_OSTYPE)/osi_assem64.s
213         case bit${KASOPTS} in \
214                 bit64 ) \
215                         cp -p $(TOP_SRCDIR)/afs/$(MKAFS_OSTYPE)/osi_assem64.s osi_assem.s ;; \
216                 * ) \
217                         cp -p $(TOP_SRCDIR)/afs/$(MKAFS_OSTYPE)/osi_assem32.s osi_assem.s ;; \
218         esac
219
220
221 # Build rules for iauth objects.
222 afs_call_iauth.o:       $(TOP_SRCDIR)/afs/afs_call.c
223         $(CRULE1) -DAFS_NONFSTRANS -DAFS_AIX_IAUTH_ENV -o afs_call_iauth.o
224 afs_nfsclnt_iauth.o:    $(TOP_SRCDIR)/afs/afs_nfsclnt.c
225         $(CRULE1) -DAFS_NONFSTRANS -DAFS_AIX_IAUTH_ENV -o afs_nfsclnt_iauth.o
226 afs_pioctl_iauth.o:     $(TOP_SRCDIR)/afs/afs_pioctl.c
227         $(CRULE1) -DAFS_NONFSTRANS -DAFS_AIX_IAUTH_ENV -o afs_pioctl_iauth.o
228 osi_vfsops_iauth.o: $(TOP_SRCDIR)/afs/osi_vfsops.c
229         $(CRULE1) -DAFS_NONFSTRANS  -DAFS_AIX_IAUTH_ENV -o osi_vfsops_iauth.o
230 osi_vnodeops_iauth.o:   $(TOP_SRCDIR)/afs/osi_vnodeops.c
231         $(CRULE1) -DAFS_NONFSTRANS -DAFS_AIX_IAUTH_ENV -o osi_vnodeops_iauth.o