afs-linux-s390-updates-20010305
[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 
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}
64 <all>
65 INCLUDES = -I. -I../
66
67 CFLAGS = $(CCFLAGS) $(DEFINES) $(INCLUDES)
68
69 # Name of directory to hold object files and libraries.
70 KOBJ = MODLOAD
71 MPS = MP SP
72
73 # COMPDIRS is called in Makefile.common to do the actual builds.
74 COMPDIRS=linux_compdirs
75
76
77 include Makefile.common
78
79 setup:
80         -rm -f h net netinet sys rpc
81         -ln -s rx rpc
82         for v in ${LINUX_VERS} ; do \
83                 for m in ${MPS} ; do \
84                         KDIR=$(KOBJ)-$$v-$$m; \
85                         mkdir -p $${KDIR}; \
86                         ln -fs ../Makefile $${KDIR}/Makefile ; \
87                         ln -fs ../Makefile.common $${KDIR}/Makefile.common; \
88                 done \
89         done
90         
91 # Compile SP and MP clients as requested
92
93 LINUX_INCDIR=include/linux
94
95 ${COMPDIRS}:
96         for v in ${LINUX_VERS} ; do \
97                 IDIR=${LINUX_SRCDIR}$$v/${LINUX_INCDIR}; \
98                 rm -f h; \
99                 ln -s $${IDIR} h; \
100                 rm -f linux; \
101                 ln -s $${IDIR} linux; \
102                 rm -f net; \
103                 ln -s $${IDIR} net; \
104                 rm -f netinet; \
105                 ln -s $${IDIR} netinet; \
106                 rm -f sys; \
107                 ln -s $${IDIR} sys; \
108                 rm -f asm-generic; \
109                 ln -s ${LINUX_SRCDIR}$$v/include/asm-generic asm-generic; \
110                 rm -f asm; \
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 ; \
119 <all>
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" ; \
125                                 TARG="libafs.mp" ; \
126                         else  \
127                                 SMP_DEF="" ; \
128                                 TARG=libafs ; \
129                         fi ; \
130                         cd $${KDIR} ; \
131                         $(MAKE) DESTDIR=${DESTDIR} SMP_DEF=$${SMP_DEF} $${TARG} CLIENT=$$v || exit $$?; \
132                         cd ../ ; \
133                 done \
134         done
135
136
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
141
142 DEST_LIBAFS = ${DESTDIR}/root.client/usr/vice/etc/modload/${LIBAFS}
143 DEST_LIBAFS_MP = ${DESTDIR}/root.client/usr/vice/etc/modload/${LIBAFS_MP}
144
145
146 libafs: $(DEST_LIBAFS) 
147         echo SP Build Complete
148
149 libafs.mp: $(DEST_LIBAFS_MP)
150         echo MP Build Complete
151
152 $(DEST_LIBAFS): $(LIBAFS)
153         ${INSTALL} -f $? $@
154
155 $(DEST_LIBAFS_MP): $(LIBAFS_MP)
156         ${INSTALL} -f $? $@
157
158 ${LIBAFS}: $(AFSAOBJS) $(AFSNONFSOBJS)
159         $(RM) -f $@
160         $(LD) -r -o $@ $(AFSAOBJS) $(AFSNONFSOBJS)
161
162 ${LIBAFS_MP}: $(AFSAOBJS) $(AFSNONFSOBJS)
163         $(RM) -f $@
164         $(LD) -r -o $@ $(AFSAOBJS) $(AFSNONFSOBJS)
165
166
167 # Linux specific objects
168 osi_alloc.o: $(AFS)/osi_alloc.c
169         $(CRULE1);
170 osi_cred.o: $(AFS)/osi_cred.c
171         $(CRULE1);
172 osi_groups.o: $(AFS)/osi_groups.c
173         $(CRULE1);
174 osi_file.o: $(AFS)/osi_file.c
175         $(CRULE1);
176 osi_inode.o: $(AFS)/osi_inode.c
177         $(CRULE1);
178 osi_misc.o: $(AFS)/osi_misc.c
179         $(CRULE1);
180 osi_module.o: $(AFS)/osi_module.c
181         $(CRULE1);
182 osi_sleep.o: $(AFS)/osi_sleep.c
183         $(CRULE1);
184 osi_vfsops.o: $(AFS)/osi_vfsops.c
185         $(CRULE1);
186 osi_vm.o: $(AFS)/osi_vm.c
187         $(CRULE1);
188 osi_vnodeops.o: $(AFS)/osi_vnodeops.c
189         $(CRULE1);
190 xdr.o: $(RX)/xdr.c
191         $(CRULE1);
192 xdr_int64.o: $(RX)/xdr_int64.c
193         $(CRULE1);
194 xdr_array.o: $(RX)/xdr_array.c
195         $(CRULE1);