s390-linux-20001223
[openafs.git] / src / libafs / MakefileProto.LINUX
1 # Copyright 2000, International Business Machines Corporation and others.
2 # All Rights Reserved.
3
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
7
8 # MakefileProto for Linux i386 systems
9 #
10
11 DESTDIR=DEST/
12 include ../config/Makefile.${SYS_NAME}
13
14 # OS specific object files:
15 AFS_OS_OBJS = \
16         osi_alloc.o \
17         osi_cred.o \
18         osi_groups.o \
19         osi_inode.o \
20         osi_file.o \
21         osi_misc.o \
22         osi_module.o \
23         osi_sleep.o \
24         osi_vfsops.o \
25         osi_vm.o \
26         osi_vnodeops.o \
27         xdr.o \
28         xdr_array.o
29
30 AFS_OS_NFSOBJS =
31
32 AFS_OS_NONFSOBJS =
33
34
35 # System specific build commands and flags
36 CC = gcc
37 LD = ld
38 # -Wall
39 <i386_linux22 i386_linux24>
40 CCFLAGS =   -O2 -fomit-frame-pointer \
41         -fno-strength-reduce -pipe -m486 -malign-loops=2 -malign-jumps=2 \
42         -malign-functions=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 -pipe \
47         -fno-builtin
48 DEFINES = -D__KERNEL__  -D__s390__ -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF}
49 <sparc_linux22 sparc_linux24>
50 LD = ld -m elf32_sparc
51 CCFLAGS =   -O2 -fomit-frame-pointer \
52         -fno-strength-reduce -pipe -mcpu=v8 -mno-fpu -fcall-used-g5 -fcall-used-g7
53 DEFINES = -D__KERNEL__  -DCPU=sparc -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF}
54 <sparc64_linux22 sparc64_linux24>
55 CC = sparc64-linux-gcc
56 LD = ld -m elf64_sparc
57 CCFLAGS =   -O2 -fomit-frame-pointer \
58         -fno-strength-reduce -pipe -mcpu=ultrasparc -m64 -mno-fpu -mcmodel=medlow -ffixed-g4 -fcall-used-g5 -fcall-used-g7 -Wno-sign-compare
59 DEFINES = -D__KERNEL__  -DCPU=sparc64 -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF}
60 <ppc_linux22 ppc_linux24>
61 CCFLAGS =   -O2 -fomit-frame-pointer -fno-strength-reduce \
62         -fno-strict-aliasing -fsigned-char -msoft-float -pipe \
63         -fno-builtin -ffixed-r2
64 DEFINES = -D__KERNEL__  -D__powerpc__ -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF}
65 <all>
66 INCLUDES = -I. -I../
67
68 CFLAGS = $(CCFLAGS) $(DEFINES) $(INCLUDES)
69
70 # Name of directory to hold object files and libraries.
71 KOBJ = MODLOAD
72 MPS = MP SP
73
74 # COMPDIRS is called in Makefile.common to do the actual builds.
75 COMPDIRS=linux_compdirs
76
77
78 include Makefile.common
79
80 setup:
81         -rm -f h net netinet sys rpc
82         -ln -s rx rpc
83         for v in ${LINUX_VERS} ; do \
84                 for m in ${MPS} ; do \
85                         KDIR=$(KOBJ)-$$v-$$m; \
86                         mkdir -p $${KDIR}; \
87                         ln -fs ../Makefile $${KDIR}/Makefile ; \
88                         ln -fs ../Makefile.common $${KDIR}/Makefile.common; \
89                 done \
90         done
91         
92 # Compile SP and MP clients as requested
93
94 LINUX_INCDIR=include/linux
95
96 ${COMPDIRS}:
97         for v in ${LINUX_VERS} ; do \
98                 IDIR=${LINUX_SRCDIR}$$v/${LINUX_INCDIR}; \
99                 rm -f h; \
100                 ln -s $${IDIR} h; \
101                 rm -f linux; \
102                 ln -s $${IDIR} linux; \
103                 rm -f net; \
104                 ln -s $${IDIR} net; \
105                 rm -f netinet; \
106                 ln -s $${IDIR} netinet; \
107                 rm -f sys; \
108                 ln -s $${IDIR} sys; \
109                 rm -f asm; \
110 <i386_linux22 i386_linux24>
111                 ln -s ${LINUX_SRCDIR}$$v/include/asm-i386 asm ; \
112 <ppc_linux22 ppc_linux24>
113                 ln -s ${LINUX_SRCDIR}$$v/include/asm-ppc asm ; \
114 <sparc_linux22 sparc_linux24>
115                 ln -s ${LINUX_SRCDIR}$$v/include/asm-sparc asm ; \
116 <sparc64_linux22 sparc64_linux24>
117                 ln -s ${LINUX_SRCDIR}$$v/include/asm-sparc64 asm ; \
118 <all>
119                 for m in ${MPS} ; do \
120                         KDIR=${KOBJ}-$$v-$$m ; \
121                         echo Building in directory: $${KDIR} ; \
122                         if [ "$$m" = "MP" ] ; then \
123                                 SMP_DEF="-DAFS_SMP" ; \
124                                 TARG="libafs.mp" ; \
125                         else  \
126                                 SMP_DEF="" ; \
127                                 TARG=libafs ; \
128                         fi ; \
129                         cd $${KDIR} ; \
130                         $(MAKE) DESTDIR=${DESTDIR} SMP_DEF=$${SMP_DEF} $${TARG} CLIENT=$$v || exit $$?; \
131                         cd ../ ; \
132                 done \
133         done
134
135
136 # Below this line are targets when in the COMMON directory:
137 # For Linux there is no kernel NFS server.
138 LIBAFS = libafs-${CLIENT}.o
139 LIBAFS_MP = libafs-${CLIENT}.mp.o
140
141 DEST_LIBAFS = ${DESTDIR}/root.client/usr/vice/etc/modload/${LIBAFS}
142 DEST_LIBAFS_MP = ${DESTDIR}/root.client/usr/vice/etc/modload/${LIBAFS_MP}
143
144
145 libafs: $(DEST_LIBAFS) 
146         echo SP Build Complete
147
148 libafs.mp: $(DEST_LIBAFS_MP)
149         echo MP Build Complete
150
151 $(DEST_LIBAFS): $(LIBAFS)
152         ${INSTALL} -f $? $@
153
154 $(DEST_LIBAFS_MP): $(LIBAFS_MP)
155         ${INSTALL} -f $? $@
156
157 ${LIBAFS}: $(AFSAOBJS) $(AFSNONFSOBJS)
158         $(RM) -f $@
159         $(LD) -r -o $@ $(AFSAOBJS) $(AFSNONFSOBJS)
160
161 ${LIBAFS_MP}: $(AFSAOBJS) $(AFSNONFSOBJS)
162         $(RM) -f $@
163         $(LD) -r -o $@ $(AFSAOBJS) $(AFSNONFSOBJS)
164
165
166 # Linux specific objects
167 osi_alloc.o: $(AFS)/osi_alloc.c
168         $(CRULE1);
169 osi_cred.o: $(AFS)/osi_cred.c
170         $(CRULE1);
171 osi_groups.o: $(AFS)/osi_groups.c
172         $(CRULE1);
173 osi_file.o: $(AFS)/osi_file.c
174         $(CRULE1);
175 osi_inode.o: $(AFS)/osi_inode.c
176         $(CRULE1);
177 osi_misc.o: $(AFS)/osi_misc.c
178         $(CRULE1);
179 osi_module.o: $(AFS)/osi_module.c
180         $(CRULE1);
181 osi_sleep.o: $(AFS)/osi_sleep.c
182         $(CRULE1);
183 osi_vfsops.o: $(AFS)/osi_vfsops.c
184         $(CRULE1);
185 osi_vm.o: $(AFS)/osi_vm.c
186         $(CRULE1);
187 osi_vnodeops.o: $(AFS)/osi_vnodeops.c
188         $(CRULE1);
189 xdr.o: $(RX)/xdr.c
190         $(CRULE1);
191 xdr_array.o: $(RX)/xdr_array.c
192         $(CRULE1);