LINUX: Avoid building rand-fortuna-kernel.o
[openafs.git] / src / libafs / MakefileProto.IRIX.in
index 63ca54a..4142b41 100644 (file)
@@ -5,27 +5,29 @@
 # License.  For details, see the LICENSE file in the top-level source
 # directory or online at http://www.openafs.org/dl/license10.html
 
-# MakefileProto for IRIX systems
-#
-DESTDIR=@DESTDIR@
-SRCDIR=@SRCDIR@
-TOP_SRCDIR=@TOP_SRCDIR@
-SYS_NAME=@AFS_SYSNAME@
+srcdir=@srcdir@
+include @TOP_OBJDIR@/src/config/Makefile.config
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
 
-include config/Makefile.${SYS_NAME}
 
 # OS specific object files:
 AFS_OS_OBJS = \
-       afs_base64.o \
+       base64.o \
+       osi_crypto.o \
+       osi_gcpags.o \
        osi_groups.o \
        osi_idbg.o \
        osi_file.o \
        osi_inode.o \
        osi_misc.o \
        osi_sleep.o \
+       osi_vcache.o \
        osi_vm.o \
        osi_vnodeops.o \
-       xdr_int64.o
+       rand-fortuna-kernel.o
 
 AFS_OS_NFSOBJS = \
        osi_vfsops_nfs.o
@@ -35,7 +37,9 @@ AFS_OS_NONFSOBJS = \
 
 
 # System specific build commands and flags
-DBUG=-g
+DBUG=-g2
+WSUPPRESS= -woff 1174,1196,1201,1209,1496,3201,3968
+
 
 <sgi_62>
 MPS=MP SP
@@ -49,8 +53,8 @@ MPS=MP
 KDEFS=-D_K64U64 -D_KERNEL -DSTATIC=static -D_PAGESZ=16384 -D_MIPS3_ADDRSPACE \
        -DTFP -non_shared -elf -xansi -64 -mips4 -TENV:kernel \
        -TENV:misalignment=1 -OPT:space \
-       -D${CPUBOARD} -D${MPSP}  -D${CPUARCH} -DAFS_SGIMP_ENV ${NODYNOPT} \
-       -jalr -woff 1209,1196,1496
+       -D${CPUBOARD} -D${MPSP} -D${CPUARCH} -DAFS_SGIMP_ENV ${NODYNOPT} \
+       -jalr ${WSUPPRESS}
 <sgi_62>
 # Turning off warnings regarding constant conditionals and not prototyped.
 KDEFS_64BIT= -64 -D_K64U64 -D_PAGESZ=16384 -TENV:kernel -OPT:space \
@@ -66,7 +70,7 @@ KDEFS= -I/usr/include -I/usr/include/sys -D_KERNEL -DSTATIC=static \
        -D_MIPS3_ADDRSPACE -non_shared -elf -xansi \
        ${CPU_KDEFS} \
        -D${CPUBOARD} -D${MPSP} -DAFS_SGIMP_ENV ${NODYNOPT} \
-       -jalr -woff 1209,1196,1496
+       -jalr ${WSUPPRESS}
 R10000_KDEFS = -mips4 -DR10000 -DEXPRESS -DIP28 -DI2_64 -DFAST_LOCORE_FAULT \
        -DSCACHE_SET_ASSOC=2 -D_NO_UNCACHED_MEM_WAR -DMIPS4_ISA \
        -DR10000_SPECULATION_WAR  \
@@ -92,7 +96,7 @@ KDEFS= -I/usr/include -I/usr/include/sys -D_KERNEL -DSTATIC=static \
        -non_shared -elf -xansi \
        ${CPU_KDEFS} \
        -D${CPUBOARD} -D${MPSP} -DAFS_SGIMP_ENV ${NODYNOPT} \
-       -jalr -woff 1209,1196,1496
+       -jalr ${WSUPPRESS}
 R5000_LDFLAGS = -mips2 -o32
 R5000_KDEFS =  -DCRIME -DIP32 -DCRM -D_K32U64 -xansi -D_PAGESZ=4096 \
        -D_KERNEL -DSTATIC=static -DPROBE_WAR -D_VCE_AVOIDANCE -DTILE_DATA \
