Hi guys,

the patch in attachment allows to disable the build/install targets for each
specific subsystem in the tree.

thanks also to Joel Becker for a bunch of filter-out hints.

Please apply or ACK and I will apply.
Fabio

-- 
I'm going to make him an offer he can't refuse.
? make/defines.mk
Index: Makefile
===================================================================
RCS file: /cvs/cluster/cluster/Makefile,v
retrieving revision 1.30
diff -u -r1.30 Makefile
--- Makefile    19 Sep 2007 19:47:07 -0000      1.30
+++ Makefile    20 Sep 2007 21:42:37 -0000
@@ -16,8 +16,26 @@
 
 MODULES=${KERNEL} ${USERLAND}
 
-KSUBDIRS=gnbd-kernel/src gfs-kernel/src/gfs
-SUBDIRS=ccs cman dlm group fence gfs gfs2 gnbd rgmanager
+KREALSUBDIRS=gnbd-kernel/src gfs-kernel/src/gfs
+
+KSUBDIR=$(filter-out \
+         $(if ${without_gnbd},gnbd-kernel/src) \
+         $(if ${without_gfs},gfs-kernel/src/gfs) \
+       , $(KREALSUBDIRS))
+
+REALSUBDIRS=ccs cman dlm group fence gfs gfs2 gnbd rgmanager
+
+SUBDIRS=$(filter-out \
+         $(if ${without_ccs},ccs) \
+         $(if ${without_cman},cman) \
+         $(if ${without_dlm},dlm) \
+         $(if ${without_group},group) \
+         $(if ${without_fence},fence) \
+         $(if ${without_gfs},gfs) \
+         $(if ${without_gfs2},gfs2) \
+         $(if ${without_gnbd},gnbd) \
+         $(if ${without_rgmanager},rgmanager) \
+       , $(REALSUBDIRS))
 
 all: build
 
@@ -33,10 +51,10 @@
 kernel-modules: ${KERNEL}
 
 gnbd-kernel:
-       ${MAKE} -C gnbd-kernel/src all
+       [ -n "${without_gnbd}" ] || ${MAKE} -C gnbd-kernel/src all
 
 gfs-kernel:
-       ${MAKE} -C gfs-kernel/src/gfs
+       [ -n "${without_gfs}" ] || ${MAKE} -C gfs-kernel/src/gfs
 
 # userland stuff
 # make all target can't be folded in a for loop otherwise make -j breaks
@@ -45,39 +63,39 @@
 userland: scripts ${USERLAND}
 
 cman-lib:
-       ${MAKE} -C cman/lib all
+       [ -n "${without_cman}" ] || ${MAKE} -C cman/lib all
 
 ccs: cman-lib
-       ${MAKE} -C ccs all
+       [ -n "${without_ccs}" ] || ${MAKE} -C ccs all
 
 cman: ccs
-       ${MAKE} -C cman all
+       [ -n "${without_cman}" ] || ${MAKE} -C cman all
 
 dlm:
-       ${MAKE} -C dlm all
+       [ -n "${without_dlm}" ] || ${MAKE} -C dlm all
 
 group: ccs dlm
-       ${MAKE} -C group all
+       [ -n "${without_group}" ] || ${MAKE} -C group all
 
 fence: group dlm
-       ${MAKE} -C fence all
+       [ -n "${without_fence}" ] || ${MAKE} -C fence all
 
 gfs:
-       ${MAKE} -C gfs all
+       [ -n "${without_gfs}" ] || ${MAKE} -C gfs all
 
 gfs2:
-       ${MAKE} -C gfs2 all
+       [ -n "${without_gfs2}" ] || ${MAKE} -C gfs2 all
 
 gnbd: cman-lib
-       ${MAKE} -C gnbd all
+       [ -n "${without_gnbd}" ] || ${MAKE} -C gnbd all
 
 rgmanager: ccs dlm
-       ${MAKE} -C rgmanager all
+       [ -n "${without_rgmanager}" ] || ${MAKE} -C rgmanager all
 
 # end of build
 
 clean:
-       set -e && for i in ${KSUBDIRS} ${SUBDIRS}; do ${MAKE} -C $$i $@; done
+       set -e && for i in ${KREALSUBDIRS} ${REALSUBDIRS}; do ${MAKE} -C $$i 
$@; done
 
 distclean: clean
        rm -f make/defines.mk
