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:
34 # System specific build commands and flags
38 <i386_linux22 i386_linux24>
39 CCFLAGS = -O2 -fomit-frame-pointer \
40 -fno-strength-reduce -pipe -march=i486 -malign-loops=2 -malign-jumps=2 \
42 DEFINES = -D__KERNEL__ -DCPU=586 -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF} ${KDEFINES}
43 <alpha_linux_22 alpha_linux_24>
44 CCFLAGS = -O2 -fomit-frame-pointer -fno-strength-reduce -pipe -mno-fp-regs -ffixed-8
45 DEFINES = -D__KERNEL__ -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF}
46 <s390_linux22 s390_linux24>
47 CCFLAGS = -O -fomit-frame-pointer -fno-strength-reduce \
48 -fno-strict-aliasing -fsigned-char
49 DEFINES = -D__KERNEL__ -D__s390__ -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF}
50 <sparc_linux22 sparc_linux24>
51 LD = ld -m elf32_sparc
52 CCFLAGS = -O2 -fomit-frame-pointer \
53 -fno-strength-reduce -pipe -mcpu=v8 -mno-fpu -fcall-used-g5 -fcall-used-g7
54 DEFINES = -D__KERNEL__ -DCPU=sparc -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF}
55 <sparc64_linux22 sparc64_linux24>
56 CC = sparc64-linux-gcc
57 LD = ld -m elf64_sparc
58 CCFLAGS = -O2 -fomit-frame-pointer \
59 -fno-strength-reduce -pipe -mcpu=ultrasparc -m64 -mno-fpu -mcmodel=medlow -ffixed-g4 -fcall-used-g5 -fcall-used-g7 -Wno-sign-compare
60 DEFINES = -D__KERNEL__ -DCPU=sparc64 -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF}
61 <ppc_linux22 ppc_linux24>
62 CCFLAGS = -O2 -fomit-frame-pointer -fno-strength-reduce \
63 -fno-strict-aliasing -fsigned-char -msoft-float -pipe \
64 -fno-builtin -ffixed-r2
65 DEFINES = -D__KERNEL__ -D__powerpc__ -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF}
67 CCFLAGS = -O2 -fomit-frame-pointer -fno-strict-aliasing -fno-common -fno-strength-reduce \
68 -fno-strict-aliasing -fsigned-char -mno-space-regs -mfast-indirect-calls \
69 -mdisable-fpregs -ffunction-sections -march=1.1 -mschedule=7100
70 DEFINES = -D__KERNEL__ -D__linux__ -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_OBJDIR}/src/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
87 DESTDIRS=linux_destdirs
89 include Makefile.common
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_VERSION}${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} ${DESTDIRS}:
110 ln -fs ${LINUX_KERNEL_PATH}/include/linux h
112 ln -fs ${LINUX_KERNEL_PATH}/include/linux linux
114 ln -fs ${LINUX_KERNEL_PATH}/include/linux net
116 ln -fs ${LINUX_KERNEL_PATH}/include/linux netinet
118 ln -fs ${LINUX_KERNEL_PATH}/include/linux sys
120 ln -fs ${LINUX_KERNEL_PATH}/include/asm-generic asm-generic
122 <alpha_linux_22 alpha_linux_24>
123 ln -fs ${LINUX_KERNEL_PATH}/include/asm-alpha asm
124 <i386_linux22 i386_linux24>
125 ln -fs ${LINUX_KERNEL_PATH}/include/asm-i386 asm
126 <s390_linux22 s390_linux24>
127 ln -fs ${LINUX_KERNEL_PATH}/include/asm-s390 asm
128 <ppc_linux22 ppc_linux24>
129 ln -fs ${LINUX_KERNEL_PATH}/include/asm-ppc asm
130 <sparc_linux22 sparc_linux24>
131 ln -fs ${LINUX_KERNEL_PATH}/include/asm-sparc asm
132 <sparc64_linux22 sparc64_linux24>
133 ln -fs ${LINUX_KERNEL_PATH}/include/asm-sparc64 asm
135 ln -fs ${LINUX_KERNEL_PATH}/include/asm-ia64 asm
137 for m in ${MPS} ; do \
138 KDIR=${KOBJ}-${LINUX_VERSION}${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}" ; \
143 elif [ "$$m" = "EP" ] ; then \
144 SMP_DEF="-DAFS_SMP @RHCONFIG_MP@ ${LOCAL_SMP_DEF}" ; \
147 SMP_DEF="@RHCONFIG_SP@ ${LOCAL_SMP_DEF}" ; \
151 $(MAKE) SMP_DEF="$${SMP_DEF}" $@_$${TARG} CLIENT=${LINUX_VERSION}${LINUX_MODULE_NAME} || exit $$?; \
155 linux_compdirs_libafs: libafs
156 linux_compdirs_libafs.mp: libafs.mp
157 linux_compdirs_libafs.ep: libafs.ep
158 linux_instdirs_libafs: install_libafs
159 linux_instdirs_libafs.mp: install_libafs.mp
160 linux_instdirs_libafs.ep: install_libafs.ep
161 linux_destdirs_libafs: dest_libafs
162 linux_destdirs_libafs.mp: dest_libafs.mp
163 linux_destdirs_libafs.ep: dest_libafs.ep
166 # Below this line are targets when in the COMMON directory:
167 # For Linux there is no kernel NFS server.
168 LIBAFS = libafs-${CLIENT}.o
169 LIBAFS_MP = libafs-${CLIENT}.mp.o
170 LIBAFS_EP = libafs-${CLIENT}.ep.o
172 INST_LIBAFS = ${DESTDIR}${afskerneldir}/${LIBAFS}
173 INST_LIBAFS_MP = ${DESTDIR}${afskerneldir}/${LIBAFS_MP}
174 INST_LIBAFS_EP = ${DESTDIR}${afskerneldir}/${LIBAFS_EP}
176 DEST_LIBAFS = ${DEST}/root.client/usr/vice/etc/modload/${LIBAFS}
177 DEST_LIBAFS_MP = ${DEST}/root.client/usr/vice/etc/modload/${LIBAFS_MP}
178 DEST_LIBAFS_EP = ${DEST}/root.client/usr/vice/etc/modload/${LIBAFS_EP}
182 echo SP Build Complete
184 libafs.mp: $(LIBAFS_MP)
185 echo MP Build Complete
187 libafs.ep: $(LIBAFS_EP)
188 echo EP Build Complete
190 ${LIBAFS}: $(AFSAOBJS) $(AFSNONFSOBJS)
192 $(LD) -r -o $@ $(AFSAOBJS) $(AFSNONFSOBJS)
194 ${LIBAFS_MP}: $(AFSAOBJS) $(AFSNONFSOBJS)
196 $(LD) -r -o $@ $(AFSAOBJS) $(AFSNONFSOBJS)
198 ${LIBAFS_EP}: $(AFSAOBJS) $(AFSNONFSOBJS)
200 $(LD) -r -o $@ $(AFSAOBJS) $(AFSNONFSOBJS)
202 install_libafs: $(INST_LIBAFS)
203 echo SP Install Complete
205 install_libafs.mp: $(INST_LIBAFS_MP)
206 echo MP Install Complete
208 install_libafs.ep: $(INST_LIBAFS_EP)
209 echo EP Install Complete
211 dest_libafs: $(DEST_LIBAFS)
212 echo SP Install Complete
214 dest_libafs.mp: $(DEST_LIBAFS_MP)
215 echo MP Install Complete
217 dest_libafs.ep: $(DEST_LIBAFS_EP)
218 echo EP Install Complete
220 $(INST_LIBAFS): $(LIBAFS)
223 $(INST_LIBAFS_MP): $(LIBAFS_MP)
226 $(INST_LIBAFS_EP): $(LIBAFS_EP)
229 $(DEST_LIBAFS): $(LIBAFS)
232 $(DEST_LIBAFS_MP): $(LIBAFS_MP)
235 $(DEST_LIBAFS_EP): $(LIBAFS_EP)
239 # Linux specific objects
240 osi_alloc.o: $(AFS)/osi_alloc.c
242 osi_cred.o: $(AFS)/osi_cred.c
244 osi_groups.o: $(AFS)/osi_groups.c
246 osi_file.o: $(AFS)/osi_file.c
248 osi_inode.o: $(AFS)/osi_inode.c
250 osi_misc.o: $(AFS)/osi_misc.c
252 osi_module.o: $(AFS)/osi_module.c
254 osi_sleep.o: $(AFS)/osi_sleep.c
256 osi_vfsops.o: $(AFS)/osi_vfsops.c
258 osi_vm.o: $(AFS)/osi_vm.c
260 osi_vnodeops.o: $(AFS)/osi_vnodeops.c
264 xdr_int64.o: $(RX)/xdr_int64.c
266 xdr_array.o: $(RX)/xdr_array.c