@@ -120,7 +124,7 @@ KDEFS= -I/usr/include -I/usr/include/sys -D_KERNEL -DSTATIC=static \
        -non_shared -elf -xansi \
        ${CPU_KDEFS} \
        -D${CPUBOARD} -D${MPSP} -DAFS_SGIMP_ENV ${NODYNOPT} \
-       -jalr -woff 1209,1196,1496
+       -jalr ${WSUPPRESS}
 R10000_LDFLAGS = -mips4 -64
 R10000_KDEFS = -DKONA -DIP27 -DIP27 -DDISCONTIG_PHYSMEM -DNUMA_BASE -DNUMA_PM \
         -DNUMA_TBORROW -DNUMA_MIGR_CONTROL -DNUMA_REPLICATION \
@@ -153,53 +157,91 @@ R10000_KDEFS = -DKONA -DIP27 -DIP27 -DDISCONTIG_PHYSMEM -DNUMA_BASE -DNUMA_PM \
 # While -G 8 is recommended for space, we know that the table overflows when
 # both AFS and DFS are compiled into the kernel. For Irix 6.5, define MP
 # so we pick up locks.
+#
+# For cc flags see:
+# http://techpubs.sgi.com/library/tpl/cgi-bin/getdoc.cgi?coll=0650&db=man&fname=/usr/share/catman/u_man/cat1/cc.z&srch=cc
+#
 KDEFS= -I/usr/include -I/usr/include/sys -DSTATIC=static -DAFS_SGIMP_ENV \
        -DMP -D_KERNEL -DMP_STREAMS -D_MP_NETLOCKS -DMRSP_AS_MR \
-       -fullwarn -non_shared -G 0 \
+       ${CPU_KDEFS} -fullwarn -non_shared -G 0 \
        -TENV:kernel -OPT:space -OPT:Olimit=0 -CG:unique_exit=on \
        -TENV:X=1 -OPT:IEEE_arithmetic=1 -OPT:roundoff=0 \
        -OPT:wrap_around_unsafe_opt=off \
-       ${CPU_KDEFS} -woff 1209,1196,1496
+       ${WSUPPRESS}
 # 32 bit specific flags:
 KDEFS_32 = -n32 -D_PAGESZ=4096 -mips3
 # 64 bit specific flags:
 KDEFS_64 = -64 -D_PAGESZ=16384 -D_MIPS3_ADDRSPACE -mips4
 
 # CPU board specific flags:
+# To get more help on all board/cpu combinations see http://sgistuff.g-lenerz.de/machines.html
+#
+#IP19 (Challenge DM/L/XL, Onyx) CPU's R4000, R4400
 IP19_KDEFS = -DIP19 -DEVEREST -DMP -DR4000 \
-       -mips3  -D_PAGESZ=16384 -D_MIPS3_ADDRSPACE -64
+       -D_PAGESZ=16384 -D_MIPS3_ADDRSPACE -TARG:platform=ip19:processor=r4000 $(KDEFS_32)
+#IP20 (Indigo) CPU's R4000
 IP20_KDEFS = -DIP20 -DR4000 -DJUMP_WAR -DBADVA_WAR -DTRITON -DUSE_PCI_PIO \
