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:
36 # System specific build commands and flags
40 <i386_linux22 i386_linux24>
41 CCFLAGS = -O2 -fomit-frame-pointer \
42 -fno-strength-reduce -pipe -m486 -malign-loops=2 -malign-jumps=2 \
44 DEFINES = -D__KERNEL__ -DCPU=586 -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF}
45 <s390_linux22 s390_linux24>
46 CCFLAGS = -O2 -fomit-frame-pointer -fno-strength-reduce \
47 -fno-strict-aliasing -fsigned-char -pipe \
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}
69 CFLAGS = $(CCFLAGS) $(DEFINES) $(INCLUDES)
71 # Name of directory to hold object files and libraries.
75 # COMPDIRS is called in Makefile.common to do the actual builds.
76 COMPDIRS=linux_compdirs
79 include Makefile.common
82 -rm -f h net netinet sys rpc
84 for v in ${LINUX_VERS} ; do \
85 for m in ${MPS} ; do \
86 KDIR=$(KOBJ)-$$v-$$m; \
88 ln -fs ../Makefile $${KDIR}/Makefile ; \
89 ln -fs ../Makefile.common $${KDIR}/Makefile.common; \
93 # Compile SP and MP clients as requested
95 LINUX_INCDIR=include/linux
98 for v in ${LINUX_VERS} ; do \
99 IDIR=${LINUX_SRCDIR}$$v/${LINUX_INCDIR}; \
103 ln -s $${IDIR} linux; \
105 ln -s $${IDIR} net; \
107 ln -s $${IDIR} netinet; \
109 ln -s $${IDIR} sys; \
111 ln -s ${LINUX_SRCDIR}$$v/include/asm-generic asm-generic; \
113 <i386_linux22 i386_linux24>
114 ln -s ${LINUX_SRCDIR}$$v/include/asm-i386 asm ; \
115 <ppc_linux22 ppc_linux24>
116 ln -s ${LINUX_SRCDIR}$$v/include/asm-ppc asm ; \
117 <sparc_linux22 sparc_linux24>
118 ln -s ${LINUX_SRCDIR}$$v/include/asm-sparc asm ; \
119 <sparc64_linux22 sparc64_linux24>
120 ln -s ${LINUX_SRCDIR}$$v/include/asm-sparc64 asm ; \
122 for m in ${MPS} ; do \
123 KDIR=${KOBJ}-$$v-$$m ; \
124 echo Building in directory: $${KDIR} ; \
125 if [ "$$m" = "MP" ] ; then \
126 SMP_DEF="-DAFS_SMP" ; \
133 $(MAKE) DESTDIR=${DESTDIR} SMP_DEF=$${SMP_DEF} $${TARG} CLIENT=$$v || exit $$?; \
139 # Below this line are targets when in the COMMON directory:
140 # For Linux there is no kernel NFS server.
141 LIBAFS = libafs-${CLIENT}.o
142 LIBAFS_MP = libafs-${CLIENT}.mp.o
144 DEST_LIBAFS = ${DESTDIR}/root.client/usr/vice/etc/modload/${LIBAFS}
145 DEST_LIBAFS_MP = ${DESTDIR}/root.client/usr/vice/etc/modload/${LIBAFS_MP}
148 libafs: $(DEST_LIBAFS)
149 echo SP Build Complete
151 libafs.mp: $(DEST_LIBAFS_MP)
152 echo MP Build Complete
154 $(DEST_LIBAFS): $(LIBAFS)
157 $(DEST_LIBAFS_MP): $(LIBAFS_MP)
160 ${LIBAFS}: $(AFSAOBJS) $(AFSNONFSOBJS)
162 $(LD) -r -o $@ $(AFSAOBJS) $(AFSNONFSOBJS)
164 ${LIBAFS_MP}: $(AFSAOBJS) $(AFSNONFSOBJS)
166 $(LD) -r -o $@ $(AFSAOBJS) $(AFSNONFSOBJS)
169 # Linux specific objects
170 osi_alloc.o: $(AFS)/osi_alloc.c
172 osi_cred.o: $(AFS)/osi_cred.c
174 osi_groups.o: $(AFS)/osi_groups.c
176 osi_file.o: $(AFS)/osi_file.c
178 osi_inode.o: $(AFS)/osi_inode.c
180 osi_misc.o: $(AFS)/osi_misc.c
182 osi_module.o: $(AFS)/osi_module.c
184 osi_sleep.o: $(AFS)/osi_sleep.c
186 osi_vfsops.o: $(AFS)/osi_vfsops.c
188 osi_vm.o: $(AFS)/osi_vm.c
190 osi_vnodeops.o: $(AFS)/osi_vnodeops.c
194 xdr_int64.o: $(RX)/xdr_int64.c
196 xdr_array.o: $(RX)/xdr_array.c