From 14ae8ecc01e8d6e83f5d321fe209dac46a646680 Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Tue, 28 Aug 2007 22:55:26 +0200 Subject: [PATCH] Makefile.lib: Add support for "unless" config-driven rules Normally, you can add some objects or subdirs to the build if some config variable is set to yes, by doing: SUBDIRS-$(CONFIG_FOO) Now you can do it the other way too, including stuff if some variable is set to no: SUBDIRS-unless$(CONFIG_FOO) This will be used for switching between two HTML parser implementations. --- Makefile.lib | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Makefile.lib b/Makefile.lib index 96c85185..3eef2857 100644 --- a/Makefile.lib +++ b/Makefile.lib @@ -74,11 +74,11 @@ quiet_cmd_uninstall = " [$(UNINSTALL_COLOR)UNINSTALL$(END_COLOR)] $(3)/$(n ############################################################################# # Special handling of conditional variables -SUBDIRS += $(SUBDIRS-yes) -OBJS += $(OBJS-yes) +SUBDIRS += $(SUBDIRS-yes) $(SUBDIRS-unlessno) $(SUBDIRS-unless) +OBJS += $(OBJS-yes) $(OBJS-unlessno) $(SUBDIRS-unless) -ALTDIRS = $(SUBDIRS-no) $(SUBDIRS-) -ALTOBJS = $(OBJS-no) $(OBJS-) +ALTDIRS = $(SUBDIRS-no) $(SUBDIRS-) $(SUBDIRS-unlessyes) +ALTOBJS = $(OBJS-no) $(OBJS-) $(OBJS-unlessyes) ifneq ($(findstring cleanall,$(MAKECMDGOALS)),) INCLUDE_ALL=1 @@ -206,7 +206,7 @@ TESTDEPS += \ $(top_builddir)/src/util/string.o \ $(top_builddir)/src/util/time.o -TESTDEPS += $(TESTDEPS-yes) +TESTDEPS += $(TESTDEPS-yes) $(TESTDEPS-unlessno) TEST_LIB=$(top_srcdir)/test/libtest.sh export TEST_LIB