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