-               $(KDEFS_32)
-IP21_KDEFS = -DIP21 -DEVEREST -DMP -DTFP -TARG:processor=r8000 $(KDEFS_64)
-IP25_KDEFS = -DIP25 -DEVEREST -DMP -DR10000 -TARG:processor=r10000 $(KDEFS_64)
-IP26_KDEFS = -DIP26 -DTFP -TARG:sync=off -TARG:processor=r8000 $(KDEFS_64)
+               -D_R5000_CVT_WAR=1 -DCKPT -D_MTEXT_VFS -Ofast=ip20 $(KDEFS_32)
+#IP21 (Power Challenge DM/L/XL, Power Onyx) R8000
+IP21_KDEFS = -DIP21 -DEVEREST -DMP -DTFP -TARG:processor=r8000 -Ofast=ip21 $(KDEFS_64)
+#IP22 (Indigo 2, Challenge M) CPU's R4000, R4400, R4600 (and by bug in hinv(1) also Indy IP24 machines with R4x00)
+# -Ofast=ip22_4k is same as -TARG:ip22_4k -O3 -IPA -OPT:roundoff=3:Olimit=0:div_split=on:alias=typed
+# when -Ofast used on IP24 Indy, the STATIC.*/libafs*.a claims to be 64-bit and /etc/refuses to build the
+# object in the kernel.
+IP22_4K_KDEFS = -DIP20 -DR4000 -DJUMP_WAR -DBADVA_WAR -DTRITON -DUSE_PCI_PIO \
+       -D_R5000_CVT_WAR=1 -DCKPT -D_MTEXT_VFS -TARG:platform=ip22_4k:processor=r4000 $(KDEFS_32) 
+IP22_5K_KDEFS = -DIP20 -DR4000 -DJUMP_WAR -DBADVA_WAR -DTRITON -DUSE_PCI_PIO \
+       -D_R5000_CVT_WAR=1 -DCKPT -D_MTEXT_VFS -TARG:platform=ip22_5k:processor=r5000 $(KDEFS_32)
+#IP24 (Indy, Challenge S) is reported by hinv(1) as IP22, CPU's R4000, R4400, R4600, R5000
+# therefore same as IP22
+#IP25 (Power Challenge L/XL, Power Onyx) CPU's R10000
+IP25_KDEFS = -DIP25 -DEVEREST -DMP -DR10000 -Ofast=ip25 -TARG:processor=r10000 $(KDEFS_64)
+#IP26 (Power Challenge M, Power Indigo 2) CPU's R8000
+IP26_KDEFS = -DIP26 -DTFP -TARG:sync=off -Ofast=ip26 -TARG:processor=r8000 $(KDEFS_64)
+#IP27 (Origin 200, Origin 2000, Onyx 2, Origin 3000) CPU's R10000, R12000
 IP27_KDEFS =  -DIP27 -DR10000 -DMP -DSN -DSN0 -DMAPPED_KERNEL \
        -DLARGE_CPU_COUNT \
        -DPTE_64BIT -DULI -DCKPT -DMIPS4_ISA -DR10K_LLSC_WAR -DNUMA_BASE \
        -DNUMA_PM  -DNUMA_TBORROW -DNUMA_MIGR_CONTROL -DNUMA_REPLICATION \
        -DNUMA_REPL_CONTROL -DNUMA_SCHED -DCELL_PREPARE -DBHV_PREPARE \
-       -TARG:processor=r10000 $(KDEFS_64)
+       -Ofast=ip27 -TARG:processor=r10000 $(KDEFS_64)
+#IP28 (Indigo 2), CPU's R10000
 IP28_KDEFS = -DIP28 -DR10000 -DSCACHE_SET_ASSOC=2 -D_NO_UNCACHED_MEM_WAR \
-       -DR10000_SPECULATION_WAR -TARG:processor=r10000 \
+       -DR10000_SPECULATION_WAR -Ofast=ip28 -TARG:processor=r10000 \
        -TARG:t5_no_spec_stores $(KDEFS_64)
+#IP30 (Octane and Octane 2) CPU's R10000, R12000, R14000 (and by bug also Indy IP24 with R5000)
 IP30_KDEFS = -DIP30 -DR10000 -DMP -DCELL_PREPARE -DBHV_PREPARE \
