Index: Makefile.rules |
=================================================================== |
--- Makefile.rules (revision 138929) |
+++ Makefile.rules (working copy) |
@@ -258,6 +258,9 @@ |
endif |
endif |
+CPP.Defines += $(patsubst %,-DTARGET_ENABLED_%,\ |
+ $(shell echo $(TARGETS_TO_BUILD) | tr a-z A-Z)) |
+ |
ifeq ($(ENABLE_PROFILING),1) |
BuildMode := $(BuildMode)+Profile |
CXX.Flags := $(filter-out -fomit-frame-pointer,$(CXX.Flags)) -pg -g |
@@ -694,13 +697,18 @@ |
ScriptInstall = $(INSTALL) -m 0755 |
DataInstall = $(INSTALL) -m 0644 |
+# Tell TableGen which targets were enabled to do additional filtering. |
+TABLEGEN_TARGET_FLAGS = $(patsubst %,-DTARGET_%,\ |
+ $(shell echo $(TARGETS_TO_BUILD) | tr a-z A-Z)) |
+ |
# When compiling under Mingw/Cygwin, the tblgen tool expects Windows |
# paths. In this case, the SYSPATH function (defined in |
# Makefile.config) transforms Unix paths into Windows paths. |
TableGen = $(TBLGEN) -I $(call SYSPATH, $(PROJ_SRC_DIR)) \ |
-I $(call SYSPATH, $(LLVM_SRC_ROOT)/include) \ |
-I $(call SYSPATH, $(PROJ_SRC_ROOT)/include) \ |
- -I $(call SYSPATH, $(PROJ_SRC_ROOT)/lib/Target) |
+ -I $(call SYSPATH, $(PROJ_SRC_ROOT)/lib/Target) \ |
+ $(TABLEGEN_TARGET_FLAGS) |
Archive = $(AR) $(AR.Flags) |
LArchive = $(LLVMToolDir)/llvm-ar rcsf |