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
9 include @TOP_OBJDIR@/src/config/Makefile.config
12 # OS specific object files:
35 # System specific build commands and flags
39 <i386_linux22 i386_linux24>
40 CCFLAGS = -O2 -fomit-frame-pointer \
41 -fno-strength-reduce -pipe -march=i486 -malign-loops=2 -malign-jumps=2 \
43 DEFINES = -D__KERNEL__ -DCPU=586 -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF} ${KDEFINES}
44 <alpha_linux_22 alpha_linux_24>
45 CCFLAGS = -O2 -fomit-frame-pointer -fno-strength-reduce -pipe -mno-fp-regs -ffixed-8
46 DEFINES = -D__KERNEL__ -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF}
47 <s390_linux22 s390_linux24>
48 CCFLAGS = -O -fomit-frame-pointer -fno-strength-reduce \
49 -fno-strict-aliasing -fsigned-char
50 DEFINES = -D__KERNEL__ -D__s390__ -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF}
51 <sparc_linux22 sparc_linux24>
52 LD = ld -m elf32_sparc
53 CCFLAGS = -O2 -fomit-frame-pointer \
54 -fno-strength-reduce -pipe -mcpu=v8 -mno-fpu -fcall-used-g5 -fcall-used-g7
55 DEFINES = -D__KERNEL__ -DCPU=sparc -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF}
56 <sparc64_linux22 sparc64_linux24>
57 CC = sparc64-linux-gcc
58 LD = ld -m elf64_sparc
59 CCFLAGS = -O2 -fomit-frame-pointer \
60 -fno-strength-reduce -pipe -mcpu=ultrasparc -m64 -mno-fpu -mcmodel=medlow -ffixed-g4 -fcall-used-g5 -fcall-used-g7 -Wno-sign-compare
61 DEFINES = -D__KERNEL__ -DCPU=sparc64 -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF}
62 <ppc_linux22 ppc_linux24>
63 CCFLAGS = -O2 -fomit-frame-pointer -fno-strength-reduce \
64 -fno-strict-aliasing -fsigned-char -msoft-float -pipe \
65 -fno-builtin -ffixed-r2
66 DEFINES = -D__KERNEL__ -D__powerpc__ -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF}
68 CCFLAGS = -O2 -fomit-frame-pointer -fno-strict-aliasing -fno-common -fno-strength-reduce \
69 -fno-strict-aliasing -fsigned-char -mno-space-regs -mfast-indirect-calls \
70 -mdisable-fpregs -ffunction-sections -march=1.1 -mschedule=7100
71 DEFINES = -D__KERNEL__ -D__linux__ -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF}
73 CCFLAGS = -O2 -fomit-frame-pointer -fno-strict-aliasing -pipe \
74 -ffixed-r13 -mfixed-range=f10-f15,f32-f127 -falign-functions=32 -mb-step
75 DEFINES = -D__KERNEL__ -DKERNEL -D_KERNEL ${SMP_DEF} -DMODULE
77 INCLUDES = -I. -I../ -I${TOP_OBJDIR}/src/config
79 CFLAGS = $(CCFLAGS) $(DEFINES) $(INCLUDES)
81 # Name of directory to hold object files and libraries.
85 # COMPDIRS is called in Makefile.common to do the actual builds.
86 COMPDIRS=linux_compdirs
87 INSTDIRS=linux_instdirs
88 DESTDIRS=linux_destdirs
90 include Makefile.common
92 LINUX_KERNEL_PATH=@LINUX_KERNEL_PATH@
97 -$(RM) -f h net netinet sys rpc
99 for m in ${MPS} ; do \
100 KDIR=$(KOBJ)-${LINUX_VERSION}${LINUX_MODULE_NAME}-$$m; \
102 ln -fs ../Makefile $${KDIR}/Makefile ; \
103 ln -fs ../Makefile.common $${KDIR}/Makefile.common; \
104 ln -fs ../config $${KDIR}/config; \
107 # Compile SP and MP clients as requested
109 ${COMPDIRS} ${INSTDIRS} ${DESTDIRS}:
111 ln -fs ${LINUX_KERNEL_PATH}/include/linux h
113 ln -fs ${LINUX_KERNEL_PATH}/include/linux linux
115 ln -fs ${LINUX_KERNEL_PATH}/include/linux net
117 ln -fs ${LINUX_KERNEL_PATH}/include/linux netinet
119 ln -fs ${LINUX_KERNEL_PATH}/include/linux sys
121 ln -fs ${LINUX_KERNEL_PATH}/include/asm-generic asm-generic
123 <alpha_linux_22 alpha_linux_24>
124 ln -fs ${LINUX_KERNEL_PATH}/include/asm-alpha asm
125 <i386_linux22 i386_linux24>
126 ln -fs ${LINUX_KERNEL_PATH}/include/asm-i386 asm
127 <s390_linux22 s390_linux24>
128 ln -fs ${LINUX_KERNEL_PATH}/include/asm-s390 asm
129 <ppc_linux22 ppc_linux24>
130 ln -fs ${LINUX_KERNEL_PATH}/include/asm-ppc asm
131 <sparc_linux22 sparc_linux24>
132 ln -fs ${LINUX_KERNEL_PATH}/include/asm-sparc asm
133 <sparc64_linux22 sparc64_linux24>
134 ln -fs ${LINUX_KERNEL_PATH}/include/asm-sparc64 asm
136 ln -fs ${LINUX_KERNEL_PATH}/include/asm-ia64 asm
138 for m in ${MPS} ; do \
139 KDIR=${KOBJ}-${LINUX_VERSION}${LINUX_MODULE_NAME}-$$m ; \
140 echo Building in directory: $${KDIR} ; \
141 if [ "$$m" = "MP" ] ; then \
142 SMP_DEF="-DAFS_SMP @RHCONFIG_MP@ ${LOCAL_SMP_DEF}" ; \
144 elif [ "$$m" = "EP" ] ; then \
145 SMP_DEF="-DAFS_SMP @RHCONFIG_MP@ ${LOCAL_SMP_DEF}" ; \
148 SMP_DEF="@RHCONFIG_SP@ ${LOCAL_SMP_DEF}" ; \
152 $(MAKE) SMP_DEF="$${SMP_DEF}" $@_$${TARG} CLIENT=${LINUX_VERSION}${LINUX_MODULE_NAME} || exit $$?; \
156 linux_compdirs_libafs: libafs
157 linux_compdirs_libafs.mp: libafs.mp
158 linux_compdirs_libafs.ep: libafs.ep
159 linux_instdirs_libafs: install_libafs
160 linux_instdirs_libafs.mp: install_libafs.mp
161 linux_instdirs_libafs.ep: install_libafs.ep
162 linux_destdirs_libafs: dest_libafs
163 linux_destdirs_libafs.mp: dest_libafs.mp
164 linux_destdirs_libafs.ep: dest_libafs.ep
167 # Below this line are targets when in the COMMON directory:
168 # For Linux there is no kernel NFS server.
169 LIBAFS = libafs-${CLIENT}.o
170 LIBAFS_MP = libafs-${CLIENT}.mp.o
171 LIBAFS_EP = libafs-${CLIENT}.ep.o
173 INST_LIBAFS = ${DESTDIR}${afskerneldir}/${LIBAFS}
174 INST_LIBAFS_MP = ${DESTDIR}${afskerneldir}/${LIBAFS_MP}
175 INST_LIBAFS_EP = ${DESTDIR}${afskerneldir}/${LIBAFS_EP}
177 DEST_LIBAFS = ${DEST}/root.client/usr/vice/etc/modload/${LIBAFS}
178 DEST_LIBAFS_MP = ${DEST}/root.client/usr/vice/etc/modload/${LIBAFS_MP}
179 DEST_LIBAFS_EP = ${DEST}/root.client/usr/vice/etc/modload/${LIBAFS_EP}
183 echo SP Build Complete
185 libafs.mp: $(LIBAFS_MP)
186 echo MP Build Complete
188 libafs.ep: $(LIBAFS_EP)
189 echo EP Build Complete
191 ${LIBAFS}: $(AFSAOBJS) $(AFSNONFSOBJS)
193 $(LD) -r -o $@ $(AFSAOBJS) $(AFSNONFSOBJS)
195 ${LIBAFS_MP}: $(AFSAOBJS) $(AFSNONFSOBJS)
197 $(LD) -r -o $@ $(AFSAOBJS) $(AFSNONFSOBJS)
199 ${LIBAFS_EP}: $(AFSAOBJS) $(AFSNONFSOBJS)
201 $(LD) -r -o $@ $(AFSAOBJS) $(AFSNONFSOBJS)
203 install_libafs: $(INST_LIBAFS)
204 echo SP Install Complete
206 install_libafs.mp: $(INST_LIBAFS_MP)
207 echo MP Install Complete
209 install_libafs.ep: $(INST_LIBAFS_EP)
210 echo EP Install Complete
212 dest_libafs: $(DEST_LIBAFS)
213 echo SP Install Complete
215 dest_libafs.mp: $(DEST_LIBAFS_MP)
216 echo MP Install Complete
218 dest_libafs.ep: $(DEST_LIBAFS_EP)
219 echo EP Install Complete
221 $(INST_LIBAFS): $(LIBAFS)
224 $(INST_LIBAFS_MP): $(LIBAFS_MP)
227 $(INST_LIBAFS_EP): $(LIBAFS_EP)
230 $(DEST_LIBAFS): $(LIBAFS)
233 $(DEST_LIBAFS_MP): $(LIBAFS_MP)
236 $(DEST_LIBAFS_EP): $(LIBAFS_EP)
240 # Linux specific objects
241 osi_alloc.o: $(AFS)/osi_alloc.c
243 osi_cred.o: $(AFS)/osi_cred.c
245 osi_groups.o: $(AFS)/osi_groups.c
247 osi_file.o: $(AFS)/osi_file.c
249 osi_inode.o: $(AFS)/osi_inode.c
251 osi_misc.o: $(AFS)/osi_misc.c
253 osi_module.o: $(AFS)/osi_module.c
255 osi_sleep.o: $(AFS)/osi_sleep.c
257 osi_sysctl.o: $(AFS)/osi_sysctl.c
259 osi_vfsops.o: $(AFS)/osi_vfsops.c
261 osi_vm.o: $(AFS)/osi_vm.c
263 osi_vnodeops.o: $(AFS)/osi_vnodeops.c
267 xdr_int64.o: $(RX)/xdr_int64.c
269 xdr_array.o: $(RX)/xdr_array.c