-       -TARG:processor=r10000 $(KDEFS_64)
+       -Ofast=ip30 -TARG:processor=r10000 $(KDEFS_64)
+#IP32 (O2 and O2+) CPU's R5000, R10000, R12000
+IP32_5K_KDEFS = -DIP20 -DR4000 -DJUMP_WAR -DBADVA_WAR -DTRITON -DUSE_PCI_PIO \
+       -D_PAGESZ=16384 -D_MIPS3_ADDRSPACE -Ofast=ip32_5k $(KDEFS_64)
+IP32_10K_KDEFS = -DIP20 -DR4000 -DJUMP_WAR -DBADVA_WAR -DTRITON -DUSE_PCI_PIO \
+       -D_PAGESZ=16384 -D_MIPS3_ADDRSPACE -Ofast=ip32_10k $(KDEFS_64)
+#IP35 (Fuel, Origin 3000) CPU's R14000, R16000
+IP35_KDEFS =  -DIP35 -DR10000 -DMP -DSN -DSN1 -DMAPPED_KERNEL \
+       -DLARGE_CPU_COUNT \
+       -DPTE_64BIT -DULI -DCKPT -DMIPS4_ISA -DNUMA_BASE \
+       -DNUMA_PM  -DNUMA_TBORROW -DNUMA_MIGR_CONTROL -DNUMA_REPLICATION \
+       -DNUMA_REPL_CONTROL -DNUMA_SCHED -DCELL_PREPARE -DBHV_PREPARE \
+       -Ofast=ip35 $(KDEFS_64)
+#IP53 (Tezro) CPU's R16000
 # Loader flags
-LDFLAGS_64 = -64
-LDFLAGS_32 = -n32
+LDFLAGS_64 = -64 -IPA
+LDFLAGS_32 = -n32 -IPA
 
 
 <all>
 DEFINES= -DAFSDEBUG -DKERNEL -DAFS -DVICE -DNFS -DUFS -DINET -DQUOTA -DGETMOUNT
 OPTF=${OPT} 
 OPTF2=${OPT2} 
-CFLAGS=-I. -I.. -I${TOP_SRCDIR}/config ${FSINCLUDES} $(DEFINES) -G 0 $(KDEFS) $(KOPTS) ${DBUG}
+CFLAGS=-I. -I.. -I${TOP_OBJDIR}/src/config ${FSINCLUDES} $(DEFINES) -G 0 $(KDEFS) $(KOPTS) ${DBUG}
 
 # This tells Makefile.common to use it's single directory build target.
 #COMPDIRS = single_compdir
 # This is the irix multiple directory target.
 COMPDIRS = irix_compdirs
 INSTDIRS = irix_instdirs
+DESTDIRS = irix_destdirs
 
 include Makefile.common
 
@@ -211,19 +253,18 @@ PROCESSORS = R5000 R1000
 <sgi_64>
 PROCESSORS = R10000
 <sgi_65>
-PROCESSORS = IP19 IP20 IP21 IP25 IP26 IP27 IP28 IP30
+PROCESSORS = IP19 IP20 IP21 IP22_4K IP22_5K IP25 IP26 IP27 IP28 IP30 IP32_5K IP32_10K @IRIX_BUILD_IP35@
 <all>
 
 KOBJ = STATIC MODLOAD
 
 
 setup:
-       -rm -f  h net netinet rpc ufs nfs  machine sys 
-       -ln -s /usr/include/sys h
-       -ln -s /usr/include/net /usr/include/netinet .
-       -ln -s /usr/include/rpc /usr/include/sys .
-       -ln -s /usr/include/sys/fs .
-       -mkdir ${DESTDIR}root.client/bin
+       -$(RM) -f  h net netinet rpc ufs nfs  machine sys 
+       -ln -fs /usr/include/sys h
+       -ln -fs /usr/include/net /usr/include/netinet .
+       -ln -fs /usr/include/rpc /usr/include/sys .
+       -ln -fs /usr/include/sys/fs .
 <all -sgi_65>
        BUILDPROCS="${PROCESSORS}" ; \
        BUILDMPS="${MPS}" ; \
@@ -237,10 +278,10 @@ setup:
                dir=$$t.$$n.$$p ; \
                echo Making directory: $$dir; \
                mkdir -p $$dir; \
