makefile-cleanup-remove-extraneous-semicolons-and-other-unused-bits-20010910
[openafs.git] / src / libafs / MakefileProto.LINUX.in
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 DEST=@DEST@
11 TOP_INCDIR=@TOP_INCDIR@
12 TOP_LIBDIR=@TOP_LIBDIR@
13 TOP_SRCDIR=@TOP_SRCDIR@
14 prefix=@prefix@
15 exec_prefix=@exec_prefix@
16 bindir=@bindir@
17 sbindir=@sbindir@
18 libexecdir=@libexecdir@
19 libdir=@libdir@
20 includedir=@includedir@
21 mandir=@mandir@
22 afssrvbindir=@afssrvbindir@
23 afssrvsbindir=@afssrvsbindir@
24 afssrvlibexecdir=@afssrvlibexecdir@
25 afskerneldir=@afskerneldir@
26 SYS_NAME=@AFS_SYSNAME@
27
28 include config/Makefile.${SYS_NAME}
29
30 # OS specific object files:
31 AFS_OS_OBJS = \
32         osi_alloc.o \
33         osi_cred.o \
34         osi_groups.o \
35         osi_inode.o \
36         osi_file.o \
37         osi_misc.o \
38         osi_module.o \
39         osi_sleep.o \
40         osi_vfsops.o \
41         osi_vm.o \
42         osi_vnodeops.o \
43         xdr.o \
44         xdr_array.o \
45         xdr_int64.o
46
47 AFS_OS_NFSOBJS =
48
49 AFS_OS_NONFSOBJS =
50
51
52 # System specific build commands and flags
53 CC = gcc
54 LD = ld
55 # -Wall
56 <i386_linux22 i386_linux24>
57 CCFLAGS =   -O2 -fomit-frame-pointer \
58         -fno-strength-reduce -pipe -march=i486 -malign-loops=2 -malign-jumps=2 \
59         -malign-functions=2
60 DEFINES = -D__KERNEL__  -DCPU=586 -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF} ${KDEFINES}
61 <alpha_linux_22 alpha_linux_24>
62 CCFLAGS = -O2 -fomit-frame-pointer -fno-strength-reduce -pipe -mno-fp-regs -ffixed-8
63 DEFINES = -D__KERNEL__ -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF}
64 <s390_linux22 s390_linux24>
65 CCFLAGS =   -O -fomit-frame-pointer -fno-strength-reduce \
66         -fno-strict-aliasing -fsigned-char 
67 DEFINES = -D__KERNEL__  -D__s390__ -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF}
68 <sparc_linux22 sparc_linux24>
69 LD = ld -m elf32_sparc
70 CCFLAGS =   -O2 -fomit-frame-pointer \
71         -fno-strength-reduce -pipe -mcpu=v8 -mno-fpu -fcall-used-g5 -fcall-used-g7
72 DEFINES = -D__KERNEL__  -DCPU=sparc -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF}
73 <sparc64_linux22 sparc64_linux24>
74 CC = sparc64-linux-gcc
75 LD = ld -m elf64_sparc
76 CCFLAGS =   -O2 -fomit-frame-pointer \
77         -fno-strength-reduce -pipe -mcpu=ultrasparc -m64 -mno-fpu -mcmodel=medlow -ffixed-g4 -fcall-used-g5 -fcall-used-g7 -Wno-sign-compare
78 DEFINES = -D__KERNEL__  -DCPU=sparc64 -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF}
79 <ppc_linux22 ppc_linux24>
80 CCFLAGS =   -O2 -fomit-frame-pointer -fno-strength-reduce \
81         -fno-strict-aliasing -fsigned-char -msoft-float -pipe \
82         -fno-builtin -ffixed-r2
83 DEFINES = -D__KERNEL__  -D__powerpc__ -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF}
84 <ia64_linux24>
85 CCFLAGS =   -O2 -fomit-frame-pointer -fno-strict-aliasing -pipe \
86         -ffixed-r13 -mfixed-range=f10-f15,f32-f127 -falign-functions=32 -mb-step
87 DEFINES = -D__KERNEL__ -DKERNEL -D_KERNEL ${SMP_DEF} -DMODULE
88 <all>
89 INCLUDES = -I. -I../ -I${TOP_SRCDIR}/config
90
91 CFLAGS = $(CCFLAGS) $(DEFINES) $(INCLUDES)
92
93 # Name of directory to hold object files and libraries.
94 KOBJ = MODLOAD
95 MPS = @MPS@
96
97 # COMPDIRS is called in Makefile.common to do the actual builds.
98 COMPDIRS=linux_compdirs
99 INSTDIRS=linux_instdirs
100 DESTDIRS=linux_destdirs
101
102 include Makefile.common
103
104 LINUX_VERS=@LINUX_VERSION@
105 LINUX_KERNEL_PATH=@LINUX_KERNEL_PATH@
106 LINUX_MODULE_NAME=
107 LOCAL_SMP_DEF=
108
109 setup:
110         -$(RM) -f h net netinet sys rpc
111         -ln -s rx rpc
112         for m in ${MPS} ; do \
113                 KDIR=$(KOBJ)-${LINUX_VERS}${LINUX_MODULE_NAME}-$$m; \
114                 mkdir -p $${KDIR}; \
115                 ln -fs ../Makefile $${KDIR}/Makefile ; \
116                 ln -fs ../Makefile.common $${KDIR}/Makefile.common; \
117                 ln -fs ../config $${KDIR}/config; \
118         done 
119         
120 # Compile SP and MP clients as requested
121
122 ${COMPDIRS} ${INSTDIRS} ${DESTDIRS}:
123         $(RM) -f h 
124         ln -s ${LINUX_KERNEL_PATH}/include/linux h 
125         $(RM) -f linux 
126         ln -s ${LINUX_KERNEL_PATH}/include/linux linux 
127         $(RM) -f net 
128         ln -s ${LINUX_KERNEL_PATH}/include/linux net 
129         $(RM) -f netinet 
130         ln -s ${LINUX_KERNEL_PATH}/include/linux netinet 
131         $(RM) -f sys
132         ln -s ${LINUX_KERNEL_PATH}/include/linux sys
133         $(RM) -f asm-generic
134         ln -s ${LINUX_KERNEL_PATH}/include/asm-generic asm-generic
135         $(RM) -f asm
136 <alpha_linux_22 alpha_linux_24>
137         ln -s ${LINUX_KERNEL_PATH}/include/asm-alpha asm
138 <i386_linux22 i386_linux24>
139         ln -s ${LINUX_KERNEL_PATH}/include/asm-i386 asm
140 <s390_linux22 s390_linux24>
141         ln -s ${LINUX_KERNEL_PATH}/include/asm-s390 asm
142 <ppc_linux22 ppc_linux24>
143         ln -s ${LINUX_KERNEL_PATH}/include/asm-ppc asm 
144 <sparc_linux22 sparc_linux24>
145         ln -s ${LINUX_KERNEL_PATH}/include/asm-sparc asm
146 <sparc64_linux22 sparc64_linux24>
147         ln -s ${LINUX_KERNEL_PATH}/include/asm-sparc64 asm
148 <ia64_linux24>
149         ln -s ${LINUX_KERNEL_PATH}/include/asm-ia64 asm
150 <all>
151         for m in ${MPS} ; do \
152                 KDIR=${KOBJ}-${LINUX_VERS}${LINUX_MODULE_NAME}-$$m ; \
153                 echo Building in directory: $${KDIR} ; \
154                 if [ "$$m" = "MP" ] ; then \
155                         SMP_DEF="-DAFS_SMP @RHCONFIG_MP@ ${LOCAL_SMP_DEF}" ; \
156                         TARG="libafs.mp" ; \
157                 else  \
158                         SMP_DEF="@RHCONFIG_SP@ ${LOCAL_SMP_DEF}" ; \
159                         TARG=libafs ; \
160                 fi ; \
161                 cd $${KDIR} ; \
162                 $(MAKE) SMP_DEF="$${SMP_DEF}" $@_$${TARG} CLIENT=${LINUX_VERS}${LINUX_MODULE_NAME} || exit $$?; \
163                 cd ../ ; \
164         done
165
166 linux_compdirs_libafs: libafs
167 linux_compdirs_libafs.mp: libafs.mp
168 linux_instdirs_libafs: install_libafs
169 linux_instdirs_libafs.mp: install_libafs.mp
170 linux_destdirs_libafs: dest_libafs
171 linux_destdirs_libafs.mp: dest_libafs.mp
172
173
174 # Below this line are targets when in the COMMON directory:
175 # For Linux there is no kernel NFS server.
176 LIBAFS = libafs-${CLIENT}.o
177 LIBAFS_MP = libafs-${CLIENT}.mp.o
178
179 INST_LIBAFS = ${DESTDIR}${afskerneldir}/${LIBAFS}
180 INST_LIBAFS_MP = ${DESTDIR}${afskerneldir}/${LIBAFS_MP}
181
182 DEST_LIBAFS = ${DEST}/root.client/usr/vice/etc/modload/${LIBAFS}
183 DEST_LIBAFS_MP = ${DEST}/root.client/usr/vice/etc/modload/${LIBAFS_MP}
184
185
186 libafs: $(LIBAFS) 
187         echo SP Build Complete
188
189 libafs.mp: $(LIBAFS_MP)
190         echo MP Build Complete
191
192 ${LIBAFS}: $(AFSAOBJS) $(AFSNONFSOBJS)
193         $(RM) -f $@
194         $(LD) -r -o $@ $(AFSAOBJS) $(AFSNONFSOBJS)
195
196 ${LIBAFS_MP}: $(AFSAOBJS) $(AFSNONFSOBJS)
197         $(RM) -f $@
198         $(LD) -r -o $@ $(AFSAOBJS) $(AFSNONFSOBJS)
199
200 install_libafs: $(INST_LIBAFS) 
201         echo SP Install Complete
202
203 install_libafs.mp: $(INST_LIBAFS_MP)
204         echo MP Install Complete
205
206 dest_libafs:    $(DEST_LIBAFS) 
207         echo SP Install Complete
208
209 dest_libafs.mp: $(DEST_LIBAFS_MP)
210         echo MP Install Complete
211
212 $(INST_LIBAFS): $(LIBAFS)
213         ${INSTALL} -f $? $@
214
215 $(INST_LIBAFS_MP): $(LIBAFS_MP)
216         ${INSTALL} -f $? $@
217
218 $(DEST_LIBAFS): $(LIBAFS)
219         ${INSTALL} -f $? $@
220
221 $(DEST_LIBAFS_MP): $(LIBAFS_MP)
222         ${INSTALL} -f $? $@
223
224
225 # Linux specific objects
226 osi_alloc.o: $(AFS)/osi_alloc.c
227         $(CRULE1)
228 osi_cred.o: $(AFS)/osi_cred.c
229         $(CRULE1)
230 osi_groups.o: $(AFS)/osi_groups.c
231         $(CRULE1)
232 osi_file.o: $(AFS)/osi_file.c
233         $(CRULE1)
234 osi_inode.o: $(AFS)/osi_inode.c
235         $(CRULE1)
236 osi_misc.o: $(AFS)/osi_misc.c
237         $(CRULE1)
238 osi_module.o: $(AFS)/osi_module.c
239         $(CRULE1)
240 osi_sleep.o: $(AFS)/osi_sleep.c
241         $(CRULE1)
242 osi_vfsops.o: $(AFS)/osi_vfsops.c
243         $(CRULE1)
244 osi_vm.o: $(AFS)/osi_vm.c
245         $(CRULE1)
246 osi_vnodeops.o: $(AFS)/osi_vnodeops.c
247         $(CRULE1)
248 xdr.o: $(RX)/xdr.c
249         $(CRULE1)
250 xdr_int64.o: $(RX)/xdr_int64.c
251         $(CRULE1)
252 xdr_array.o: $(RX)/xdr_array.c
253         $(CRULE1)