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
158 ln -fs ${LINUX_KERNEL_PATH}/include/asm-i386/mach-default mach
160 for m in ${MPS} ; do \
161 KDIR=${KOBJ}-${LINUX_VERSION}${LINUX_MODULE_NAME}-$$m ; \
162 echo Building in directory: $${KDIR} ; \
163 if [ "$$m" = "MP" ] ; then \
164 SMP_DEF="-DAFS_SMP @RHCONFIG_MP@ ${LOCAL_SMP_DEF}" ; \
166 elif [ "$$m" = "EP" ] ; then \
167 SMP_DEF="-DAFS_SMP @RHCONFIG_MP@ ${LOCAL_SMP_DEF}" ; \
169 elif [ "$$m" = "BM" ] ; then \
170 SMP_DEF="-DAFS_SMP @RHCONFIG_MP@ ${LOCAL_SMP_DEF}" ; \
173 SMP_DEF="@RHCONFIG_SP@ ${LOCAL_SMP_DEF}" ; \
177 $(MAKE) SMP_DEF="$${SMP_DEF}" $@_$${TARG} CLIENT=${LINUX_VERSION}${LINUX_MODULE_NAME} || exit $$?; \
181 linux_compdirs_libafs: depsrcs libafs
182 linux_compdirs_libafs.mp: depsrcs libafs.mp
183 linux_compdirs_libafs.ep: depsrcs libafs.ep
184 linux_compdirs_libafs.bm: depsrcs libafs.bm
185 linux_instdirs_libafs: install_libafs
186 linux_instdirs_libafs.mp: install_libafs.mp
187 linux_instdirs_libafs.ep: install_libafs.ep
188 linux_instdirs_libafs.bm: install_libafs.bm
189 linux_destdirs_libafs: dest_libafs
190 linux_destdirs_libafs.mp: dest_libafs.mp
191 linux_destdirs_libafs.ep: dest_libafs.ep
192 linux_destdirs_libafs.bm: dest_libafs.bm
195 # Below this line are targets when in the COMMON directory:
196 # For Linux there is no kernel NFS server.
197 LIBAFS = libafs-${CLIENT}.o
198 LIBAFS_MP = libafs-${CLIENT}.mp.o
199 LIBAFS_EP = libafs-${CLIENT}.ep.o
200 LIBAFS_BM = libafs-${CLIENT}.bm.o
202 INST_LIBAFS = ${DESTDIR}${afskerneldir}/${LIBAFS}
203 INST_LIBAFS_MP = ${DESTDIR}${afskerneldir}/${LIBAFS_MP}
204 INST_LIBAFS_EP = ${DESTDIR}${afskerneldir}/${LIBAFS_EP}
205 INST_LIBAFS_BM = ${DESTDIR}${afskerneldir}/${LIBAFS_BM}
207 DEST_LIBAFS = ${DEST}/root.client/usr/vice/etc/modload/${LIBAFS}
208 DEST_LIBAFS_MP = ${DEST}/root.client/usr/vice/etc/modload/${LIBAFS_MP}
209 DEST_LIBAFS_EP = ${DEST}/root.client/usr/vice/etc/modload/${LIBAFS_EP}
210 DEST_LIBAFS_BM = ${DEST}/root.client/usr/vice/etc/modload/${LIBAFS_BM}
214 echo SP Build Complete
216 libafs.mp: $(LIBAFS_MP)
217 echo MP Build Complete
219 libafs.ep: $(LIBAFS_EP)
220 echo EP Build Complete
222 libafs.bm: $(LIBAFS_BM)
223 echo BM Build Complete
225 ${LIBAFS}: $(AFSAOBJS) $(AFSNONFSOBJS)
227 $(LD) -r -o $@ $(AFSAOBJS) $(AFSNONFSOBJS)
229 ${LIBAFS_MP}: $(AFSAOBJS) $(AFSNONFSOBJS)
231 $(LD) -r -o $@ $(AFSAOBJS) $(AFSNONFSOBJS)
233 ${LIBAFS_EP}: $(AFSAOBJS) $(AFSNONFSOBJS)
235 $(LD) -r -o $@ $(AFSAOBJS) $(AFSNONFSOBJS)
237 ${LIBAFS_BM}: $(AFSAOBJS) $(AFSNONFSOBJS)
239 $(LD) -r -o $@ $(AFSAOBJS) $(AFSNONFSOBJS)
241 install_libafs: $(INST_LIBAFS)
242 echo SP Install Complete
244 install_libafs.mp: $(INST_LIBAFS_MP)
245 echo MP Install Complete
247 install_libafs.ep: $(INST_LIBAFS_EP)
248 echo EP Install Complete
250 install_libafs.bm: $(INST_LIBAFS_BM)
251 echo BM Install Complete
253 dest_libafs: $(DEST_LIBAFS)
254 echo SP Install Complete
256 dest_libafs.mp: $(DEST_LIBAFS_MP)
257 echo MP Install Complete
259 dest_libafs.ep: $(DEST_LIBAFS_EP)
260 echo EP Install Complete
262 dest_libafs.bm: $(DEST_LIBAFS_BM)
263 echo BM Install Complete
265 $(INST_LIBAFS): $(LIBAFS)
268 $(INST_LIBAFS_MP): $(LIBAFS_MP)
271 $(INST_LIBAFS_EP): $(LIBAFS_EP)
274 $(INST_LIBAFS_BM): $(LIBAFS_BM)
277 $(DEST_LIBAFS): $(LIBAFS)
280 $(DEST_LIBAFS_MP): $(LIBAFS_MP)
283 $(DEST_LIBAFS_EP): $(LIBAFS_EP)
286 $(DEST_LIBAFS_BM): $(LIBAFS_BM)