-               rm -f $$dir/Makefile.common $$dir/Makefile $$dir/config; \
-               ln -s ../Makefile.common $$dir/Makefile.common; \
-               ln -s ../Makefile $$dir/Makefile; \
-               ln -s ../config $$dir/config; \
+               $(RM) -f $$dir/Makefile.common $$dir/Makefile $$dir/config; \
+               ln -fs ../Makefile.common $$dir/Makefile.common; \
+               ln -fs ../Makefile $$dir/Makefile; \
+               ln -fs ../config $$dir/config; \
            done; \
          done; \
        done
@@ -254,19 +295,19 @@ setup:
                dir=$$t.$$p ; \
                echo Making directory: $$dir; \
                mkdir -p $$dir; \
-               rm -f $$dir/Makefile.common $$dir/Makefile $$dir/config; \
-               ln -s ../Makefile.common $$dir/Makefile.common; \
-               ln -s ../Makefile $$dir/Makefile; \
-               ln -s ../config $$dir/config; \
+               $(RM) -f $$dir/Makefile.common $$dir/Makefile $$dir/config; \
+               ln -fs ../Makefile.common $$dir/Makefile.common; \
+               ln -fs ../Makefile $$dir/Makefile; \
+               ln -fs ../config $$dir/config; \
            done; \
        done
 <all>
-       echo Setup compelete.
+       echo Setup complete.
 
 
 # Compile static and modload versions of the clients.
 <all -sgi_65>
-${COMPDIRS} ${INSTDIRS}:
+${COMPDIRS} ${INSTDIRS} ${DESTDIRS}:
        BUILDPROCS="${PROCESSORS}" ; \
        if [ "${CPUARCH}" != "" ] ; then \
                BUILDPROCS=${CPUARCH}; \
@@ -287,7 +328,7 @@ ${COMPDIRS} ${INSTDIRS}:
                         CPU_KDEFS="${R4000_32_KDEFS}"; \
                         LDFLAGS="${R4000_32_LDFLAGS}";; \
                        R5000) \
-                        CPUBOARD=IP32; \
+                        CPUBOARD=IP32_5K; \
                         CPU_KDEFS="${R5000_KDEFS}"; \
                         LDFLAGS="${R5000_LDFLAGS}";; \
                        R8000) \
@@ -298,7 +339,7 @@ ${COMPDIRS} ${INSTDIRS}:
 <sgi_62>
                         CPUBOARD=IP28; \
 <sgi_63>
-                        CPUBOARD=IP32; \
+                        CPUBOARD=IP32_10K; \
 <sgi_64>
                         CPUBOARD=IP27; \
 <sgi_62 sgi_63 sgi_64>
@@ -316,7 +357,7 @@ ${COMPDIRS} ${INSTDIRS}:
          done; \
        done
 <sgi_65>
-${COMPDIRS} ${INSTDIRS}:
+${COMPDIRS} ${INSTDIRS} ${DESTDIRS}:
        BUILDPROCS="${PROCESSORS}" ; \
        if [ "${IPNO}" != "" ] ; then \
                BUILDPROCS="${IPNO}"; \
@@ -325,17 +366,33 @@ ${COMPDIRS} ${INSTDIRS}:
            for t in ${KOBJ} ; do \
              dir=$$t.$$p ; \
                echo Building directory: $$dir; \
-               LDFLAGS="${LDFLAGS_64}"; \
                case $$p in \
-               IP19)   CPU_KDEFS="${IP19_KDEFS}";; \
+               IP19)   CPU_KDEFS="${IP19_KDEFS}"; \
+                       CPU_LDFLAGS="${LDFLAGS_32}";; \
                IP20)   CPU_KDEFS="${IP20_KDEFS}"; \
