libafs-make-subtree-during-build-for-later-use-20010829
[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 # MakefileProto for AIX systems
9 #
10 DESTDIR=@DESTDIR@
11 SRCDIR=@SRCDIR@
12 TOP_SRCDIR=@TOP_SRCDIR@
13 SYS_NAME=@AFS_SYSNAME@
14
15 include config/Makefile.${SYS_NAME}
16
17 # OS specific object files:
18 AFS_OS_OBJS = \
19         osi_assem.o \
20         osi_config.o \
21         osi_groups.o \
22         osi_file.o \
23         osi_inode.o \
24         osi_misc.o \
25         osi_sleep.o \
26         osi_timeout.o \
27         osi_vm.o \
28         xdr.o \
29         xdr_array.o \
30         xdr_int64.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 # System specific build commands
48 STRIP = /bin/strip
49 DBUG  = -g
50 #OPT   = -O
51 OPT2   = -O
52
53 IMPORTS = -bI:/lib/kernex.exp -bI:/lib/syscalls.exp -bI:/lib/sockets.exp \
54         -bI:/lib/netinet.exp \
55         -bI:${DESTDIR}/lib/afs/extras.exp -bI:${DESTDIR}/lib/afs/export.exp
56 KDEFS = -U_IBMR2 -D_POWER -D_AIX -DNLS -D_NLS -DMSG -D__STR31__ -Daiws \
57         -D_POWER_RS -D_POWER_PC -D_POWER_RS1 -D_POWER_RS2 -D_POWER_RSC \
58          -D_POWER_601 -D_POWER_603 -D_POWER_604 -D_THREADS -M  -D_KERNEL \
59         -D_POWER_MP -UKOFF -DAFSDEBUG -DVICE -DNFS -DUFS -DINET -DQUOTA \
60          -DGETMOUNT -H8 -DAFS -DAFS_COMMON -D_VOPS -D_SUN -DKERNEL
61 LDSTUFF= -b"binder:/usr/lib/bind glink:/usr/lib/glink.o" -bnoentry -b h:4 \
62         -D0 -T512
63 LDFLAGS = -m -eafs_config -bexport:${DESTDIR}/lib/afs/afs.exp ${IMPORTS} \
64          -lsys -lcsys 
65
66 CFLAGS=-I. -I.. -I${TOP_SRCDIR}/config ${FSINCLUDES} $(KDEFS) $(KOPTS) ${DBUG}
67
68 # Name of directory to hold object files and libraries.
69 KOBJ = MODLOAD
70
71 # This tells Makefile.common to use it's single directory build target.
72 COMPDIRS = single_compdir
73 INSTDIRS = single_instdir
74
75 include Makefile.common
76
77 setup:
78         -mkdir $(KOBJ)
79         -rm $(KOBJ)/Makefile $(KOBJ)/Makefile.common $(KOBJ)/config
80         ln -s ../Makefile $(KOBJ)/Makefile
81         ln -s ../Makefile.common $(KOBJ)/Makefile.common
82         ln -s ../config $(KOBJ)/config
83         -rm -f  h net netinet rpc ufs nfs  machine sys
84         ln -s /usr/include/sys h
85         ln -s /usr/include/net net
86         ln -s /usr/include/netinet netinet
87         ln -s /usr/include/rpc rpc
88         ln -s /usr/include/sys sys
89         ln -s /usr/include/nfs nfs
90         ln -s /usr/include/jfs ufs
91
92
93
94
95
96 # Standard AFS->NFS translator support is removed in AFS 3.5 in favor of
97 # the iauth authentication mechanism. The model was changed by IBM in the
98 # middle of an OS release. So iauth is only supported on AIX 4.1.5 and 
99 # later 4.1.x (if they are ever made) and AIX 4.2.1 (and later AIX 4.2.x if
100 # they are ever made. AIX 4.3 also uses the iauth translator.
101
102 CLIENTDIR = $(DESTDIR)root.client/usr/vice/etc/dkload
103 LIBAFSIAUTH = afs.ext.iauth
104 LIBAFS = afs.ext
105
106 DEST_LIBAFSIAUTH = $(CLIENTDIR)/$(LIBAFSIAUTH)
107 DEST_LIBAFS = $(CLIENTDIR)/$(LIBAFS)
108
109 $(DEST_LIBAFS): $(LIBAFS)
110         $(INSTALL) -f $? $@
111         -${STRIP} $@
112         $(INSTALL) -f $?.map $@.map
113         
114 $(DEST_LIBAFSIAUTH): $(LIBAFSIAUTH)
115         $(INSTALL) -f $? $@
116         -${STRIP} $@
117         $(INSTALL) -f $?.map $@.map
118         
119         
120
121 $(LIBAFSIAUTH): $(AFSAOBJS) $(AFSIAUTHOBJS)
122         ${LD} ${LDSTUFF}  -bloadmap:afs.ext.iauth.loadmap \
123          -bmap:afs.ext.iauth.map -o afs.ext.iauth \
124         ${AFSAOBJS} ${AFSIAUTHOBJS} ${LIBS} ${LDFLAGS}
125
126 $(LIBAFS): $(AFSAOBJS) $(AFSNOIAUTHOBJS)
127         ${LD} ${LDSTUFF}  -bloadmap:afs.ext.loadmap \
128          -bmap:afs.ext.map -o afs.ext \
129         ${AFSAOBJS} $(AFSNOIAUTHOBJS) ${LIBS} ${LDFLAGS}
130
131 libafs: $(LIBAFS) $(LIBAFSIAUTH)
132 install_libafs: $(DEST_LIBAFS) $(DEST_LIBAFSIAUTH)
133
134
135 # Object build rules:
136 # Common objects
137 xdr.o: $(RX)/xdr.c
138         $(CRULE1);
139 xdr_int64.o: $(RX)/xdr_int64.c
140         $(CRULE1);
141
142 xdr_array.o: $(RX)/xdr_array.c
143         $(CRULE1);
144
145 osi_assem.o:    ${AFS}/osi_assem.s
146         ${AS} -o osi_assem.o ${AFS}/osi_assem.s
147 osi_config.o: $(AFS)/osi_config.c
148         $(CRULE1);
149 osi_groups.o: $(AFS)/osi_groups.c
150         $(CRULE1);
151 osi_file.o: $(AFS)/osi_file.c
152         $(CRULE1);
153 osi_inode.o: $(AFS)/osi_inode.c
154         $(CRULE1);
155 osi_misc.o: $(AFS)/osi_misc.c
156         $(CRULE1);
157 osi_sleep.o: $(AFS)/osi_sleep.c
158         $(CRULE1);
159 osi_timeout.o: $(AFS)/osi_timeout.c
160         $(CRULE1);
161 osi_vfsops.o: $(AFS)/osi_vfsops.c
162         $(CRULE1);
163 osi_vm.o: $(AFS)/osi_vm.c
164         $(CRULE1);
165 osi_vnodeops.o: $(AFS)/osi_vnodeops.c
166         $(CRULE1);
167
168
169 # Build rules for iauth objects.
170 afs_call_iauth.o:       $(AFS)/afs_call.c
171         $(CRULE1) -DAFS_NONFSTRANS -DAFS_AIX_IAUTH_ENV -o afs_call_iauth.o;
172 afs_nfsclnt_iauth.o:    $(AFS)/afs_nfsclnt.c
173         $(CRULE1) -DAFS_NONFSTRANS -DAFS_AIX_IAUTH_ENV -o afs_nfsclnt_iauth.o;
174 afs_pioctl_iauth.o:     $(AFS)/afs_pioctl.c
175         $(CRULE1) -DAFS_NONFSTRANS -DAFS_AIX_IAUTH_ENV -o afs_pioctl_iauth.o;
176 osi_vfsops_iauth.o: $(AFS)/osi_vfsops.c
177         $(CRULE1) -DAFS_NONFSTRANS  -DAFS_AIX_IAUTH_ENV -o osi_vfsops_iauth.o;
178 osi_vnodeops_iauth.o:   $(AFS)/osi_vnodeops.c
179         $(CRULE1) -DAFS_NONFSTRANS -DAFS_AIX_IAUTH_ENV -o osi_vnodeops_iauth.o;