Linux build: properly install built kernel module
authorMarc Dionne <marc.c.dionne@gmail.com>
Mon, 13 Jul 2009 02:03:36 +0000 (22:03 -0400)
committerDerrick Brashear <shadow@dementia.org>
Mon, 13 Jul 2009 14:53:52 +0000 (08:53 -0600)
Fix a problem introduced by the recent parallel make patches - the
resulting kernel module was not getting copied to the install or
dest location.
Copy some of the code from the COMPDIRS target for INSTDIRS and
DESTDIRS.  We still have to call into the lower level make and have it
install the module.

Reviewed-on: http://gerrit.openafs.org/67
Verified-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

src/libafs/MakefileProto.LINUX.in

index e3babb5..474b091 100644 (file)
@@ -168,9 +168,30 @@ setup:
 
 # Compile SP and MP clients as requested
 
-${INSTDIRS}:
-
-${DESTDIRS}:
+${INSTDIRS} ${DESTDIRS}: ${COMPDIRS}
+       if [ "${LINUX_KERNEL_PACKAGING}" ] ; then \
+           TARGPREFIX="pack_"; \
+       fi ; \
+       for m in ${MPS} ; do \
+               KDIR=${KOBJ}-${LINUX_VERSION}${LINUX_MODULE_NAME}-$$m ; \
+               echo Building in directory: $${KDIR} ; \
+               if [ "$$m" = "MP" ] ; then \
+                       SMP_DEF="-DAFS_SMP @RHCONFIG_MP@ ${LOCAL_SMP_DEF}" ; \
+                       TARG="libafs.mp" ; \
+               elif [ "$$m" = "EP" ] ; then \
+                       SMP_DEF="-DAFS_SMP @RHCONFIG_MP@ ${LOCAL_SMP_DEF}" ; \
+                       TARG="libafs.ep" ; \
+               elif [ "$$m" = "BM" ] ; then \
+                       SMP_DEF="-DAFS_SMP @RHCONFIG_MP@ ${LOCAL_SMP_DEF}" ; \
+                       TARG="libafs.bm" ; \
+               else  \
+                       SMP_DEF="@RHCONFIG_SP@ ${LOCAL_SMP_DEF}" ; \
+                       TARG=libafs ; \
+               fi ; \
+               cd $${KDIR} ; \
+               $(MAKE) -f Makefile.afs SMP_DEF="$${SMP_DEF}" $@_$${TARGPREFIX}$${TARG} CLIENT=${LINUX_VERSION}${LINUX_MODULE_NAME} KDIR=$${KDIR} || exit $$?; \
+               cd ../ ; \
+       done
 
 ${COMPDIRS}: setup
        $(RM) -f h