-                       LDFLAGS="${LDFLAGS_32}";; \
-               IP21)   CPU_KDEFS="${IP21_KDEFS}";; \
-               IP25)   CPU_KDEFS="${IP25_KDEFS}";; \
-               IP26)   CPU_KDEFS="${IP26_KDEFS}";; \
-               IP27)   CPU_KDEFS="${IP27_KDEFS}";; \
-               IP28)   CPU_KDEFS="${IP28_KDEFS}";; \
-               IP30)   CPU_KDEFS="${IP30_KDEFS}";; \
+                       CPU_LDFLAGS="${LDFLAGS_32}";; \
+               IP21)   CPU_KDEFS="${IP21_KDEFS}"; \
+                       CPU_LDFLAGS="${LDFLAGS_64}";; \
+               IP22_4K)        CPU_KDEFS="${IP22_4K_KDEFS}"; \
+                       CPU_LDFLAGS="${LDFLAGS_32}";; \
+               IP22_5K)        CPU_KDEFS="${IP22_5K_KDEFS}"; \
+                       CPU_LDFLAGS="${LDFLAGS_32}";; \
+               IP25)   CPU_KDEFS="${IP25_KDEFS}"; \
+                       CPU_LDFLAGS="${LDFLAGS_64}";; \
+               IP26)   CPU_KDEFS="${IP26_KDEFS}"; \
+                       CPU_LDFLAGS="${LDFLAGS_64}";; \
+               IP27)   CPU_KDEFS="${IP27_KDEFS}"; \
+                       CPU_LDFLAGS="${LDFLAGS_64}";; \
+               IP28)   CPU_KDEFS="${IP28_KDEFS}"; \
+                       CPU_LDFLAGS="${LDFLAGS_64}";; \
+               IP30)   CPU_KDEFS="${IP30_KDEFS}"; \
+                       CPU_LDFLAGS="${LDFLAGS_64}";; \
+               IP32_5K)        CPU_KDEFS="${IP32_5K_KDEFS}"; \
+                       CPU_LDFLAGS="${LDFLAGS_64}";; \
+               IP32_10K)       CPU_KDEFS="${IP32_10K_KDEFS}"; \
+                       CPU_LDFLAGS="${LDFLAGS_64}";; \
+               IP35)   CPU_KDEFS="${IP35_KDEFS}"; \
+                       CPU_LDFLAGS="${LDFLAGS_64}";; \
                *) echo Unknown IP number $$p ; exit 1 ;; \
                esac ;\
                case $$t in \
@@ -345,106 +402,109 @@ ${COMPDIRS} ${INSTDIRS}:
                STATIC) echo X $${CPU_KDEFS} | sed 's/^X//' > $$dir/CPU_KDEFS;; \
                esac ;\
                export CPU_KDEFS ;\
-               export LDFLAGS ;\
+               export CPU_LDFLAGS ;\
                cd $$dir ; \
-               $(MAKE) IPNO=$$p $@_$$t.libafs || exit $$?; \
+               $(MAKE) LDFLAGS="$${CPU_LDFLAGS}" IPNO=$$p $@_$$t.libafs || exit $$?; \
                cd ../ ; \
          done; \
        done
 <all>
 
-irix_compdirs_STATIC.libafs: STATIC.libafs
-irix_compdirs_MODLOAD.libafs: MODLOAD.libafs
+irix_compdirs_STATIC.libafs: depsrcs STATIC.libafs
+irix_compdirs_MODLOAD.libafs: depsrcs MODLOAD.libafs
 irix_instdirs_STATIC.libafs: install_STATIC.libafs
 irix_instdirs_MODLOAD.libafs: install_MODLOAD.libafs
+irix_destdirs_STATIC.libafs: dest_STATIC.libafs
+irix_destdirs_MODLOAD.libafs: dest_MODLOAD.libafs
 
 
-LIBAFSNONFSA = libafs.nonfs.a
-COPYFILES = copyfiles
-LINKFILES = linkfiles
 
-${INSTDIRS}: ${COPYFILES} ${LINKFILES}
+${INSTDIRS}: install_COPYFILES install_LINKFILES
+${DESTDIRS}: dest_COPYFILES dest_LINKFILES
 
-STATICCLIENTDIR = ${DESTDIR}root.client/bin
-MODLOADCLIENTDIR = ${DESTDIR}root.client/usr/vice/etc/sgiload
 
