Remove stale MakefileProto.LINUX.in conditionals
[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 srcdir=@srcdir@
9
10 include @TOP_OBJDIR@/src/config/Makefile.config
11
12 INSTALL = @INSTALL@
13 INSTALL_DATA = @INSTALL_DATA@
14 INSTALL_PROGRAM = @INSTALL_PROGRAM@
15 INSTALL_SCRIPT = @INSTALL_SCRIPT@
16
17 AFS_OS_CLEAN = .makelog
18
19 # OS specific object files:
20 AFS_OS_OBJS = \
21         osi_alloc.o \
22         osi_cred.o \
23         osi_crypto.o \
24         osi_gcpags.o \
25         osi_groups.o \
26         osi_inode.o \
27         osi_file.o \
28         osi_misc.o \
29         osi_module.o \
30         osi_probe.o \
31         osi_sleep.o \
32         osi_syscall.o \
33         osi_sysctl.o \
34         osi_vcache.o \
35         osi_vfsops.o \
36         osi_vm.o \
37 <ppc64_linux26>
38         osi_flush.o \
39 <all>
40         osi_export.o \
41         osi_nfssrv.o \
42         osi_ioctl.o \
43         osi_proc.o \
44         osi_vnodeops.o \
45         osi_pagecopy.o \
46         osi_fetchstore.o
47
48 AFS_OS_PAGOBJS = \
49         osi_alloc.o \
50         osi_cred.o \
51         osi_crypto.o \
52         osi_gcpags.o \
53         osi_groups.o \
54         osi_inode.o \
55         osi_misc.o \
56         osi_probe.o \
57         osi_sleep.o \
58         osi_syscall.o \
59 <ppc64_linux26>
60         osi_flush.o \
61 <all>
62         osi_ioctl.o \
63         osi_pag_module.o 
64
65 AFS_OS_NFSOBJS =
66
67 AFS_OS_NONFSOBJS =
68
69 COMMON_KERN_CFLAGS=$(KERN_DBG) $(KERN_OPTMZ) @LINUX_GCC_KOPTS@
70
71 COMMON_DEFINES=-D__KERNEL__ -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF}
72
73 LINUX_KERNEL_PATH=@LINUX_KERNEL_PATH@
74 LINUX_KERNEL_BUILD=@LINUX_KERNEL_BUILD@
75
76 CFLAGS_fcrypt.o = -I${TOP_SRCDIR}/rxkad -I$(TOP_OBJDIR)/src/rxkad
77 CFLAGS_crypt_conn.o = -I${TOP_SRCDIR}/rxkad -I$(TOP_OBJDIR)/src/rxkad
78 CFLAGS_rxkad_client.o = -I${TOP_SRCDIR}/rxkad -I$(TOP_OBJDIR)/src/rxkad
79 CFLAGS_rxkad_common.o = -I${TOP_SRCDIR}/rxkad -I$(TOP_OBJDIR)/src/rxkad
80 CFLAGS_opr_rbtree.o = -I${TOP_SRCDIR}/opr
81
82 CFLAGS_evp.o = -I$(TOP_SRCDIR)/external/heimdal/hcrypto \
83                -DHAVE_CONFIG_H
84 CFLAGS_evp-algs.o = -I$(TOP_SRCDIR)/external/heimdal/hcrypto
85 CFLAGS_evp-kernel.o = -I$(TOP_SRCDIR)/external/heimdal/hcrypto
86 CFLAGS_rand-fortuna-kernel.o = -I$(TOP_SRCDIR)/external/heimdal/hcrypto
87 CFLAGS_rand-timer-kernel.o = -I$(TOP_SRCDIR)/external/heimdal/hcrypto
88 CFLAGS_rand-kernel.o = -I$(TOP_SRCDIR)/external/heimdal/hcrypto
89 CFLAGS_aes.o = -I$(TOP_SRCDIR)/external/heimdal/hcrypto
90 CFLAGS_rijndael-alg-fst.o = -I$(TOP_SRCDIR)/external/heimdal/hcrypto \
91                             -DNO_CONFIG_H
92 CFLAGS_sha.o = -I$(TOP_SRCDIR)/external/heimdal/hcrypto
93 CFLAGS_sha256-kernel.o = -I$(TOP_SRCDIR)/external/heimdal/hcrypto
94 CFLAGS_md5.o = -I$(TOP_SRCDIR)/external/heimdal/hcrypto
95 CFLAGS_random.o = -I$(TOP_SRCDIR)/external/heimdal/hcrypto
96
97 RFC3961_INCLUDES = -I$(TOP_SRCDIR)/crypto/rfc3961 \
98                    -I$(TOP_SRCDIR)/external/heimdal/krb5
99
100 CFLAGS_crypto.o = $(RFC3961_INCLUDES)
101 CFLAGS_crypto-aes.o = $(RFC3961_INCLUDES)
102 CFLAGS_crypto-context.o = $(RFC3961_INCLUDES)
103 CFLAGS_crypto-copy.o = $(RFC3961_INCLUDES)
104 CFLAGS_crypto-ct.o = $(RFC3961_INCLUDES)
105 CFLAGS_crypto-evp.o = $(RFC3961_INCLUDES)
106 CFLAGS_crypto-data.o = $(RFC3961_INCLUDES)
107 CFLAGS_crypto-keyblock.o = $(RFC3961_INCLUDES)
108 CFLAGS_crypto-store-int.o = $(RFC3961_INCLUDES)
109 CFLAGS_crypto-random.o = $(RFC3961_INCLUDES)
110 CFLAGS_crypto-algs.o = $(RFC3961_INCLUDES)
111 CFLAGS_n-fold.o = $(RFC3961_INCLUDES)
112
113 # System specific build commands and flags
114 <linux26 linux_26>
115 # All the platform-specific and kernel-related things are provided by
116 # the kernel build system.  So we should _not_ use COMMON_KERN_CFLAGS!
117 CCFLAGS =
118 DEFINES = $(COMMON_DEFINES)
119
120 # CFLAGS_* and AFLAGS_* will be copied into the kbuild makefile
121 CFLAGS_afs_pag_user.o = -DAFS_PAG_MANAGER
122
123 <i386_umlinux26>
124 EXTRA_CFLAGS = -I$(LINUX_KERNEL_PATH)/arch/um/include -I$(LINUX_KERNEL_PATH)/arch/um/kernel/tt/include -I$(LINUX_KERNEL_PATH)/arch/um/kernel/skas/include
125
126 <all>
127 INCLUDES = -I. -I../ -I${TOP_OBJDIR}/src/config \
128   -I${TOP_SRCDIR}/rx -I${TOP_OBJDIR}/src/rxstat
129
130 CFLAGS = $(CCFLAGS) $(DEFINES) $(INCLUDES)
131
132 # Name of directory to hold object files and libraries.
133 KOBJ = MODLOAD
134 MPS = @MPS@
135
136 # COMPDIRS is called in Makefile.common to do the actual builds.
137 COMPDIRS=linux_compdirs
138 INSTDIRS=linux_instdirs
139 DESTDIRS=linux_destdirs
140
141 include Makefile.common
142
143 <linux26 linux_26 umlinux26>
144 LINUX_MODULE_EXT=ko
145 <all -linux26 -linux_26 -umlinux26>
146 LINUX_MODULE_EXT=o
147 <all>
148
149 LINUX_MODULE_NAME=
150 LOCAL_SMP_DEF=
151
152 setup:
153         -$(RM) -f h net netinet sys rpc
154         -ln -fs rx rpc
155         for m in ${MPS} ; do \
156                 KDIR=$(KOBJ)-${LINUX_VERSION}${LINUX_MODULE_NAME}-$$m; \
157                 mkdir -p $${KDIR}; \
158                 ln -fs ../Makefile $${KDIR}/Makefile.afs ; \
159                 ln -fs ../Makefile.common $${KDIR}/Makefile.common; \
160                 ln -fs ../config $${KDIR}/config; \
161         done 
162
163 # Compile SP and MP clients as requested
164
165 ${INSTDIRS} ${DESTDIRS}: ${COMPDIRS}
166         if [ "${LINUX_KERNEL_PACKAGING}" ] ; then \
167             TARGPREFIX="pack_"; \
168         fi ; \
169         for m in ${MPS} ; do \
170                 KDIR=${KOBJ}-${LINUX_VERSION}${LINUX_MODULE_NAME}-$$m ; \
171                 echo Building in directory: $${KDIR} ; \
172                 if [ "$$m" = "MP" ] ; then \
173                         SMP_DEF="-DAFS_SMP @RHCONFIG_MP@ ${LOCAL_SMP_DEF}" ; \
174                         TARG="libafs.mp" ; \
175                 elif [ "$$m" = "EP" ] ; then \
176                         SMP_DEF="-DAFS_SMP @RHCONFIG_MP@ ${LOCAL_SMP_DEF}" ; \
177                         TARG="libafs.ep" ; \
178                 elif [ "$$m" = "BM" ] ; then \
179                         SMP_DEF="-DAFS_SMP @RHCONFIG_MP@ ${LOCAL_SMP_DEF}" ; \
180                         TARG="libafs.bm" ; \
181                 else  \
182                         SMP_DEF="@RHCONFIG_SP@ ${LOCAL_SMP_DEF}" ; \
183                         TARG=libafs ; \
184                 fi ; \
185                 cd $${KDIR} ; \
186                 $(MAKE) -f Makefile.afs SMP_DEF="$${SMP_DEF}" $@_$${TARGPREFIX}$${TARG} CLIENT=${LINUX_VERSION}${LINUX_MODULE_NAME} KDIR=$${KDIR} || exit $$?; \
187                 cd ../ ; \
188         done
189
190 ${COMPDIRS}: setup
191         $(RM) -f h 
192         $(RM) -f sys
193         $(RM) -f netinet 
194         if [ -d ${LINUX_KERNEL_PATH}/include2 ] ; then                  \
195             ln -fs ${LINUX_KERNEL_PATH}/include2/asm/../linux h       ; \
196             ln -fs ${LINUX_KERNEL_PATH}/include2/asm/../linux sys     ; \
197             ln -fs ${LINUX_KERNEL_PATH}/include2/asm/../linux netinet ; \
198         else                                                            \
199             ln -fs ${LINUX_KERNEL_PATH}/include/linux h               ; \
200             ln -fs ${LINUX_KERNEL_PATH}/include/linux sys             ; \
201             ln -fs ${LINUX_KERNEL_PATH}/include/linux netinet         ; \
202         fi
203         $(RM) -f linux 
204         ln -fs ${LINUX_KERNEL_PATH}/include/linux linux 
205         $(RM) -f net 
206         ln -fs ${LINUX_KERNEL_PATH}/include/net net 
207         $(RM) -f asm-generic
208         ln -fs ${LINUX_KERNEL_PATH}/include/asm-generic asm-generic
209         $(RM) -f asm
210 <parisc_linux26>
211         ln -fs ${LINUX_KERNEL_PATH}/include/asm-parisc asm
212 <alpha_linux_26>
213         ln -fs ${LINUX_KERNEL_PATH}/include/asm-alpha asm
214 <i386_linux26>
215         ln -fs ${LINUX_KERNEL_PATH}/include/asm-i386 asm
216 <i386_umlinux26>
217         ln -fs ${LINUX_KERNEL_PATH}/include/asm-um asm
218         ln -fs ${LINUX_KERNEL_PATH}/arch/um/include/sysdep
219 <amd64_linux26>
220         ln -fs ${LINUX_KERNEL_PATH}/include/asm-x86_64 asm
221 <s390_linux26>
222         ln -fs ${LINUX_KERNEL_PATH}/include/asm-s390 asm
223 <s390x_linux26>
224         ln -fs ${LINUX_KERNEL_PATH}/include/asm-s390x asm
225 <ppc_linux26>
226         ln -fs ${LINUX_KERNEL_PATH}/include/asm-ppc asm 
227 <ppc64_linux26>
228         ln -s ${LINUX_KERNEL_PATH}/include/asm-ppc64 asm 
229 <sparc_linux26>
230         ln -fs ${LINUX_KERNEL_PATH}/include/asm-sparc asm
231 <sparc64_linux26>
232         ln -fs ${LINUX_KERNEL_PATH}/include/asm-sparc64 asm
233 <ia64_linux26>
234         ln -fs ${LINUX_KERNEL_PATH}/include/asm-ia64 asm
235 <all>
236         if [ "${LINUX_KERNEL_PACKAGING}" ] ; then \
237             TARGPREFIX="pack_"; \
238         fi ; \
239         for m in ${MPS} ; do \
240                 KDIR=${KOBJ}-${LINUX_VERSION}${LINUX_MODULE_NAME}-$$m ; \
241                 echo Building in directory: $${KDIR} ; \
242                 if [ "$$m" = "MP" ] ; then \
243                         SMP_DEF="-DAFS_SMP @RHCONFIG_MP@ ${LOCAL_SMP_DEF}" ; \
244                         TARG="libafs.mp" ; \
245                 elif [ "$$m" = "EP" ] ; then \
246                         SMP_DEF="-DAFS_SMP @RHCONFIG_MP@ ${LOCAL_SMP_DEF}" ; \
247                         TARG="libafs.ep" ; \
248                 elif [ "$$m" = "BM" ] ; then \
249                         SMP_DEF="-DAFS_SMP @RHCONFIG_MP@ ${LOCAL_SMP_DEF}" ; \
250                         TARG="libafs.bm" ; \
251                 else  \
252                         SMP_DEF="@RHCONFIG_SP@ ${LOCAL_SMP_DEF}" ; \
253                         TARG=libafs ; \
254                 fi ; \
255                 cd $${KDIR} ; \
256                 $(MAKE) -f Makefile.afs SMP_DEF="$${SMP_DEF}" $@_$${TARGPREFIX}$${TARG} CLIENT=${LINUX_VERSION}${LINUX_MODULE_NAME} KDIR=$${KDIR} || exit $$?; \
257                 cd ../ ; \
258 <all>
259         done
260
261 linux_compdirs_libafs: depsrcs libafs
262 linux_compdirs_libafs.mp: depsrcs libafs.mp
263 linux_compdirs_libafs.ep: depsrcs libafs.ep
264 linux_compdirs_libafs.bm: depsrcs libafs.bm
265 linux_instdirs_libafs: install_libafs
266 linux_instdirs_libafs.mp: install_libafs.mp
267 linux_instdirs_libafs.ep: install_libafs.ep
268 linux_instdirs_libafs.bm: install_libafs.bm
269 linux_destdirs_libafs: dest_libafs
270 linux_destdirs_libafs.mp: dest_libafs.mp
271 linux_destdirs_libafs.ep: dest_libafs.ep
272 linux_destdirs_libafs.bm: dest_libafs.bm
273
274 linux_compdirs_pack_libafs: depsrcs pack_libafs
275 linux_instdirs_pack_libafs: install_pack_libafs
276 linux_destdirs_pack_libafs: dest_pack_libafs
277
278 # Below this line are targets when in the COMMON directory:
279 # For Linux there is no kernel NFS server.
280 LIBAFS = ${LINUX_LIBAFS_NAME}-${CLIENT}.${LINUX_MODULE_EXT}
281 LIBAFS_MP = ${LINUX_LIBAFS_NAME}-${CLIENT}.mp.${LINUX_MODULE_EXT}
282 LIBAFS_EP = ${LINUX_LIBAFS_NAME}-${CLIENT}.ep.${LINUX_MODULE_EXT}
283 LIBAFS_BM = ${LINUX_LIBAFS_NAME}-${CLIENT}.bm.${LINUX_MODULE_EXT}
284
285 INST_LIBAFS = ${DESTDIR}${afskerneldir}/${LIBAFS}
286 INST_LIBAFS_MP = ${DESTDIR}${afskerneldir}/${LIBAFS_MP}
287 INST_LIBAFS_EP = ${DESTDIR}${afskerneldir}/${LIBAFS_EP}
288 INST_LIBAFS_BM = ${DESTDIR}${afskerneldir}/${LIBAFS_BM}
289
290 DEST_LIBAFS = ${DEST}/root.client/usr/vice/etc/modload/${LIBAFS}
291 DEST_LIBAFS_MP = ${DEST}/root.client/usr/vice/etc/modload/${LIBAFS_MP}
292 DEST_LIBAFS_EP = ${DEST}/root.client/usr/vice/etc/modload/${LIBAFS_EP}
293 DEST_LIBAFS_BM = ${DEST}/root.client/usr/vice/etc/modload/${LIBAFS_BM}
294
295 SYSTEM_LIBAFS = /lib/modules/${CLIENT}/extra/${LINUX_LIBAFS_NAME}/${LINUX_LIBAFS_NAME}.ko
296
297 INST_SYSTEM = ${DESTDIR}${SYSTEM_LIBAFS}
298 DEST_SYSTEM = ${DEST}/root.client${SYSTEM_LIBAFS}
299
300 libafs: $(LIBAFS) 
301         echo SP Build Complete
302
303 libafs.mp: $(LIBAFS_MP)
304         echo MP Build Complete
305
306 libafs.ep: $(LIBAFS_EP)
307         echo EP Build Complete
308
309 libafs.bm: $(LIBAFS_BM)
310         echo BM Build Complete
311
312 <linux26 linux_26 umlinux26>
313 pack_libafs: ${LINUX_LIBAFS_NAME}.ko
314         echo "Packaging Friendly Build Complete"
315
316 ${LIBAFS} ${LIBAFS_MP} ${LIBAFS_EP} ${LIBAFS_BM}: ${LINUX_LIBAFS_NAME}.ko
317         cp ${LINUX_LIBAFS_NAME}.ko $@
318
319 .FORCE:
320 ${LINUX_LIBAFS_NAME}.ko afspag.ko: .FORCE
321         env EXTRA_CFLAGS="${EXTRA_CFLAGS}" @TOP_SRCDIR@/libafs/make_kbuild_makefile.pl ${KDIR} $@ @TOP_OBJDIR@/src/config/Makefile.config Makefile.afs Makefile.common
322         ( env EXTRA_CFLAGS="${EXTRA_CFLAGS}" \
323                 $(MAKE) -C ${LINUX_KERNEL_BUILD} M=@TOP_OBJDIR@/src/libafs/${KDIR} modules 2>&1 \
324                 || echo "FAILURE: make exit code $$?" ) | tee .makelog
325         @if grep -E -q '^(FAILURE|WARNING)' .makelog; then \
326                 grep -q '^WARNING' .makelog && echo "Error: Undefined symbols in modules" ; \
327                 rm .makelog ; \
328                 exit 1 ; \
329         fi
330         rm .makelog
331
332 <all -linux26 -linux_26 -umlinux26>
333 ${LIBAFS}: $(AFSAOBJS) $(AFSNONFSOBJS)
334         $(RM) -f $@
335         $(LD) -r -o $@ $(AFSAOBJS) $(AFSNONFSOBJS)
336
337 ${LIBAFS_MP}: $(AFSAOBJS) $(AFSNONFSOBJS)
338         $(RM) -f $@
339         $(LD) -r -o $@ $(AFSAOBJS) $(AFSNONFSOBJS)
340
341 ${LIBAFS_EP}: $(AFSAOBJS) $(AFSNONFSOBJS)
342         $(RM) -f $@
343         $(LD) -r -o $@ $(AFSAOBJS) $(AFSNONFSOBJS)
344
345 ${LIBAFS_BM}: $(AFSAOBJS) $(AFSNONFSOBJS)
346         $(RM) -f $@
347         $(LD) -r -o $@ $(AFSAOBJS) $(AFSNONFSOBJS)
348 <all>
349
350 install_libafs: $(LIBAFS) 
351         ${INSTALL} -d ${DESTDIR}${afskerneldir}
352         ${INSTALL} -m 644 $(LIBAFS) $(INST_LIBAFS)
353         echo SP Install Complete
354
355 install_pack_libafs: $(LINUX_LIBAFS_NAME).ko
356         ${INSTALL} -d ${DESTDIR}/lib/modules/${CLIENT}/extra/${LINUX_LIBAFS_NAME}
357         ${INSTALL} -m 644 $(LINUX_LIBAFS_NAME).ko $(INST_SYSTEM)
358         echo Packaging Friendly Install Complete
359
360 install_libafs.mp: $(LIBAFS_MP)
361         ${INSTALL} -d ${DESTDIR}${afskerneldir}
362         ${INSTALL} -m 644 $(LIBAFS_MP) $(INST_LIBAFS_MP)
363         echo MP Install Complete
364
365 install_libafs.ep: $(LIBAFS_EP)
366         ${INSTALL} -d ${DESTDIR}${afskerneldir}
367         ${INSTALL} -m 644 $(LIBAFS_EP) $(INST_LIBAFS_EP)
368         echo EP Install Complete
369
370 install_libafs.bm: $(LIBAFS_BM)
371         ${INSTALL} -d ${DESTDIR}${afskerneldir}
372         ${INSTALL} -m 644 $(LIBAFS_BM) $(INST_LIBAFS_BM)
373         echo BM Install Complete
374
375 dest_libafs:    $(LIBAFS) 
376         ${INSTALL} -d ${DEST}/root.client/usr/vice/etc/modload
377         ${INSTALL} -m 644 $(LIBAFS) $(DEST_LIBAFS)
378         echo SP Install Complete
379
380 dest_pack_libafs: $(LINUX_LIBAFS_NAME).ko
381         ${INSTALL} -d ${DEST}/root.client/lib/modules/${CLIENT}/extra/${LINUX_LIBAFS_NAME}
382         ${INSTALL} -m 644 $(LINUX_LIBAFS_NAME).ko $(DEST_SYSTEM)
383         echo Packaging Friendly Install Complete
384
385 dest_libafs.mp: $(LIBAFS_MP)
386         ${INSTALL} -d ${DEST}/root.client/usr/vice/etc/modload
387         ${INSTALL} -m 644 $(LIBAFS_MP) $(DEST_LIBAFS_MP)
388         echo MP Install Complete
389
390 dest_libafs.ep: $(LIBAFS_EP)
391         ${INSTALL} -d ${DEST}/root.client/usr/vice/etc/modload
392         ${INSTALL} -m 644 $(LIBAFS_EP) $(DEST_LIBAFS_EP)
393         echo EP Install Complete
394
395 dest_libafs.bm: $(LIBAFS_BM)
396         ${INSTALL} -d ${DEST}/root.client/usr/vice/etc/modload
397         ${INSTALL} -m 644 $(LIBAFS_BM) $(DEST_LIBAFS_BM)
398         echo BM Install Complete