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@
15 exec_prefix=@exec_prefix@
18 libexecdir=@libexecdir@
20 includedir=@includedir@
22 afssrvbindir=@afssrvbindir@
23 afssrvsbindir=@afssrvsbindir@
24 afssrvlibexecdir=@afssrvlibexecdir@
25 afskerneldir=@afskerneldir@
26 SYS_NAME=@AFS_SYSNAME@
28 include config/Makefile.${SYS_NAME}
30 # OS specific object files:
52 # System specific build commands and flags
56 <i386_linux22 i386_linux24>
57 CCFLAGS = -O2 -fomit-frame-pointer \
58 -fno-strength-reduce -pipe -march=i486 -malign-loops=2 -malign-jumps=2 \
60 DEFINES = -D__KERNEL__ -DCPU=586 -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF} ${KDEFINES}
61 <alpha_linux_22 alpha_linux_24>
62 CCFLAGS = -O2 -fomit-frame-pointer -fno-strength-reduce -pipe -mno-fp-regs -ffixed-8
63 DEFINES = -D__KERNEL__ -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF}
64 <s390_linux22 s390_linux24>
65 CCFLAGS = -O -fomit-frame-pointer -fno-strength-reduce \
66 -fno-strict-aliasing -fsigned-char
67 DEFINES = -D__KERNEL__ -D__s390__ -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF}
68 <sparc_linux22 sparc_linux24>
69 LD = ld -m elf32_sparc
70 CCFLAGS = -O2 -fomit-frame-pointer \
71 -fno-strength-reduce -pipe -mcpu=v8 -mno-fpu -fcall-used-g5 -fcall-used-g7
72 DEFINES = -D__KERNEL__ -DCPU=sparc -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF}
73 <sparc64_linux22 sparc64_linux24>
74 CC = sparc64-linux-gcc
75 LD = ld -m elf64_sparc
76 CCFLAGS = -O2 -fomit-frame-pointer \
77 -fno-strength-reduce -pipe -mcpu=ultrasparc -m64 -mno-fpu -mcmodel=medlow -ffixed-g4 -fcall-used-g5 -fcall-used-g7 -Wno-sign-compare
78 DEFINES = -D__KERNEL__ -DCPU=sparc64 -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF}
79 <ppc_linux22 ppc_linux24>
80 CCFLAGS = -O2 -fomit-frame-pointer -fno-strength-reduce \
81 -fno-strict-aliasing -fsigned-char -msoft-float -pipe \
82 -fno-builtin -ffixed-r2
83 DEFINES = -D__KERNEL__ -D__powerpc__ -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF}
85 CCFLAGS = -O2 -fomit-frame-pointer -fno-strict-aliasing -pipe \
86 -ffixed-r13 -mfixed-range=f10-f15,f32-f127 -falign-functions=32 -mb-step
87 DEFINES = -D__KERNEL__ -DKERNEL -D_KERNEL ${SMP_DEF} -DMODULE
89 INCLUDES = -I. -I../ -I${TOP_SRCDIR}/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
104 LINUX_VERS=@LINUX_VERSION@
105 LINUX_KERNEL_PATH=@LINUX_KERNEL_PATH@
110 -$(RM) -f h net netinet sys rpc
112 for m in ${MPS} ; do \
113 KDIR=$(KOBJ)-${LINUX_VERS}${LINUX_MODULE_NAME}-$$m; \
115 ln -fs ../Makefile $${KDIR}/Makefile ; \
116 ln -fs ../Makefile.common $${KDIR}/Makefile.common; \
117 ln -fs ../config $${KDIR}/config; \
120 # Compile SP and MP clients as requested
122 ${COMPDIRS} ${INSTDIRS} ${DESTDIRS}:
124 ln -s ${LINUX_KERNEL_PATH}/include/linux h
126 ln -s ${LINUX_KERNEL_PATH}/include/linux linux
128 ln -s ${LINUX_KERNEL_PATH}/include/linux net
130 ln -s ${LINUX_KERNEL_PATH}/include/linux netinet
132 ln -s ${LINUX_KERNEL_PATH}/include/linux sys
134 ln -s ${LINUX_KERNEL_PATH}/include/asm-generic asm-generic
136 <alpha_linux_22 alpha_linux_24>
137 ln -s ${LINUX_KERNEL_PATH}/include/asm-alpha asm
138 <i386_linux22 i386_linux24>
139 ln -s ${LINUX_KERNEL_PATH}/include/asm-i386 asm
140 <s390_linux22 s390_linux24>
141 ln -s ${LINUX_KERNEL_PATH}/include/asm-s390 asm
142 <ppc_linux22 ppc_linux24>
143 ln -s ${LINUX_KERNEL_PATH}/include/asm-ppc asm
144 <sparc_linux22 sparc_linux24>
145 ln -s ${LINUX_KERNEL_PATH}/include/asm-sparc asm
146 <sparc64_linux22 sparc64_linux24>
147 ln -s ${LINUX_KERNEL_PATH}/include/asm-sparc64 asm
149 ln -s ${LINUX_KERNEL_PATH}/include/asm-ia64 asm
151 for m in ${MPS} ; do \
152 KDIR=${KOBJ}-${LINUX_VERS}${LINUX_MODULE_NAME}-$$m ; \
153 echo Building in directory: $${KDIR} ; \
154 if [ "$$m" = "MP" ] ; then \
155 SMP_DEF="-DAFS_SMP @RHCONFIG_MP@ ${LOCAL_SMP_DEF}" ; \
158 SMP_DEF="@RHCONFIG_SP@ ${LOCAL_SMP_DEF}" ; \
162 $(MAKE) SMP_DEF="$${SMP_DEF}" $@_$${TARG} CLIENT=${LINUX_VERS}${LINUX_MODULE_NAME} || exit $$?; \
166 linux_compdirs_libafs: libafs
167 linux_compdirs_libafs.mp: libafs.mp
168 linux_instdirs_libafs: install_libafs
169 linux_instdirs_libafs.mp: install_libafs.mp
170 linux_destdirs_libafs: dest_libafs
171 linux_destdirs_libafs.mp: dest_libafs.mp
174 # Below this line are targets when in the COMMON directory:
175 # For Linux there is no kernel NFS server.
176 LIBAFS = libafs-${CLIENT}.o
177 LIBAFS_MP = libafs-${CLIENT}.mp.o
179 INST_LIBAFS = ${DESTDIR}${afskerneldir}/${LIBAFS}
180 INST_LIBAFS_MP = ${DESTDIR}${afskerneldir}/${LIBAFS_MP}
182 DEST_LIBAFS = ${DEST}/root.client/usr/vice/etc/modload/${LIBAFS}
183 DEST_LIBAFS_MP = ${DEST}/root.client/usr/vice/etc/modload/${LIBAFS_MP}
187 echo SP Build Complete
189 libafs.mp: $(LIBAFS_MP)
190 echo MP Build Complete
192 ${LIBAFS}: $(AFSAOBJS) $(AFSNONFSOBJS)
194 $(LD) -r -o $@ $(AFSAOBJS) $(AFSNONFSOBJS)
196 ${LIBAFS_MP}: $(AFSAOBJS) $(AFSNONFSOBJS)
198 $(LD) -r -o $@ $(AFSAOBJS) $(AFSNONFSOBJS)
200 install_libafs: $(INST_LIBAFS)
201 echo SP Install Complete
203 install_libafs.mp: $(INST_LIBAFS_MP)
204 echo MP Install Complete
206 dest_libafs: $(DEST_LIBAFS)
207 echo SP Install Complete
209 dest_libafs.mp: $(DEST_LIBAFS_MP)
210 echo MP Install Complete
212 $(INST_LIBAFS): $(LIBAFS)
215 $(INST_LIBAFS_MP): $(LIBAFS_MP)
218 $(DEST_LIBAFS): $(LIBAFS)
221 $(DEST_LIBAFS_MP): $(LIBAFS_MP)
225 # Linux specific objects
226 osi_alloc.o: $(AFS)/osi_alloc.c
228 osi_cred.o: $(AFS)/osi_cred.c
230 osi_groups.o: $(AFS)/osi_groups.c
232 osi_file.o: $(AFS)/osi_file.c
234 osi_inode.o: $(AFS)/osi_inode.c
236 osi_misc.o: $(AFS)/osi_misc.c
238 osi_module.o: $(AFS)/osi_module.c
240 osi_sleep.o: $(AFS)/osi_sleep.c
242 osi_vfsops.o: $(AFS)/osi_vfsops.c
244 osi_vm.o: $(AFS)/osi_vm.c
246 osi_vnodeops.o: $(AFS)/osi_vnodeops.c
250 xdr_int64.o: $(RX)/xdr_int64.c
252 xdr_array.o: $(RX)/xdr_array.c