-# Make the NFS and no-NFS clients for this directory.
-# STATIC.libafs: ${LIBAFSNONFSA} ${COPYFILES} ${LINKFILES}
+
+LIBAFSNONFSA = libafs.nonfs.a
+
 STATIC.libafs: ${LIBAFSNONFSA}
+
 install_STATIC.libafs: ${LIBAFSNONFSA}
 <all -sgi_65>
        ${CP} ${LIBAFSNONFSA} \
-               ${STATICCLIENTDIR}/libafs.${MPSP}.${CPUARCH}.nonfs.a
+               ${DESTDIR}${afskerneldir}/libafs.${MPSP}.${CPUARCH}.nonfs.a
+<sgi_65>
+       ${CP} ${LIBAFSNONFSA} \
+               ${DESTDIR}${afskerneldir}/libafs.${IPNO}.nonfs.a
+<all>
+
+dest_STATIC.libafs: ${LIBAFSNONFSA}
+<all -sgi_65>
+       ${CP} ${LIBAFSNONFSA} \
+               ${DEST}/root.client/bin/libafs.${MPSP}.${CPUARCH}.nonfs.a
 <sgi_65>
        ${CP} ${LIBAFSNONFSA} \
-               ${STATICCLIENTDIR}/libafs.${IPNO}.nonfs.a
+               ${DEST}/root.client/bin/libafs.${IPNO}.nonfs.a
 <all>
 
 ${LIBAFSNONFSA}: $(AFSAOBJS) $(AFSNONFSOBJS)
        $(AR) cru  $@ $?
 
+
 LIBAFSNONFSO = libafs.nonfs.o
 
 # MODLOAD.libafs: ${LIBAFSNONFSO} ${COPYFILES} ${LINKFILES}
 MODLOAD.libafs: ${LIBAFSNONFSO}
+
 install_MODLOAD.libafs: ${LIBAFSNONFSO}
 <all -sgi_65>
        ${CP} ${LIBAFSNONFSO} \
-               ${MODLOADCLIENTDIR}/libafs.${MPSP}.${CPUARCH}.nonfs.o
+               ${DESTDIR}${afskerneldir}/libafs.${MPSP}.${CPUARCH}.nonfs.o
 <sgi_65>
        ${CP} ${LIBAFSNONFSO} \
-               ${MODLOADCLIENTDIR}/libafs.${IPNO}.nonfs.o
+               ${DESTDIR}${afskerneldir}/libafs.${IPNO}.nonfs.o
+<all>
+
+dest_MODLOAD.libafs: ${LIBAFSNONFSO}
+<all -sgi_65>
+       ${CP} ${LIBAFSNONFSO} \
+               ${DEST}/root.client/usr/vice/etc/sgiload/libafs.${MPSP}.${CPUARCH}.nonfs.o
+<sgi_65>
+       ${CP} ${LIBAFSNONFSO} \
+               ${DEST}/root.client/usr/vice/etc/sgiload/libafs.${IPNO}.nonfs.o
 <all>
 
 ${LIBAFSNONFSO}: $(AFSAOBJS) $(AFSNONFSOBJS)
        $(LD) ${LDFLAGS} -elf -r -d -G 0 -o ${LIBAFSNONFSO} \
                $(AFSAOBJS) $(AFSNONFSOBJS)
 
-${COPYFILES}:
-       ${CP} ../sgi_system ${STATICCLIENTDIR}/afs.sm
-       chmod 644 ${STATICCLIENTDIR}/afs.sm
-       ${CP} ../sgi_master ${STATICCLIENTDIR}/afs
-       chmod 644 ${STATICCLIENTDIR}/afs
+
+install_COPYFILES:
+       ${CP} sgi_system ${DESTDIR}${afskerneldir}/afs.sm
+       chmod 644 ${DESTDIR}${afskerneldir}/afs.sm
+       ${CP} sgi_master ${DESTDIR}${afskerneldir}/afs
+       chmod 644 ${DESTDIR}${afskerneldir}/afs
+
+dest_COPYFILES:
+       ${INSTALL} -d ${DEST}/root.client/bin
+       ${INSTALL} -m 644 sgi_system ${DEST}/root.client/bin/afs.sm
+       ${INSTALL} -m 644 sgi_master ${DEST}/root.client/bin/afs
+
+# Create symlinks to clients we don't need to build.
+# If this changes, also change the kdump symlinks.
+install_LINKFILES:
+<sgi_65>
+       echo "Now we support also IP22_4K, IP22_5K, IP32_5K, IP32_10K cpu boards."
+<all>
 
 # Create symlinks to clients we don't need to build.
 # If this changes, also change the kdump symlinks.
