llvm-config: Replace with C++ version (was llvm-config-2).
[oota-llvm.git] / Makefile.rules
index ec631b2db0d04021dee3bde5a6f5081b5d608b79..b2132f11cb22f6a5b45ed458b3919a9140510186 100644 (file)
@@ -86,12 +86,20 @@ LLVMConfigLibraryDependenciesInc := \
 #
 # Note that this target gets its real dependencies generated for us by
 # llvm-build.
-$(LLVMBuildMakeFrag):
+#
+# We include a dependency on this Makefile to ensure that changes to the
+# generation command get picked up.
+$(LLVMBuildMakeFrag): $(PROJ_SRC_ROOT)/Makefile.rules
        $(Echo) Constructing LLVMBuild project information.
        $(Verb) $(LLVMBuildTool) \
+         --native-target "$(ARCH)" \
+         --enable-targets "$(TARGETS_TO_BUILD)" \
          --write-library-table $(LLVMConfigLibraryDependenciesInc) \
          --write-make-fragment $(LLVMBuildMakeFrag)
 
+# For completeness, let Make know how the extra files are generated.
+$(LLVMConfigLibraryDependenciesInc): $(LLVMBuildMakeFrag)
+
 # Include the generated Makefile fragment.
 #
 # We currently only include the dependencies for the fragment itself if we are
@@ -998,11 +1006,16 @@ ifdef LINK_COMPONENTS
 
 # If LLVM_CONFIG doesn't exist, build it.  This can happen if you do a make
 # clean in tools, then do a make in tools (instead of at the top level).
+#
+# We don't want these targets when actually building the LLVM_CONFIG tool
+# itself, of course.
+ifneq ($(TOOLNAME),llvm-config)
 $(LLVM_CONFIG):
        @echo "*** llvm-config doesn't exist - rebuilding it."
        @$(MAKE) -C $(PROJ_OBJ_ROOT)/tools/llvm-config
 
 $(ToolDir)/$(strip $(TOOLNAME))$(EXEEXT): $(LLVM_CONFIG)
+endif
 
 ifeq ($(ENABLE_SHARED), 1)
 # We can take the "auto-import" feature to get rid of using dllimport.