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:
38 # System specific build commands and flags
42 <i386_linux22 i386_linux24>
43 CCFLAGS = -O2 -fomit-frame-pointer \
44 -fno-strength-reduce -pipe -march=i486 -malign-loops=2 -malign-jumps=2 \
46 DEFINES = -D__KERNEL__ -DCPU=586 -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF} ${KDEFINES}
47 <alpha_linux_22 alpha_linux_24>
48 CCFLAGS = -O2 -fomit-frame-pointer -fno-strength-reduce -pipe -mno-fp-regs -ffixed-8
49 DEFINES = -D__KERNEL__ -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF}
50 <s390_linux22 s390_linux24>
51 CCFLAGS = -O -fomit-frame-pointer -fno-strength-reduce \
52 -fno-strict-aliasing -fsigned-char
53 DEFINES = -D__KERNEL__ -D__s390__ -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF}
54 <sparc_linux22 sparc_linux24>
55 LD = ld -m elf32_sparc
56 CCFLAGS = -O2 -fomit-frame-pointer \
57 -fno-strength-reduce -pipe -mcpu=v8 -mno-fpu -fcall-used-g5 -fcall-used-g7
58 DEFINES = -D__KERNEL__ -DCPU=sparc -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF}
59 <sparc64_linux22 sparc64_linux24>
60 CC = sparc64-linux-gcc
61 LD = ld -m elf64_sparc
62 CCFLAGS = -O2 -fomit-frame-pointer \
63 -fno-strength-reduce -pipe -mcpu=ultrasparc -m64 -mno-fpu -mcmodel=medlow -ffixed-g4 -fcall-used-g5 -fcall-used-g7 -Wno-sign-compare
64 DEFINES = -D__KERNEL__ -DCPU=sparc64 -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF}
65 <ppc_linux22 ppc_linux24>
66 CCFLAGS = -O2 -fomit-frame-pointer -fno-strength-reduce \
67 -fno-strict-aliasing -fsigned-char -msoft-float -pipe \
68 -fno-builtin -ffixed-r2
69 DEFINES = -D__KERNEL__ -D__powerpc__ -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF}
71 CCFLAGS = -O2 -fomit-frame-pointer -fno-strict-aliasing -pipe \
72 -ffixed-r13 -mfixed-range=f10-f15,f32-f127 -falign-functions=32 -mb-step
73 DEFINES = -D__KERNEL__ -DKERNEL -D_KERNEL ${SMP_DEF} -DMODULE
75 INCLUDES = -I. -I../ -I${TOP_SRCDIR}/config
77 CFLAGS = $(CCFLAGS) $(DEFINES) $(INCLUDES)
79 # Name of directory to hold object files and libraries.
83 # COMPDIRS is called in Makefile.common to do the actual builds.
84 COMPDIRS=linux_compdirs
86 include Makefile.common
88 LINUX_VERS=@LINUX_VERSION@
89 LINUX_KERNEL_PATH=@LINUX_KERNEL_PATH@
94 -rm -f h net netinet sys rpc
96 for m in ${MPS} ; do \
97 KDIR=$(KOBJ)-${LINUX_VERS}${LINUX_MODULE_NAME}-$$m; \
99 ln -fs ../Makefile $${KDIR}/Makefile ; \
100 ln -fs ../Makefile.common $${KDIR}/Makefile.common; \
103 # Compile SP and MP clients as requested
107 ln -s ${LINUX_KERNEL_PATH}/include/linux h
109 ln -s ${LINUX_KERNEL_PATH}/include/linux linux
111 ln -s ${LINUX_KERNEL_PATH}/include/linux net
113 ln -s ${LINUX_KERNEL_PATH}/include/linux netinet
115 ln -s ${LINUX_KERNEL_PATH}/include/linux sys
117 ln -s ${LINUX_KERNEL_PATH}/include/asm-generic asm-generic
119 <alpha_linux_22 alpha_linux_24>
120 ln -s ${LINUX_KERNEL_PATH}/include/asm-alpha asm
121 <i386_linux22 i386_linux24>
122 ln -s ${LINUX_KERNEL_PATH}/include/asm-i386 asm
123 <s390_linux22 s390_linux24>
124 ln -s ${LINUX_KERNEL_PATH}/include/asm-s390 asm
125 <ppc_linux22 ppc_linux24>
126 ln -s ${LINUX_KERNEL_PATH}/include/asm-ppc asm
127 <sparc_linux22 sparc_linux24>
128 ln -s ${LINUX_KERNEL_PATH}/include/asm-sparc asm
129 <sparc64_linux22 sparc64_linux24>
130 ln -s ${LINUX_KERNEL_PATH}/include/asm-sparc64 asm
132 ln -s ${LINUX_KERNEL_PATH}/include/asm-ia64 asm
134 for m in ${MPS} ; do \
135 KDIR=${KOBJ}-${LINUX_VERS}${LINUX_MODULE_NAME}-$$m ; \
136 echo Building in directory: $${KDIR} ; \
137 if [ "$$m" = "MP" ] ; then \
138 SMP_DEF="-DAFS_SMP @RHCONFIG_MP@ ${LOCAL_SMP_DEF}" ; \
141 SMP_DEF="@RHCONFIG_SP@ ${LOCAL_SMP_DEF}" ; \
145 $(MAKE) SMP_DEF="$${SMP_DEF}" $${TARG} CLIENT=${LINUX_VERS}${LINUX_MODULE_NAME} || exit $$?; \
150 # Below this line are targets when in the COMMON directory:
151 # For Linux there is no kernel NFS server.
152 LIBAFS = libafs-${CLIENT}.o
153 LIBAFS_MP = libafs-${CLIENT}.mp.o
155 DEST_LIBAFS = ${DESTDIR}/root.client/usr/vice/etc/modload/${LIBAFS}
156 DEST_LIBAFS_MP = ${DESTDIR}/root.client/usr/vice/etc/modload/${LIBAFS_MP}
159 libafs: $(DEST_LIBAFS)
160 echo SP Build Complete
162 libafs.mp: $(DEST_LIBAFS_MP)
163 echo MP Build Complete
165 $(DEST_LIBAFS): $(LIBAFS)
168 $(DEST_LIBAFS_MP): $(LIBAFS_MP)
171 ${LIBAFS}: $(AFSAOBJS) $(AFSNONFSOBJS)
173 $(LD) -r -o $@ $(AFSAOBJS) $(AFSNONFSOBJS)
175 ${LIBAFS_MP}: $(AFSAOBJS) $(AFSNONFSOBJS)
177 $(LD) -r -o $@ $(AFSAOBJS) $(AFSNONFSOBJS)
180 # Linux specific objects
181 osi_alloc.o: $(AFS)/osi_alloc.c
183 osi_cred.o: $(AFS)/osi_cred.c
185 osi_groups.o: $(AFS)/osi_groups.c
187 osi_file.o: $(AFS)/osi_file.c
189 osi_inode.o: $(AFS)/osi_inode.c
191 osi_misc.o: $(AFS)/osi_misc.c
193 osi_module.o: $(AFS)/osi_module.c
195 osi_sleep.o: $(AFS)/osi_sleep.c
197 osi_vfsops.o: $(AFS)/osi_vfsops.c
199 osi_vm.o: $(AFS)/osi_vm.c
201 osi_vnodeops.o: $(AFS)/osi_vnodeops.c
205 xdr_int64.o: $(RX)/xdr_int64.c
207 xdr_array.o: $(RX)/xdr_array.c