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