Index: configure
===================================================================
RCS file: /cvs/cluster/cluster/configure,v
retrieving revision 1.32
diff -u -r1.32 configure
--- configure   19 Sep 2007 11:07:21 -0000      1.32
+++ configure   20 Sep 2007 21:42:37 -0000
@@ -68,6 +68,15 @@
        enable_xen => \$enable_xen,
        release_major => \$release_major,
        release_minor => \$release_minor,
+       without_ccs => \$without_ccs,
+       without_cman => \$without_cman,
+       without_dlm => \$without_dlm,
+       without_group => \$without_group,
+       without_fence => \$without_fence,
+       without_gfs => \$without_gfs,
+       without_gfs2 => \$without_gfs2,
+       without_gnbd => \$without_gnbd,
+       without_rgmanager => \$without_rgmanager,
 );
 
 $err = &GetOptions (\%options,
@@ -114,7 +123,16 @@
                    'release_major=s',
                    'release_minor=s',
                    'fence_agents=s',
-                   'enable_xen');
+                   'enable_xen',
+                   'without_ccs',
+                   'without_cman',
+                   'without_dlm',
+                   'without_group',
+                   'without_fence',
+                   'without_gfs',
+                   'without_gfs2',
+                   'without_gnbd',
+                   'without_rgmanager');
 
 if(!$err) {
   $ret = 1;
@@ -171,6 +189,15 @@
   print "--fence_agents=\tlist of fence agents to configure.  (Default: 
all)\n";
   print "\t\tUse --fence_agents=help for a list\n";
   print "--enable_xen\tEnable building of Xen-specific pieces\n";
+  print "--without_ccs\tDisable ccs building  (Default: enabled)\n";
+  print "--without_cman\tDisable cman building  (Default: enabled)\n";
+  print "--without_dlm\tDisable dlm building  (Default: enabled)\n";
+  print "--without_group\tDisable group building  (Default: enabled)\n";
+  print "--without_fence\tDisable fence building  (Default: enabled)\n";
+  print "--without_gfs\tDisable gfs building  (Default: enabled)\n";
+  print "--without_gfs2\tDisable gfs2 building  (Default: enabled)\n";
+  print "--without_gnbd\tDisable gnbd building  (Default: enabled)\n";
+  print "--without_rgmanager\tDisable rgmanager building  (Default: 
enabled)\n";
   exit $ret;
 }
 
@@ -376,6 +403,16 @@
   $_ =~ s/[EMAIL PROTECTED]@/$sharedir/;
   $_ =~ s/[EMAIL PROTECTED]@/$fence_agents/;
   $_ =~ s/[EMAIL PROTECTED]@/$enable_xen/;
+  $_ =~ s/[EMAIL PROTECTED]@/$without_ccs/;
+  $_ =~ s/[EMAIL PROTECTED]@/$without_cman/;
+  $_ =~ s/[EMAIL PROTECTED]@/$without_dlm/;
+  $_ =~ s/[EMAIL PROTECTED]@/$without_group/;
+  $_ =~ s/[EMAIL PROTECTED]@/$without_fence/;
+  $_ =~ s/[EMAIL PROTECTED]@/$without_gfs/;
+  $_ =~ s/[EMAIL PROTECTED]@/$without_gfs2/;
+  $_ =~ s/[EMAIL PROTECTED]@/$without_gnbd/;
+  $_ =~ s/[EMAIL PROTECTED]@/$without_rgmanager/;
+
   print OFILE "$_\n";
 }
 
Index: make/defines.mk.input
===================================================================
RCS file: /cvs/cluster/cluster/make/defines.mk.input,v
retrieving revision 1.4
diff -u -r1.4 defines.mk.input
--- make/defines.mk.input       19 Sep 2007 11:07:21 -0000      1.4
+++ make/defines.mk.input       20 Sep 2007 21:42:38 -0000
@@ -63,6 +63,15 @@
 virtlibdir ?= @VIRTLIBDIR@
 fence_agents ?= @FENCE_AGENTS@
 enable_xen ?= @ENABLE_XEN@
+without_ccs ?= @DISABLE_CCS@
+without_cman ?= @DISABLE_CMAN@
+without_dlm ?= @DISABLE_DLM@
+without_group ?= @DISABLE_GROUP@
+without_fence ?= @DISABLE_FENCE@
+without_gfs ?= @DISABLE_GFS@
+without_gfs2 ?= @DISABLE_GFS2@
+without_gnbd ?= @DISABLE_GNBD@
+without_rgmanager ?= @DISABLE_RGMANAGER@
 
 UNINSTALL = @BUILDDIR@/scripts/uninstall.pl
 DEF2VAR = @BUILDDIR@/scripts/define2var

Reply via email to