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
10 include @TOP_OBJDIR@/src/config/Makefile.config
12 # OS specific object files:
31 COMMON_KERN_CFLAGS=$(KERN_DBG) $(KERN_OPTMZ) @LINUX_GCC_KOPTS@
33 COMMON_DEFINES=-D__KERNEL__ -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF}
35 LINUX_KERNEL_PATH=@LINUX_KERNEL_PATH@
37 # System specific build commands and flags
39 CCFLAGS = $(COMMON_KERN_CFLAGS) @P5PLUS_KOPTS@ -I../mach
40 DEFINES = $(COMMON_DEFINES) -DCPU=586 -DKBUILD_BASENAME=libafs_$(subst .,_,$(subst -,_,${CLIENT})) -DKBUILD_MODNAME=libafs_$(subst .,_,$(subst -,_,${CLIENT}))
42 <i386_linux22 i386_linux24>
43 CCFLAGS = $(COMMON_KERN_CFLAGS) @P5PLUS_KOPTS@
44 DEFINES = $(COMMON_DEFINES) -DCPU=586
47 CCFLAGS = $(COMMON_KERN_CFLAGS) -mcmodel=kernel
48 DEFINES = $(COMMON_DEFINES)
50 <i386_umlinux22 i386_umlinux24>
51 CCFLAGS = $(COMMON_KERN_CFLAGS) @P5PLUS_KOPTS@ -I$(LINUX_KERNEL_PATH)/arch/um/include -I$(LINUX_KERNEL_PATH)/arch/um/kernel/tt/include -I$(LINUX_KERNEL_PATH)/arch/um/kernel/skas/include
52 DEFINES = $(COMMON_DEFINES) -DCPU=586
54 <alpha_linux_22 alpha_linux_24>
55 CCFLAGS = $(COMMON_KERN_CFLAGS) -mno-fp-regs -ffixed-8
56 DEFINES = $(COMMON_DEFINES)
58 <s390_linux22 s390_linux24>
59 CCFLAGS = $(COMMON_KERN_CFLAGS) -fsigned-char
60 DEFINES = $(COMMON_DEFINES) -D__s390__
62 <sparc_linux22 sparc_linux24>
63 LD = ld -m elf32_sparc
64 CCFLAGS = $(COMMON_KERN_CFLAGS) -mcpu=v8 -mno-fpu -fcall-used-g5 -fcall-used-g7
65 DEFINES = $(COMMON_DEFINES) -DCPU=sparc
67 <sparc64_linux22 sparc64_linux24>
68 CC = sparc64-linux-gcc
69 LD = ld -m elf64_sparc
70 CCFLAGS = $(COMMON_KERN_CFLAGS) \
71 -mcpu=ultrasparc -m64 -mno-fpu -mcmodel=medlow -ffixed-g4 -fcall-used-g5 -fcall-used-g7 -Wno-sign-compare
72 DEFINES = $(COMMON_DEFINES) -DCPU=sparc64
74 <ppc_linux22 ppc_linux24 ppc64_linux24>
75 CCFLAGS = $(COMMON_KERN_CFLAGS) -fsigned-char -msoft-float -fno-builtin -ffixed-r2
76 DEFINES = $(COMMON_DEFINES) -D__powerpc__
79 CCFLAGS = $(COMMON_KERN_CFLAGS) -fsigned-char -mno-space-regs \
80 -mfast-indirect-calls -mdisable-fpregs -ffunction-sections \
81 -march=1.1 -mschedule=7100
82 DEFINES = $(COMMON_DEFINES) -D__linux__
85 CCFLAGS = $(COMMON_KERN_CFLAGS) -ffixed-r13 -mfixed-range=f10-f15,f32-f127 -falign-functions=32 -mb-step
86 DEFINES = $(COMMON_DEFINES)
89 INCLUDES = -I. -I../ -I${TOP_OBJDIR}/src/config
91 CFLAGS = $(CCFLAGS) $(DEFINES) $(INCLUDES)
93 # Name of directory to hold object files and libraries.
97 # COMPDIRS is called in Makefile.common to do the actual builds.
98 COMPDIRS=linux_compdirs
99 INSTDIRS=linux_instdirs
100 DESTDIRS=linux_destdirs
102 include Makefile.common
108 -$(RM) -f h net netinet sys rpc
110 for m in ${MPS} ; do \
111 KDIR=$(KOBJ)-${LINUX_VERSION}${LINUX_MODULE_NAME}-$$m; \
113 ln -fs ../Makefile $${KDIR}/Makefile ; \
114 ln -fs ../Makefile.common $${KDIR}/Makefile.common; \
115 ln -fs ../config $${KDIR}/config; \
118 # Compile SP and MP clients as requested
120 ${COMPDIRS} ${INSTDIRS} ${DESTDIRS}:
122 ln -fs ${LINUX_KERNEL_PATH}/include/linux h
124 ln -fs ${LINUX_KERNEL_PATH}/include/linux linux
126 ln -fs ${LINUX_KERNEL_PATH}/include/net net
128 ln -fs ${LINUX_KERNEL_PATH}/include/linux netinet
130 ln -fs ${LINUX_KERNEL_PATH}/include/linux sys
132 ln -fs ${LINUX_KERNEL_PATH}/include/asm-generic asm-generic
134 <parisc_linux22 parisc_linux24>
135 ln -fs ${LINUX_KERNEL_PATH}/include/asm-parisc asm
136 <alpha_linux_22 alpha_linux_24>
137 ln -fs ${LINUX_KERNEL_PATH}/include/asm-alpha asm
138 <i386_linux22 i386_linux24 i386_linux26>
139 ln -fs ${LINUX_KERNEL_PATH}/include/asm-i386 asm
140 <i386_umlinux22 i386_umlinux24>
141 ln -fs ${LINUX_KERNEL_PATH}/include/asm-um asm
143 ln -fs ${LINUX_KERNEL_PATH}/include/asm-x86_64 asm
144 <s390_linux22 s390_linux24>
145 ln -fs ${LINUX_KERNEL_PATH}/include/asm-s390 asm
146 <ppc_linux22 ppc_linux24>
147 ln -fs ${LINUX_KERNEL_PATH}/include/asm-ppc asm
149 ln -s ${LINUX_KERNEL_PATH}/include/asm-ppc64 asm
150 <sparc_linux22 sparc_linux24>
151 ln -fs ${LINUX_KERNEL_PATH}/include/asm-sparc asm
152 <sparc64_linux22 sparc64_linux24>
153 ln -fs ${LINUX_KERNEL_PATH}/include/asm-sparc64 asm
155 ln -fs ${LINUX_KERNEL_PATH}/include/asm-ia64 asm
157 ln -fs ${LINUX_KERNEL_PATH}/include/asm-i386/mach-default mach
159 for m in ${MPS} ; do \
160 KDIR=${KOBJ}-${LINUX_VERSION}${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}" ; \
168 elif [ "$$m" = "BM" ] ; then \
169 SMP_DEF="-DAFS_SMP @RHCONFIG_MP@ ${LOCAL_SMP_DEF}" ; \
172 SMP_DEF="@RHCONFIG_SP@ ${LOCAL_SMP_DEF}" ; \
176 $(MAKE) SMP_DEF="$${SMP_DEF}" $@_$${TARG} CLIENT=${LINUX_VERSION}${LINUX_MODULE_NAME} || exit $$?; \
180 linux_compdirs_libafs: depsrcs libafs
181 linux_compdirs_libafs.mp: depsrcs libafs.mp
182 linux_compdirs_libafs.ep: depsrcs libafs.ep
183 linux_compdirs_libafs.bm: depsrcs libafs.bm
184 linux_instdirs_libafs: install_libafs
185 linux_instdirs_libafs.mp: install_libafs.mp
186 linux_instdirs_libafs.ep: install_libafs.ep
187 linux_instdirs_libafs.bm: install_libafs.bm
188 linux_destdirs_libafs: dest_libafs
189 linux_destdirs_libafs.mp: dest_libafs.mp
190 linux_destdirs_libafs.ep: dest_libafs.ep
191 linux_destdirs_libafs.bm: dest_libafs.bm
194 # Below this line are targets when in the COMMON directory:
195 # For Linux there is no kernel NFS server.
196 LIBAFS = libafs-${CLIENT}.o
197 LIBAFS_MP = libafs-${CLIENT}.mp.o
198 LIBAFS_EP = libafs-${CLIENT}.ep.o
199 LIBAFS_BM = libafs-${CLIENT}.bm.o
201 INST_LIBAFS = ${DESTDIR}${afskerneldir}/${LIBAFS}
202 INST_LIBAFS_MP = ${DESTDIR}${afskerneldir}/${LIBAFS_MP}
203 INST_LIBAFS_EP = ${DESTDIR}${afskerneldir}/${LIBAFS_EP}
204 INST_LIBAFS_BM = ${DESTDIR}${afskerneldir}/${LIBAFS_BM}
206 DEST_LIBAFS = ${DEST}/root.client/usr/vice/etc/modload/${LIBAFS}
207 DEST_LIBAFS_MP = ${DEST}/root.client/usr/vice/etc/modload/${LIBAFS_MP}
208 DEST_LIBAFS_EP = ${DEST}/root.client/usr/vice/etc/modload/${LIBAFS_EP}
209 DEST_LIBAFS_BM = ${DEST}/root.client/usr/vice/etc/modload/${LIBAFS_BM}
213 echo SP Build Complete
215 libafs.mp: $(LIBAFS_MP)
216 echo MP Build Complete
218 libafs.ep: $(LIBAFS_EP)
219 echo EP Build Complete
221 libafs.bm: $(LIBAFS_BM)
222 echo BM Build Complete
224 ${LIBAFS}: $(AFSAOBJS) $(AFSNONFSOBJS)
226 $(LD) -r -o $@ $(AFSAOBJS) $(AFSNONFSOBJS)
228 ${LIBAFS_MP}: $(AFSAOBJS) $(AFSNONFSOBJS)
230 $(LD) -r -o $@ $(AFSAOBJS) $(AFSNONFSOBJS)
232 ${LIBAFS_EP}: $(AFSAOBJS) $(AFSNONFSOBJS)
234 $(LD) -r -o $@ $(AFSAOBJS) $(AFSNONFSOBJS)
236 ${LIBAFS_BM}: $(AFSAOBJS) $(AFSNONFSOBJS)
238 $(LD) -r -o $@ $(AFSAOBJS) $(AFSNONFSOBJS)
240 install_libafs: $(INST_LIBAFS)
241 echo SP Install Complete
243 install_libafs.mp: $(INST_LIBAFS_MP)
244 echo MP Install Complete
246 install_libafs.ep: $(INST_LIBAFS_EP)
247 echo EP Install Complete
249 install_libafs.bm: $(INST_LIBAFS_BM)
250 echo BM Install Complete
252 dest_libafs: $(DEST_LIBAFS)
253 echo SP Install Complete
255 dest_libafs.mp: $(DEST_LIBAFS_MP)
256 echo MP Install Complete
258 dest_libafs.ep: $(DEST_LIBAFS_EP)
259 echo EP Install Complete
261 dest_libafs.bm: $(DEST_LIBAFS_BM)
262 echo BM Install Complete
264 $(INST_LIBAFS): $(LIBAFS)
267 $(INST_LIBAFS_MP): $(LIBAFS_MP)
270 $(INST_LIBAFS_EP): $(LIBAFS_EP)
273 $(INST_LIBAFS_BM): $(LIBAFS_BM)
276 $(DEST_LIBAFS): $(LIBAFS)
279 $(DEST_LIBAFS_MP): $(LIBAFS_MP)
282 $(DEST_LIBAFS_EP): $(LIBAFS_EP)
285 $(DEST_LIBAFS_BM): $(LIBAFS_BM)