-${LINKFILES}:
+dest_LINKFILES:
 <sgi_65>
-       ln -fs  libafs.IP20.a       ${DESTDIR}root.client/bin/libafs.IP22.a
-       ln -fs  libafs.IP20.a       ${DESTDIR}root.client/bin/libafs.IP32.a
-       ln -fs  libafs.IP20.nonfs.a ${DESTDIR}root.client/bin/libafs.IP22.nonfs.a
-       ln -fs  libafs.IP20.nonfs.a ${DESTDIR}root.client/bin/libafs.IP32.nonfs.a
-       ln -fs  libafs.IP20.o       ${DESTDIR}root.client/usr/vice/etc/sgiload/libafs.IP22.o
-       ln -fs  libafs.IP20.o       ${DESTDIR}root.client/usr/vice/etc/sgiload/libafs.IP32.o
-       ln -fs  libafs.IP20.nonfs.o ${DESTDIR}root.client/usr/vice/etc/sgiload/libafs.IP22.nonfs.o
-       ln -fs  libafs.IP20.nonfs.o ${DESTDIR}root.client/usr/vice/etc/sgiload/libafs.IP32.nonfs.o
-
-       
-
-
-# Object build rules:
-# Common objects
-afs_base64.o: $(AFS)/afs_base64.c
-       $(CRULE1);
-osi_groups.o: $(AFS)/osi_groups.c
-       $(CRULE1);
-osi_idbg.o: $(AFS)/osi_idbg.c
-       $(CRULE1);
-osi_inode.o: $(AFS)/osi_inode.c
-       $(CRULE1);
-osi_file.o: $(AFS)/osi_file.c
-       $(CRULE1);
-osi_misc.o: $(AFS)/osi_misc.c
-       $(CRULE1);
-osi_sleep.o: $(AFS)/osi_sleep.c
-       $(CRULE1);
-osi_vfsops_nfs.o: $(AFS)/osi_vfsops.c
-       $(CRULE1) -o osi_vfsops_nfs.o;
-osi_vfsops.o: $(AFS)/osi_vfsops.c
-       $(CRULE1) -DAFS_NONFSTRANS;
-osi_vm.o: $(AFS)/osi_vm.c
-       $(CRULE1);
-osi_vnodeops.o: $(AFS)/osi_vnodeops.c
-       $(CRULE1);
-xdr_int64.o: $(RX)/xdr_int64.c
-       $(CRULE1);
+       ln -fs  libafs.IP20.a       ${DEST}/root.client/bin/libafs.IP22.a
+       ln -fs  libafs.IP20.a       ${DEST}/root.client/bin/libafs.IP32.a
+       ln -fs  libafs.IP20.nonfs.a ${DEST}/root.client/bin/libafs.IP22.nonfs.a
+       ln -fs  libafs.IP20.nonfs.a ${DEST}/root.client/bin/libafs.IP32.nonfs.a
+       ln -fs  libafs.IP20.o       ${DEST}/root.client/usr/vice/etc/sgiload/libafs.IP22.o
+       ln -fs  libafs.IP20.o       ${DEST}/root.client/usr/vice/etc/sgiload/libafs.IP32.o
+       ln -fs  libafs.IP20.nonfs.o ${DEST}/root.client/usr/vice/etc/sgiload/libafs.IP22.nonfs.o
+       ln -fs  libafs.IP20.nonfs.o ${DEST}/root.client/usr/vice/etc/sgiload/libafs.IP32.nonfs.o