1 # Copyright 2000, International Business Machines Corporation and others.
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
8 # MakefileProto for Linux i386 systems
12 TOP_SRCDIR=@TOP_SRCDIR@
13 SYS_NAME=@AFS_SYSNAME@
15 include ../config/Makefile.${SYS_NAME}
17 # OS specific object files:
39 # System specific build commands and flags
43 <i386_linux22 i386_linux24>
44 CCFLAGS = -O2 -fomit-frame-pointer \
45 -fno-strength-reduce -pipe -march=i486 -malign-loops=2 -malign-jumps=2 \
47 DEFINES = -D__KERNEL__ -DCPU=586 -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF} ${KDEFINES}
48 <alpha_linux_22 alpha_linux_24>
49 CCFLAGS = -O2 -fomit-frame-pointer -fno-strength-reduce -pipe -mno-fp-regs -ffixed-8
50 DEFINES = -D__KERNEL__ -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF}
51 <s390_linux22 s390_linux24>
52 CCFLAGS = -O -fomit-frame-pointer -fno-strength-reduce \
53 -fno-strict-aliasing -fsigned-char
54 DEFINES = -D__KERNEL__ -D__s390__ -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF}
55 <sparc_linux22 sparc_linux24>
56 LD = ld -m elf32_sparc
57 CCFLAGS = -O2 -fomit-frame-pointer \
58 -fno-strength-reduce -pipe -mcpu=v8 -mno-fpu -fcall-used-g5 -fcall-used-g7
59 DEFINES = -D__KERNEL__ -DCPU=sparc -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF}
60 <sparc64_linux22 sparc64_linux24>
61 CC = sparc64-linux-gcc
62 LD = ld -m elf64_sparc
63 CCFLAGS = -O2 -fomit-frame-pointer \
64 -fno-strength-reduce -pipe -mcpu=ultrasparc -m64 -mno-fpu -mcmodel=medlow -ffixed-g4 -fcall-used-g5 -fcall-used-g7 -Wno-sign-compare
65 DEFINES = -D__KERNEL__ -DCPU=sparc64 -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF}
66 <ppc_linux22 ppc_linux24>
67 CCFLAGS = -O2 -fomit-frame-pointer -fno-strength-reduce \
68 -fno-strict-aliasing -fsigned-char -msoft-float -pipe \
69 -fno-builtin -ffixed-r2
70 DEFINES = -D__KERNEL__ -D__powerpc__ -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF}
72 CCFLAGS = -O2 -fomit-frame-pointer -fno-strict-aliasing -pipe \
73 -ffixed-r13 -mfixed-range=f10-f15,f32-f127 -falign-functions=32 -mb-step
74 DEFINES = -D__KERNEL__ -DKERNEL -D_KERNEL ${SMP_DEF} -DMODULE
76 INCLUDES = -I. -I../ -I${TOP_SRCDIR}/config
78 CFLAGS = $(CCFLAGS) $(DEFINES) $(INCLUDES)
80 # Name of directory to hold object files and libraries.
84 # COMPDIRS is called in Makefile.common to do the actual builds.
85 COMPDIRS=linux_compdirs
87 include Makefile.common
89 LINUX_VERS=@LINUX_VERSION@
90 LINUX_KERNEL_PATH=@LINUX_KERNEL_PATH@
95 -rm -f h net netinet sys rpc
97 for m in ${MPS} ; do \
98 KDIR=$(KOBJ)-${LINUX_VERS}${LINUX_MODULE_NAME}-$$m; \
100 ln -fs ../Makefile $${KDIR}/Makefile ; \
101 ln -fs ../Makefile.common $${KDIR}/Makefile.common; \
104 # Compile SP and MP clients as requested
108 ln -s ${LINUX_KERNEL_PATH}/include/linux h
110 ln -s ${LINUX_KERNEL_PATH}/include/linux linux
112 ln -s ${LINUX_KERNEL_PATH}/include/linux net
114 ln -s ${LINUX_KERNEL_PATH}/include/linux netinet
116 ln -s ${LINUX_KERNEL_PATH}/include/linux sys
118 ln -s ${LINUX_KERNEL_PATH}/include/asm-generic asm-generic
120 <alpha_linux_22 alpha_linux_24>
121 ln -s ${LINUX_KERNEL_PATH}/include/asm-alpha asm
122 <i386_linux22 i386_linux24>
123 ln -s ${LINUX_KERNEL_PATH}/include/asm-i386 asm
124 <s390_linux22 s390_linux24>
125 ln -s ${LINUX_KERNEL_PATH}/include/asm-s390 asm
126 <ppc_linux22 ppc_linux24>
127 ln -s ${LINUX_KERNEL_PATH}/include/asm-ppc asm
128 <sparc_linux22 sparc_linux24>
129 ln -s ${LINUX_KERNEL_PATH}/include/asm-sparc asm
130 <sparc64_linux22 sparc64_linux24>
131 ln -s ${LINUX_KERNEL_PATH}/include/asm-sparc64 asm
133 ln -s ${LINUX_KERNEL_PATH}/include/asm-ia64 asm
135 for m in ${MPS} ; do \
136 KDIR=${KOBJ}-${LINUX_VERS}${LINUX_MODULE_NAME}-$$m ; \
137 echo Building in directory: $${KDIR} ; \
138 if [ "$$m" = "MP" ] ; then \
139 SMP_DEF="-DAFS_SMP @RHCONFIG_MP@ ${LOCAL_SMP_DEF}" ; \
142 SMP_DEF="@RHCONFIG_SP@ ${LOCAL_SMP_DEF}" ; \
146 $(MAKE) SMP_DEF="$${SMP_DEF}" $${TARG} CLIENT=${LINUX_VERS}${LINUX_MODULE_NAME} || exit $$?; \
151 # Below this line are targets when in the COMMON directory:
152 # For Linux there is no kernel NFS server.
153 LIBAFS = libafs-${CLIENT}.o
154 LIBAFS_MP = libafs-${CLIENT}.mp.o
156 DEST_LIBAFS = ${DESTDIR}/root.client/usr/vice/etc/modload/${LIBAFS}
157 DEST_LIBAFS_MP = ${DESTDIR}/root.client/usr/vice/etc/modload/${LIBAFS_MP}
160 libafs: $(DEST_LIBAFS)
161 echo SP Build Complete
163 libafs.mp: $(DEST_LIBAFS_MP)
164 echo MP Build Complete
166 $(DEST_LIBAFS): $(LIBAFS)
169 $(DEST_LIBAFS_MP): $(LIBAFS_MP)
172 ${LIBAFS}: $(AFSAOBJS) $(AFSNONFSOBJS)
174 $(LD) -r -o $@ $(AFSAOBJS) $(AFSNONFSOBJS)
176 ${LIBAFS_MP}: $(AFSAOBJS) $(AFSNONFSOBJS)
178 $(LD) -r -o $@ $(AFSAOBJS) $(AFSNONFSOBJS)
181 # Linux specific objects
182 osi_alloc.o: $(AFS)/osi_alloc.c
184 osi_cred.o: $(AFS)/osi_cred.c
186 osi_groups.o: $(AFS)/osi_groups.c
188 osi_file.o: $(AFS)/osi_file.c
190 osi_inode.o: $(AFS)/osi_inode.c
192 osi_misc.o: $(AFS)/osi_misc.c
194 osi_module.o: $(AFS)/osi_module.c
196 osi_sleep.o: $(AFS)/osi_sleep.c
198 osi_vfsops.o: $(AFS)/osi_vfsops.c
200 osi_vm.o: $(AFS)/osi_vm.c
202 osi_vnodeops.o: $(AFS)/osi_vnodeops.c
206 xdr_int64.o: $(RX)/xdr_int64.c
208 xdr_array.o: $(RX)/xdr_array.c