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
12 include ../config/Makefile.${SYS_NAME}
14 # 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}
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}
70 CFLAGS = $(CCFLAGS) $(DEFINES) $(INCLUDES)
72 # Name of directory to hold object files and libraries.
76 # COMPDIRS is called in Makefile.common to do the actual builds.
77 COMPDIRS=linux_compdirs
80 include Makefile.common
83 -rm -f h net netinet sys rpc
85 for v in ${LINUX_VERS} ; do \
86 for m in ${MPS} ; do \
87 KDIR=$(KOBJ)-$$v-$$m; \
89 ln -fs ../Makefile $${KDIR}/Makefile ; \
90 ln -fs ../Makefile.common $${KDIR}/Makefile.common; \
94 # Compile SP and MP clients as requested
96 LINUX_INCDIR=include/linux
99 for v in ${LINUX_VERS} ; do \
100 IDIR=${LINUX_SRCDIR}$$v/${LINUX_INCDIR}; \
104 ln -s $${IDIR} linux; \
106 ln -s $${IDIR} net; \
108 ln -s $${IDIR} netinet; \
110 ln -s $${IDIR} sys; \
112 ln -s ${LINUX_SRCDIR}$$v/include/asm-generic asm-generic; \
114 <alpha_linux_22 alpha_linux_24>
115 ln -s ${LINUX_SRCDIR}$$v/include/asm-alpha asm ; \
116 <i386_linux22 i386_linux24>
117 ln -s ${LINUX_SRCDIR}$$v/include/asm-i386 asm ; \
118 <s390_linux22 s390_linux24>
119 ln -s ${LINUX_SRCDIR}$$v/include/asm-s390 asm ; \
120 <ppc_linux22 ppc_linux24>
121 ln -s ${LINUX_SRCDIR}$$v/include/asm-ppc asm ; \
122 <sparc_linux22 sparc_linux24>
123 ln -s ${LINUX_SRCDIR}$$v/include/asm-sparc asm ; \
124 <sparc64_linux22 sparc64_linux24>
125 ln -s ${LINUX_SRCDIR}$$v/include/asm-sparc64 asm ; \
127 for m in ${MPS} ; do \
128 KDIR=${KOBJ}-$$v-$$m ; \
129 echo Building in directory: $${KDIR} ; \
130 if [ "$$m" = "MP" ] ; then \
131 SMP_DEF="-DAFS_SMP -D__BOOT_KERNEL_SMP=1 -D__BOOT_KERNEL_UP=0 -D__SMP__" ; \
134 SMP_DEF="-D__BOOT_KERNEL_SMP=0 -D__BOOT_KERNEL_UP=1 -U__SMP__" ; \
138 $(MAKE) DESTDIR=${DESTDIR} SMP_DEF="$${SMP_DEF}" $${TARG} CLIENT=$$v || exit $$?; \
144 # Below this line are targets when in the COMMON directory:
145 # For Linux there is no kernel NFS server.
146 LIBAFS = libafs-${CLIENT}.o
147 LIBAFS_MP = libafs-${CLIENT}.mp.o
149 DEST_LIBAFS = ${DESTDIR}/root.client/usr/vice/etc/modload/${LIBAFS}
150 DEST_LIBAFS_MP = ${DESTDIR}/root.client/usr/vice/etc/modload/${LIBAFS_MP}
153 libafs: $(DEST_LIBAFS)
154 echo SP Build Complete
156 libafs.mp: $(DEST_LIBAFS_MP)
157 echo MP Build Complete
159 $(DEST_LIBAFS): $(LIBAFS)
162 $(DEST_LIBAFS_MP): $(LIBAFS_MP)
165 ${LIBAFS}: $(AFSAOBJS) $(AFSNONFSOBJS)
167 $(LD) -r -o $@ $(AFSAOBJS) $(AFSNONFSOBJS)
169 ${LIBAFS_MP}: $(AFSAOBJS) $(AFSNONFSOBJS)
171 $(LD) -r -o $@ $(AFSAOBJS) $(AFSNONFSOBJS)
174 # Linux specific objects
175 osi_alloc.o: $(AFS)/osi_alloc.c
177 osi_cred.o: $(AFS)/osi_cred.c
179 osi_groups.o: $(AFS)/osi_groups.c
181 osi_file.o: $(AFS)/osi_file.c
183 osi_inode.o: $(AFS)/osi_inode.c
185 osi_misc.o: $(AFS)/osi_misc.c
187 osi_module.o: $(AFS)/osi_module.c
189 osi_sleep.o: $(AFS)/osi_sleep.c
191 osi_vfsops.o: $(AFS)/osi_vfsops.c
193 osi_vm.o: $(AFS)/osi_vm.c
195 osi_vnodeops.o: $(AFS)/osi_vnodeops.c
199 xdr_int64.o: $(RX)/xdr_int64.c
201 xdr_array.o: $(RX)/xdr_array.c