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 -m486 -malign-loops=2 -malign-jumps=2 \
43 DEFINES = -D__KERNEL__ -DCPU=586 -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF}
44 <s390_linux22 s390_linux24>
45 CCFLAGS = -O2 -fomit-frame-pointer -fno-strength-reduce \
46 -fno-strict-aliasing -fsigned-char
47 DEFINES = -D__KERNEL__ -D__s390__ -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF}
48 <sparc_linux22 sparc_linux24>
49 LD = ld -m elf32_sparc
50 CCFLAGS = -O2 -fomit-frame-pointer \
51 -fno-strength-reduce -pipe -mcpu=v8 -mno-fpu -fcall-used-g5 -fcall-used-g7
52 DEFINES = -D__KERNEL__ -DCPU=sparc -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF}
53 <sparc64_linux22 sparc64_linux24>
54 CC = sparc64-linux-gcc
55 LD = ld -m elf64_sparc
56 CCFLAGS = -O2 -fomit-frame-pointer \
57 -fno-strength-reduce -pipe -mcpu=ultrasparc -m64 -mno-fpu -mcmodel=medlow -ffixed-g4 -fcall-used-g5 -fcall-used-g7 -Wno-sign-compare
58 DEFINES = -D__KERNEL__ -DCPU=sparc64 -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF}
59 <ppc_linux22 ppc_linux24>
60 CCFLAGS = -O2 -fomit-frame-pointer -fno-strength-reduce \
61 -fno-strict-aliasing -fsigned-char -msoft-float -pipe \
62 -fno-builtin -ffixed-r2
63 DEFINES = -D__KERNEL__ -D__powerpc__ -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF}
67 CFLAGS = $(CCFLAGS) $(DEFINES) $(INCLUDES)
69 # Name of directory to hold object files and libraries.
73 # COMPDIRS is called in Makefile.common to do the actual builds.
74 COMPDIRS=linux_compdirs
77 include Makefile.common
80 -rm -f h net netinet sys rpc
82 for v in ${LINUX_VERS} ; do \
83 for m in ${MPS} ; do \
84 KDIR=$(KOBJ)-$$v-$$m; \
86 ln -fs ../Makefile $${KDIR}/Makefile ; \
87 ln -fs ../Makefile.common $${KDIR}/Makefile.common; \
91 # Compile SP and MP clients as requested
93 LINUX_INCDIR=include/linux
96 for v in ${LINUX_VERS} ; do \
97 IDIR=${LINUX_SRCDIR}$$v/${LINUX_INCDIR}; \
101 ln -s $${IDIR} linux; \
103 ln -s $${IDIR} net; \
105 ln -s $${IDIR} netinet; \
107 ln -s $${IDIR} sys; \
109 ln -s ${LINUX_SRCDIR}$$v/include/asm-generic asm-generic; \
111 <i386_linux22 i386_linux24>
112 ln -s ${LINUX_SRCDIR}$$v/include/asm-i386 asm ; \
113 <ppc_linux22 ppc_linux24>
114 ln -s ${LINUX_SRCDIR}$$v/include/asm-ppc asm ; \
115 <sparc_linux22 sparc_linux24>
116 ln -s ${LINUX_SRCDIR}$$v/include/asm-sparc asm ; \
117 <sparc64_linux22 sparc64_linux24>
118 ln -s ${LINUX_SRCDIR}$$v/include/asm-sparc64 asm ; \
120 for m in ${MPS} ; do \
121 KDIR=${KOBJ}-$$v-$$m ; \
122 echo Building in directory: $${KDIR} ; \
123 if [ "$$m" = "MP" ] ; then \
124 SMP_DEF="-DAFS_SMP" ; \
131 $(MAKE) DESTDIR=${DESTDIR} SMP_DEF=$${SMP_DEF} $${TARG} CLIENT=$$v || exit $$?; \
137 # Below this line are targets when in the COMMON directory:
138 # For Linux there is no kernel NFS server.
139 LIBAFS = libafs-${CLIENT}.o
140 LIBAFS_MP = libafs-${CLIENT}.mp.o
142 DEST_LIBAFS = ${DESTDIR}/root.client/usr/vice/etc/modload/${LIBAFS}
143 DEST_LIBAFS_MP = ${DESTDIR}/root.client/usr/vice/etc/modload/${LIBAFS_MP}
146 libafs: $(DEST_LIBAFS)
147 echo SP Build Complete
149 libafs.mp: $(DEST_LIBAFS_MP)
150 echo MP Build Complete
152 $(DEST_LIBAFS): $(LIBAFS)
155 $(DEST_LIBAFS_MP): $(LIBAFS_MP)
158 ${LIBAFS}: $(AFSAOBJS) $(AFSNONFSOBJS)
160 $(LD) -r -o $@ $(AFSAOBJS) $(AFSNONFSOBJS)
162 ${LIBAFS_MP}: $(AFSAOBJS) $(AFSNONFSOBJS)
164 $(LD) -r -o $@ $(AFSAOBJS) $(AFSNONFSOBJS)
167 # Linux specific objects
168 osi_alloc.o: $(AFS)/osi_alloc.c
170 osi_cred.o: $(AFS)/osi_cred.c
172 osi_groups.o: $(AFS)/osi_groups.c
174 osi_file.o: $(AFS)/osi_file.c
176 osi_inode.o: $(AFS)/osi_inode.c
178 osi_misc.o: $(AFS)/osi_misc.c
180 osi_module.o: $(AFS)/osi_module.c
182 osi_sleep.o: $(AFS)/osi_sleep.c
184 osi_vfsops.o: $(AFS)/osi_vfsops.c
186 osi_vm.o: $(AFS)/osi_vm.c
188 osi_vnodeops.o: $(AFS)/osi_vnodeops.c
192 xdr_int64.o: $(RX)/xdr_int64.c
194 xdr_array.o: $(RX)/xdr_array.c