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
11 TOP_INCDIR=@TOP_INCDIR@
12 TOP_LIBDIR=@TOP_LIBDIR@
13 TOP_SRCDIR=@TOP_SRCDIR@
14 TOP_OBJDIR=@TOP_OBJDIR@
18 exec_prefix=@exec_prefix@
21 libexecdir=@libexecdir@
23 includedir=@includedir@
25 afssrvbindir=@afssrvbindir@
26 afssrvsbindir=@afssrvsbindir@
27 afssrvlibexecdir=@afssrvlibexecdir@
28 afskerneldir=@afskerneldir@
29 SYS_NAME=@AFS_SYSNAME@
31 include config/Makefile.${SYS_NAME}
33 # OS specific object files:
55 # System specific build commands and flags
59 <i386_linux22 i386_linux24>
60 CCFLAGS = -O2 -fomit-frame-pointer \
61 -fno-strength-reduce -pipe -march=i486 -malign-loops=2 -malign-jumps=2 \
63 DEFINES = -D__KERNEL__ -DCPU=586 -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF} ${KDEFINES}
64 <alpha_linux_22 alpha_linux_24>
65 CCFLAGS = -O2 -fomit-frame-pointer -fno-strength-reduce -pipe -mno-fp-regs -ffixed-8
66 DEFINES = -D__KERNEL__ -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF}
67 <s390_linux22 s390_linux24>
68 CCFLAGS = -O -fomit-frame-pointer -fno-strength-reduce \
69 -fno-strict-aliasing -fsigned-char
70 DEFINES = -D__KERNEL__ -D__s390__ -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF}
71 <sparc_linux22 sparc_linux24>
72 LD = ld -m elf32_sparc
73 CCFLAGS = -O2 -fomit-frame-pointer \
74 -fno-strength-reduce -pipe -mcpu=v8 -mno-fpu -fcall-used-g5 -fcall-used-g7
75 DEFINES = -D__KERNEL__ -DCPU=sparc -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF}
76 <sparc64_linux22 sparc64_linux24>
77 CC = sparc64-linux-gcc
78 LD = ld -m elf64_sparc
79 CCFLAGS = -O2 -fomit-frame-pointer \
80 -fno-strength-reduce -pipe -mcpu=ultrasparc -m64 -mno-fpu -mcmodel=medlow -ffixed-g4 -fcall-used-g5 -fcall-used-g7 -Wno-sign-compare
81 DEFINES = -D__KERNEL__ -DCPU=sparc64 -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF}
82 <ppc_linux22 ppc_linux24>
83 CCFLAGS = -O2 -fomit-frame-pointer -fno-strength-reduce \
84 -fno-strict-aliasing -fsigned-char -msoft-float -pipe \
85 -fno-builtin -ffixed-r2
86 DEFINES = -D__KERNEL__ -D__powerpc__ -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF}
88 CCFLAGS = -O2 -fomit-frame-pointer -fno-strict-aliasing -fno-common -fno-strength-reduce \
89 -fno-strict-aliasing -fsigned-char -mno-space-regs -mfast-indirect-calls \
90 -mdisable-fpregs -ffunction-sections -march=1.1 -mschedule=7100
91 DEFINES = -D__KERNEL__ -D__linux__ -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF}
93 CCFLAGS = -O2 -fomit-frame-pointer -fno-strict-aliasing -pipe \
94 -ffixed-r13 -mfixed-range=f10-f15,f32-f127 -falign-functions=32 -mb-step
95 DEFINES = -D__KERNEL__ -DKERNEL -D_KERNEL ${SMP_DEF} -DMODULE
97 INCLUDES = -I. -I../ -I${TOP_OBJDIR}/src/config
99 CFLAGS = $(CCFLAGS) $(DEFINES) $(INCLUDES)
101 # Name of directory to hold object files and libraries.
105 # COMPDIRS is called in Makefile.common to do the actual builds.
106 COMPDIRS=linux_compdirs
107 INSTDIRS=linux_instdirs
108 DESTDIRS=linux_destdirs
110 include Makefile.common
112 LINUX_VERS=@LINUX_VERSION@
113 LINUX_KERNEL_PATH=@LINUX_KERNEL_PATH@
118 -$(RM) -f h net netinet sys rpc
120 for m in ${MPS} ; do \
121 KDIR=$(KOBJ)-${LINUX_VERS}${LINUX_MODULE_NAME}-$$m; \
123 ln -fs ../Makefile $${KDIR}/Makefile ; \
124 ln -fs ../Makefile.common $${KDIR}/Makefile.common; \
125 ln -fs ../config $${KDIR}/config; \
128 # Compile SP and MP clients as requested
130 ${COMPDIRS} ${INSTDIRS} ${DESTDIRS}:
132 ln -fs ${LINUX_KERNEL_PATH}/include/linux h
134 ln -fs ${LINUX_KERNEL_PATH}/include/linux linux
136 ln -fs ${LINUX_KERNEL_PATH}/include/linux net
138 ln -fs ${LINUX_KERNEL_PATH}/include/linux netinet
140 ln -fs ${LINUX_KERNEL_PATH}/include/linux sys
142 ln -fs ${LINUX_KERNEL_PATH}/include/asm-generic asm-generic
144 <alpha_linux_22 alpha_linux_24>
145 ln -fs ${LINUX_KERNEL_PATH}/include/asm-alpha asm
146 <i386_linux22 i386_linux24>
147 ln -fs ${LINUX_KERNEL_PATH}/include/asm-i386 asm
148 <s390_linux22 s390_linux24>
149 ln -fs ${LINUX_KERNEL_PATH}/include/asm-s390 asm
150 <ppc_linux22 ppc_linux24>
151 ln -fs ${LINUX_KERNEL_PATH}/include/asm-ppc asm
152 <sparc_linux22 sparc_linux24>
153 ln -fs ${LINUX_KERNEL_PATH}/include/asm-sparc asm
154 <sparc64_linux22 sparc64_linux24>
155 ln -fs ${LINUX_KERNEL_PATH}/include/asm-sparc64 asm
157 ln -fs ${LINUX_KERNEL_PATH}/include/asm-ia64 asm
159 for m in ${MPS} ; do \
160 KDIR=${KOBJ}-${LINUX_VERS}${LINUX_MODULE_NAME}-$$m ; \
161 echo Building in directory: $${KDIR} ; \
162 if [ "$$m" = "MP" ] ; then \
163 SMP_DEF="-DAFS_SMP @RHCONFIG_MP@ ${LOCAL_SMP_DEF}" ; \
165 elif [ "$$m" = "EP" ] ; then \
166 SMP_DEF="-DAFS_SMP @RHCONFIG_MP@ ${LOCAL_SMP_DEF}" ; \
169 SMP_DEF="@RHCONFIG_SP@ ${LOCAL_SMP_DEF}" ; \
173 $(MAKE) SMP_DEF="$${SMP_DEF}" $@_$${TARG} CLIENT=${LINUX_VERS}${LINUX_MODULE_NAME} || exit $$?; \
177 linux_compdirs_libafs: libafs
178 linux_compdirs_libafs.mp: libafs.mp
179 linux_compdirs_libafs.ep: libafs.ep
180 linux_instdirs_libafs: install_libafs
181 linux_instdirs_libafs.mp: install_libafs.mp
182 linux_instdirs_libafs.ep: install_libafs.ep
183 linux_destdirs_libafs: dest_libafs
184 linux_destdirs_libafs.mp: dest_libafs.mp
185 linux_destdirs_libafs.ep: dest_libafs.ep
188 # Below this line are targets when in the COMMON directory:
189 # For Linux there is no kernel NFS server.
190 LIBAFS = libafs-${CLIENT}.o
191 LIBAFS_MP = libafs-${CLIENT}.mp.o
192 LIBAFS_EP = libafs-${CLIENT}.ep.o
194 INST_LIBAFS = ${DESTDIR}${afskerneldir}/${LIBAFS}
195 INST_LIBAFS_MP = ${DESTDIR}${afskerneldir}/${LIBAFS_MP}
196 INST_LIBAFS_EP = ${DESTDIR}${afskerneldir}/${LIBAFS_EP}
198 DEST_LIBAFS = ${DEST}/root.client/usr/vice/etc/modload/${LIBAFS}
199 DEST_LIBAFS_MP = ${DEST}/root.client/usr/vice/etc/modload/${LIBAFS_MP}
200 DEST_LIBAFS_EP = ${DEST}/root.client/usr/vice/etc/modload/${LIBAFS_EP}
204 echo SP Build Complete
206 libafs.mp: $(LIBAFS_MP)
207 echo MP Build Complete
209 libafs.ep: $(LIBAFS_EP)
210 echo EP Build Complete
212 ${LIBAFS}: $(AFSAOBJS) $(AFSNONFSOBJS)
214 $(LD) -r -o $@ $(AFSAOBJS) $(AFSNONFSOBJS)
216 ${LIBAFS_MP}: $(AFSAOBJS) $(AFSNONFSOBJS)
218 $(LD) -r -o $@ $(AFSAOBJS) $(AFSNONFSOBJS)
220 ${LIBAFS_EP}: $(AFSAOBJS) $(AFSNONFSOBJS)
222 $(LD) -r -o $@ $(AFSAOBJS) $(AFSNONFSOBJS)
224 install_libafs: $(INST_LIBAFS)
225 echo SP Install Complete
227 install_libafs.mp: $(INST_LIBAFS_MP)
228 echo MP Install Complete
230 install_libafs.ep: $(INST_LIBAFS_EP)
231 echo EP Install Complete
233 dest_libafs: $(DEST_LIBAFS)
234 echo SP Install Complete
236 dest_libafs.mp: $(DEST_LIBAFS_MP)
237 echo MP Install Complete
239 dest_libafs.ep: $(DEST_LIBAFS_EP)
240 echo EP Install Complete
242 $(INST_LIBAFS): $(LIBAFS)
245 $(INST_LIBAFS_MP): $(LIBAFS_MP)
248 $(INST_LIBAFS_EP): $(LIBAFS_EP)
251 $(DEST_LIBAFS): $(LIBAFS)
254 $(DEST_LIBAFS_MP): $(LIBAFS_MP)
257 $(DEST_LIBAFS_EP): $(LIBAFS_EP)
261 # Linux specific objects
262 osi_alloc.o: $(AFS)/osi_alloc.c
264 osi_cred.o: $(AFS)/osi_cred.c
266 osi_groups.o: $(AFS)/osi_groups.c
268 osi_file.o: $(AFS)/osi_file.c
270 osi_inode.o: $(AFS)/osi_inode.c
272 osi_misc.o: $(AFS)/osi_misc.c
274 osi_module.o: $(AFS)/osi_module.c
276 osi_sleep.o: $(AFS)/osi_sleep.c
278 osi_vfsops.o: $(AFS)/osi_vfsops.c
280 osi_vm.o: $(AFS)/osi_vm.c
282 osi_vnodeops.o: $(AFS)/osi_vnodeops.c
286 xdr_int64.o: $(RX)/xdr_int64.c
288 xdr_array.o: $(RX)/xdr_array.c