summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2005-04-22 17:20:11 +0000
committerReid Spencer <rspencer@reidspencer.com>2005-04-22 17:20:11 +0000
commite4481c7c82efe9a4f0c64b064db5c013c45859fd (patch)
treed6f6e51bb55bb4b0b4613ccdc387b487d87ad5b9 /llvm
parentce9612b23c9612300d11c0d5b0c69498c74e2ca0 (diff)
downloadbcm5719-llvm-e4481c7c82efe9a4f0c64b064db5c013c45859fd.tar.gz
bcm5719-llvm-e4481c7c82efe9a4f0c64b064db5c013c45859fd.zip
Implement the --enable-targets= feature of the configure script. The make
variable TARGETS_TO_BUILD is used to determine which targets in lib/Target are built and which libraries are linked into llc. This effectively implements the feature. One item remains: disabling targets in the dejagnu test suite. llvm-svn: 21450
Diffstat (limited to 'llvm')
-rw-r--r--llvm/lib/Target/Makefile10
-rw-r--r--llvm/tools/llc/Makefile48
2 files changed, 45 insertions, 13 deletions
diff --git a/llvm/lib/Target/Makefile b/llvm/lib/Target/Makefile
index 5b69f49b2eb..ae70488a4d0 100644
--- a/llvm/lib/Target/Makefile
+++ b/llvm/lib/Target/Makefile
@@ -7,8 +7,14 @@
#
##===----------------------------------------------------------------------===##
LEVEL = ../..
-PARALLEL_DIRS = CBackend X86 SparcV8 SparcV9 PowerPC Alpha IA64 Skeleton
LIBRARYNAME = LLVMTarget
BUILD_ARCHIVE = 1
-include $(LEVEL)/Makefile.common
+# We include this early so we can access the value of TARGETS_TO_BUILD as the
+# value for PARALLEL_DIRS which must be set before Makefile.rules is included
+include $(LEVEL)/Makefile.config
+
+PARALLEL_DIRS := $(TARGETS_TO_BUILD)
+
+include $(LLVM_SRC_ROOT)/Makefile.rules
+
diff --git a/llvm/tools/llc/Makefile b/llvm/tools/llc/Makefile
index 6d7edf8efe7..8eff3c16129 100644
--- a/llvm/tools/llc/Makefile
+++ b/llvm/tools/llc/Makefile
@@ -9,22 +9,50 @@
LEVEL = ../..
TOOLNAME = llc
-USEDLIBS = \
+
+# Include this here so we can get the configuration of the targets
+# that have been configured for construction. We have to do this
+# early so we can set up USEDLIBS properly before includeing Makefile.rules
+include $(LEVEL)/Makefile.config
+
+# We always build the C Backend and the Skeleton
+USEDLIBS := LLVMCBackend LLVMSkeleton
+
+# Check for Sparc target
+ifneq ($(strip $(filter SparcV8,$(TARGETS_TO_BUILD))),)
+USEDLIBS += \
LLVMSparcV9ModuloSched \
- LLVMCBackend \
- LLVMPowerPC \
LLVMSparcV8 \
LLVMSparcV9 \
- LLVMX86 \
- LLVMAlpha \
- LLVMIA64 \
- LLVMSkeleton \
LLVMSparcV9RegAlloc \
LLVMSparcV9InstrSched \
+ LLVMSparcV9LiveVar
+endif
+
+#Check for X86 Target
+ifneq ($(strip $(filter X86,$(TARGETS_TO_BUILD))),)
+USEDLIBS += LLVMX86
+endif
+
+#Check for PowerPC Target
+ifneq ($(strip $(filter PowerPC,$(TARGETS_TO_BUILD))),)
+USEDLIBS += LLVMPowerPC
+endif
+
+#Check for Alpha Target
+ifneq ($(strip $(filter Alpha,$(TARGETS_TO_BUILD))),)
+USEDLIBS += LLVMAlpha
+endif
+
+#Check for IA64 Target
+ifneq ($(strip $(filter IA64,$(TARGETS_TO_BUILD))),)
+USEDLIBS += LLVMIA64
+endif
+
+USEDLIBS += \
LLVMSelectionDAG \
LLVMCodeGen \
LLVMTarget.a \
- LLVMSparcV9LiveVar \
LLVMipa.a \
LLVMTransforms.a \
LLVMScalarOpts \
@@ -37,7 +65,5 @@ USEDLIBS = \
LLVMbzip2 \
LLVMSystem.a
-TOOLLINKOPTS = $(PLATFORMLIBDL)
-
-include $(LEVEL)/Makefile.common
+include $(LLVM_SRC_ROOT)/Makefile.rules
OpenPOWER on IntegriCloud