summaryrefslogtreecommitdiff
path: root/tools/llvm-config/Makefile
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2006-03-22 15:59:55 +0000
committerReid Spencer <rspencer@reidspencer.com>2006-03-22 15:59:55 +0000
commitf2722ca33913feb7c0eafe31dc5851a2ab7466fe (patch)
treeb91d0e3c68c3d0fa04506f24386aba18cf2ef21d /tools/llvm-config/Makefile
parent63d3300da1ec6403fbf11f62d6404c7f87bffdba (diff)
downloadllvm-f2722ca33913feb7c0eafe31dc5851a2ab7466fe.tar.gz
llvm-f2722ca33913feb7c0eafe31dc5851a2ab7466fe.tar.bz2
llvm-f2722ca33913feb7c0eafe31dc5851a2ab7466fe.tar.xz
These changes are necessary to support the new llvm-config tool. llvm-config
is a handy tool for users of LLVM who want to be able to quickly get information about LLVM's configuration. It is intended to be used in the command line of other tools. Documentation will be forthcoming in a subsequent patch. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26952 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-config/Makefile')
-rw-r--r--tools/llvm-config/Makefile44
1 files changed, 43 insertions, 1 deletions
diff --git a/tools/llvm-config/Makefile b/tools/llvm-config/Makefile
index 34dfa5542b..8a11a279d1 100644
--- a/tools/llvm-config/Makefile
+++ b/tools/llvm-config/Makefile
@@ -1,5 +1,5 @@
##===- utils/llvm-config/Makefile --------------------------*- Makefile -*-===##
-#
+#
# The LLVM Compiler Infrastructure
#
# This file was developed by Reid Spencer and Eric Kidd and is distributed under
@@ -12,5 +12,47 @@ LEVEL = ../..
include $(LEVEL)/Makefile.common
+# Combine preprocessor flags (except for -I) and CXX flags.
+SUB_CXXFLAGS = ${CPP.BaseFlags} ${CXX.Flags}
+
+# This is blank for now. We need to be careful about adding stuff here:
+# LDFLAGS tend not to be portable, and we don't currently require the
+# user to use libtool when linking against LLVM.
+SUB_LDFLAGS =
+
+# 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)
$(LEVEL)/utils/GenLibDeps.pl -flat $(LibDir) | sort > LibDeps.txt
+
+# 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.
+ $(Echo) "Finding cyclic dependencies between LLVM libraries."
+ $(Verb) $< < $(PROJ_SRC_DIR)/LibDeps.txt > $@
+
+# Rerun our configure substitutions as needed.
+llvm-config.in: llvm-config.in.in $(ConfigStatusScript)
+ $(Verb) cd $(PROJ_OBJ_ROOT) ; \
+ $(ConfigStatusScript) utils/llvm-config/llvm-config.in
+
+# Build our final script.
+llvm-config: llvm-config.in FinalLibDeps.txt
+ $(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) 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
+install-local:: all-local
+ $(Echo) Installing llvm-config
+ $(Verb) $(MKDIR) $(PROJ_bindir)
+ $(Verb) $(ScriptInstall) llvm-config $(PROJ_bindir)