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
86 INSTDIRS=linux_instdirs
88 include Makefile.common
90 LINUX_VERS=@LINUX_VERSION@
91 LINUX_KERNEL_PATH=@LINUX_KERNEL_PATH@
96 -rm -f h net netinet sys rpc
98 for m in ${MPS} ; do \
99 KDIR=$(KOBJ)-${LINUX_VERS}${LINUX_MODULE_NAME}-$$m; \
101 ln -fs ../Makefile $${KDIR}/Makefile ; \
102 ln -fs ../Makefile.common $${KDIR}/Makefile.common; \
103 ln -fs ../config $${KDIR}/config; \
106 # Compile SP and MP clients as requested
108 ${COMPDIRS} ${INSTDIRS}:
110 ln -s ${LINUX_KERNEL_PATH}/include/linux h
112 ln -s ${LINUX_KERNEL_PATH}/include/linux linux
114 ln -s ${LINUX_KERNEL_PATH}/include/linux net
116 ln -s ${LINUX_KERNEL_PATH}/include/linux netinet
118 ln -s ${LINUX_KERNEL_PATH}/include/linux sys
120 ln -s ${LINUX_KERNEL_PATH}/include/asm-generic asm-generic
122 <alpha_linux_22 alpha_linux_24>
123 ln -s ${LINUX_KERNEL_PATH}/include/asm-alpha asm
124 <i386_linux22 i386_linux24>
125 ln -s ${LINUX_KERNEL_PATH}/include/asm-i386 asm
126 <s390_linux22 s390_linux24>
127 ln -s ${LINUX_KERNEL_PATH}/include/asm-s390 asm
128 <ppc_linux22 ppc_linux24>
129 ln -s ${LINUX_KERNEL_PATH}/include/asm-ppc asm
130 <sparc_linux22 sparc_linux24>
131 ln -s ${LINUX_KERNEL_PATH}/include/asm-sparc asm
132 <sparc64_linux22 sparc64_linux24>
133 ln -s ${LINUX_KERNEL_PATH}/include/asm-sparc64 asm
135 ln -s ${LINUX_KERNEL_PATH}/include/asm-ia64 asm
137 for m in ${MPS} ; do \
138 KDIR=${KOBJ}-${LINUX_VERS}${LINUX_MODULE_NAME}-$$m ; \
139 echo Building in directory: $${KDIR} ; \
140 if [ "$$m" = "MP" ] ; then \
141 SMP_DEF="-DAFS_SMP @RHCONFIG_MP@ ${LOCAL_SMP_DEF}" ; \
144 SMP_DEF="@RHCONFIG_SP@ ${LOCAL_SMP_DEF}" ; \
148 $(MAKE) SMP_DEF="$${SMP_DEF}" $${TARG} CLIENT=${LINUX_VERS}${LINUX_MODULE_NAME} || exit $$?; \
152 linux_compdirs_libafs: libafs
153 linux_compdirs_libafs.mp: libafs.mp
154 linux_instdirs_libafs: install_libafs
155 linux_instdirs_libafs.mp: install_libafs.mp
158 # Below this line are targets when in the COMMON directory:
159 # For Linux there is no kernel NFS server.
160 LIBAFS = libafs-${CLIENT}.o
161 LIBAFS_MP = libafs-${CLIENT}.mp.o
163 DEST_LIBAFS = ${DESTDIR}/root.client/usr/vice/etc/modload/${LIBAFS}
164 DEST_LIBAFS_MP = ${DESTDIR}/root.client/usr/vice/etc/modload/${LIBAFS_MP}
168 echo SP Build Complete
170 libafs.mp: $(LIBAFS_MP)
171 echo MP Build Complete
173 ${LIBAFS}: $(AFSAOBJS) $(AFSNONFSOBJS)
175 $(LD) -r -o $@ $(AFSAOBJS) $(AFSNONFSOBJS)
177 ${LIBAFS_MP}: $(AFSAOBJS) $(AFSNONFSOBJS)
179 $(LD) -r -o $@ $(AFSAOBJS) $(AFSNONFSOBJS)
181 install_libafs: $(DEST_LIBAFS)
182 echo SP Install Complete
184 install_libafs.mp: $(DEST_LIBAFS_MP)
185 echo MP Install Complete
187 $(DEST_LIBAFS): $(LIBAFS)
190 $(DEST_LIBAFS_MP): $(LIBAFS_MP)
194 # Linux specific objects
195 osi_alloc.o: $(AFS)/osi_alloc.c
197 osi_cred.o: $(AFS)/osi_cred.c
199 osi_groups.o: $(AFS)/osi_groups.c
201 osi_file.o: $(AFS)/osi_file.c
203 osi_inode.o: $(AFS)/osi_inode.c
205 osi_misc.o: $(AFS)/osi_misc.c
207 osi_module.o: $(AFS)/osi_module.c
209 osi_sleep.o: $(AFS)/osi_sleep.c
211 osi_vfsops.o: $(AFS)/osi_vfsops.c
213 osi_vm.o: $(AFS)/osi_vm.c
215 osi_vnodeops.o: $(AFS)/osi_vnodeops.c
219 xdr_int64.o: $(RX)/xdr_int64.c
221 xdr_array.o: $(RX)/xdr_array.c