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