aboutsummaryrefslogtreecommitdiffstats
path: root/tools/llvm-config
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2006-04-20 21:13:58 +0000
committerReid Spencer <rspencer@reidspencer.com>2006-04-20 21:13:58 +0000
commit05dee5064f691d6e1f5c141a7b9862fa345dcb54 (patch)
treed8bf09f6e632e61838c49ac78f7c511cf343c787 /tools/llvm-config
parent563ff1cc92416b64942cef457d459fe1b87dabd3 (diff)
downloadexternal_llvm-05dee5064f691d6e1f5c141a7b9862fa345dcb54.zip
external_llvm-05dee5064f691d6e1f5c141a7b9862fa345dcb54.tar.gz
external_llvm-05dee5064f691d6e1f5c141a7b9862fa345dcb54.tar.bz2
Several Changes To Support Building llvm-config:
1. If Perl is not available, don't run Perl dependent targets. 2. Check in FinalLibDeps.txt for build environments that can't build it because there's no Perl processor. 3. Ensure that FinalLibDeps.txt depends on LibDeps.txt so it is automatically regenerated. 4. Support objdir != srcdir building. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27915 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-config')
-rw-r--r--tools/llvm-config/FinalLibDeps.txt25
-rw-r--r--tools/llvm-config/Makefile27
2 files changed, 42 insertions, 10 deletions
diff --git a/tools/llvm-config/FinalLibDeps.txt b/tools/llvm-config/FinalLibDeps.txt
new file mode 100644
index 0000000..48131a6
--- /dev/null
+++ b/tools/llvm-config/FinalLibDeps.txt
@@ -0,0 +1,25 @@
+LLVMAlpha.o: LLVMCodeGen.o LLVMCore.o LLVMSelectionDAG.o libLLVMScalarOpts.a libLLVMSupport.a libLLVMTarget.a
+LLVMAsmParser.o: LLVMCore.o
+LLVMBCReader.o: LLVMCore.o libLLVMSupport.a libLLVMSystem.a
+LLVMBCWriter.o: LLVMCore.o libLLVMSupport.a
+LLVMCBackend.o: LLVMCodeGen.o LLVMCore.o libLLVMAnalysis.a libLLVMScalarOpts.a libLLVMSupport.a libLLVMTarget.a libLLVMipa.a
+LLVMCodeGen.o LLVMSelectionDAG.o libLLVMAnalysis.a libLLVMTarget.a libLLVMTransformUtils.a libLLVMipa.a libLLVMAnalysis.a libLLVMTarget.a libLLVMTransformUtils.a libLLVMipa.a: LLVMCore.o libLLVMSupport.a libLLVMSystem.a
+LLVMCore.o: libLLVMSupport.a
+LLVMDataStructure.o: LLVMCore.o libLLVMAnalysis.a libLLVMSupport.a libLLVMTarget.a
+LLVMDebugger.o: LLVMBCReader.o LLVMCore.o libLLVMSupport.a libLLVMSystem.a
+LLVMExecutionEngine.o: LLVMCore.o libLLVMSupport.a libLLVMSystem.a libLLVMTarget.a
+LLVMIA64.o: LLVMCodeGen.o LLVMCore.o LLVMSelectionDAG.o libLLVMScalarOpts.a libLLVMSupport.a libLLVMTarget.a
+LLVMInterpreter.o: LLVMCore.o LLVMExecutionEngine.o libLLVMSupport.a libLLVMSystem.a libLLVMTarget.a
+LLVMJIT.o: LLVMCore.o LLVMExecutionEngine.o libLLVMSupport.a libLLVMSystem.a libLLVMTarget.a
+LLVMPowerPC.o: LLVMCodeGen.o LLVMCore.o LLVMSelectionDAG.o libLLVMScalarOpts.a libLLVMSupport.a libLLVMTarget.a
+LLVMSparc.o: LLVMCodeGen.o LLVMCore.o LLVMSelectionDAG.o libLLVMScalarOpts.a libLLVMSupport.a libLLVMTarget.a
+LLVMX86.o: LLVMCodeGen.o LLVMCore.o LLVMSelectionDAG.o libLLVMScalarOpts.a libLLVMSupport.a libLLVMTarget.a
+LLVMbzip2.o:
+libLLVMArchive.a: LLVMBCReader.o LLVMCore.o libLLVMSupport.a libLLVMSystem.a
+libLLVMInstrumentation.a: LLVMCore.o libLLVMScalarOpts.a libLLVMSupport.a libLLVMTransformUtils.a
+libLLVMLinker.a: LLVMBCReader.o LLVMCore.o libLLVMArchive.a libLLVMSystem.a
+libLLVMScalarOpts.a: LLVMCore.o libLLVMAnalysis.a libLLVMSupport.a libLLVMTarget.a libLLVMTransformUtils.a
+libLLVMSupport.a: LLVMbzip2.o libLLVMSystem.a
+libLLVMSystem.a:
+libLLVMTransforms.a: LLVMCore.o libLLVMSupport.a libLLVMTarget.a libLLVMTransformUtils.a
+libLLVMipo.a: LLVMCore.o libLLVMAnalysis.a libLLVMSupport.a libLLVMTarget.a libLLVMTransformUtils.a libLLVMipa.a
diff --git a/tools/llvm-config/Makefile b/tools/llvm-config/Makefile
index 0fdbe82..81a0103 100644
--- a/tools/llvm-config/Makefile
+++ b/tools/llvm-config/Makefile
@@ -1,4 +1,4 @@
-##===- utils/llvm-config/Makefile --------------------------*- Makefile -*-===##
+##===- tools/llvm-config/Makefile --------------------------*- Makefile -*-===##
#
# The LLVM Compiler Infrastructure
#
@@ -21,40 +21,47 @@ SUB_CXXFLAGS = ${CPP.BaseFlags} ${CXX.Flags}
# user to use libtool when linking against LLVM.
SUB_LDFLAGS =
+FinalLibDeps = $(PROJ_SRC_DIR)/FinalLibDeps.txt
+ifdef HAVE_PERL
+ifeq ($(HAVE_PERL),1)
+LibDeps = $(PROJ_SRC_DIR)/LibDeps.txt
+GenLibDeps = $(PROJ_SRC_ROOT)/utils/GenLibDeps.pl
# MANUAL USE ONLY! GenLibDeps.pl is very non-portable, so LibDeps.txt
# should only be re-built manually. No other rule in this file should
# depend on LibDeps.txt.
-LibDeps.txt: $(LEVEL)/utils/GenLibDeps.pl $(LibDir)
+$(LibDeps): $(GenLibDeps) $(LibDir)
$(Echo) "Regenerating LibDeps.txt"
- $(Verb) $(LLVM_SRC_ROOT)/utils/GenLibDeps.pl -flat $(LibDir) | \
- sort > LibDeps.txt
+ $(Verb) $(GenLibDeps) -flat $(LibDir) | sort > $(LibDeps)
# Find all the cyclic dependencies between various LLVM libraries, so we
# don't have to process them at runtime.
-FinalLibDeps.txt: find-cycles.pl # LibDeps.txt deliberately omitted.
+$(FinalLibDeps): find-cycles.pl $(LibDeps)
$(Echo) "Finding cyclic dependencies between LLVM libraries."
$(Verb) $(PERL) $< < $(PROJ_SRC_DIR)/LibDeps.txt > $@
+endif
+endif
# Rerun our configure substitutions as needed.
-llvm-config.in: llvm-config.in.in $(ConfigStatusScript)
+ConfigInIn = $(PROJ_SRC_DIR)/llvm-config.in.in
+llvm-config.in: $(ConfigInIn) $(ConfigStatusScript)
$(Verb) cd $(PROJ_OBJ_ROOT) ; \
- $(ConfigStatusScript) utils/llvm-config/llvm-config.in
+ $(ConfigStatusScript) tools/llvm-config/llvm-config.in
# Build our final script.
-llvm-config: llvm-config.in FinalLibDeps.txt
+llvm-config: llvm-config.in $(FinalLibDeps)
$(Echo) "Building llvm-config script."
$(Verb) $(ECHO) 's,@LLVM_CXXFLAGS@,$(SUB_CXXFLAGS),' > temp.sed
$(Verb) $(ECHO) 's,@LLVM_LDFLAGS@,$(SUB_LDFLAGS),' >> temp.sed
$(Verb) $(ECHO) 's,@CORE_IS_ARCHIVE@,$(CORE_IS_ARCHIVE),' >> temp.sed
$(Verb) $(SED) -f temp.sed < $< > $@
$(Verb) $(RM) temp.sed
- $(Verb) cat FinalLibDeps.txt >> $@
+ $(Verb) cat $(FinalLibDeps) >> $@
$(Verb) chmod +x llvm-config
# Hook into the standard Makefile rules.
all-local:: llvm-config
clean-local::
- $(Verb) $(RM) -f FinalLibDeps.txt llvm-config llvm-config.in
+ $(Verb) $(RM) -f llvm-config llvm-config.in
install-local:: all-local
$(Echo) Installing llvm-config
$(Verb) $(MKDIR) $(PROJ_bindir)