Fix build breakage when objdir!=srcdir (proper fix).
authorMikhail Glushenkov <foldr@codedgers.com>
Fri, 3 Oct 2008 10:26:37 +0000 (10:26 +0000)
committerMikhail Glushenkov <foldr@codedgers.com>
Fri, 3 Oct 2008 10:26:37 +0000 (10:26 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56999 91177308-0d34-0410-b5e6-96231b3b80d8

tools/llvmc2/Makefile
tools/llvmc2/plugins/Base/Makefile
tools/llvmc2/plugins/Clang/Makefile
tools/llvmc2/plugins/Hello/Makefile
tools/llvmc2/plugins/Makefile [new file with mode: 0644]
tools/llvmc2/plugins/Makefile.plugins [deleted file]

index 63f933deb2ec488a5a30a6ff65c243d28d205bd5..3f35de0917836da870fb6d6183906d481c0e9605 100644 (file)
@@ -11,10 +11,9 @@ LEVEL = ../..
 
 BUILTIN_PLUGINS = Base
 DRIVER_NAME = llvmc2
-DIRS = $(patsubst %,plugins/%,$(BUILTIN_PLUGINS)) src
+DIRS = plugins src
 
 export BUILTIN_PLUGINS
 export DRIVER_NAME
-export BUILTIN_LLVMC_PLUGIN=1
 
 include $(LEVEL)/Makefile.common
index d8f7610b07e41a0e3b595de7cc2d82c020612fa4..89cdaf4a9e811f2e98fab9477651c10854fa0356 100644 (file)
@@ -9,4 +9,4 @@
 
 LLVMC_PLUGIN = Base
 
-include ../Makefile.plugins
+include ../Makefile
index da1043ed04c4c7b81582ae399b4d39b6dbe58ee5..e48824aa9523352e1ecc8a2c710940d3fe7aafaf 100644 (file)
@@ -9,5 +9,5 @@
 
 LLVMC_PLUGIN = Clang
 
-include ../Makefile.plugins
+include ../Makefile
 
index 0fcaaa7dc5daa331a752fa1daedd77f1f7ade9a9..f0d51ddbfcbb0a828094f663284659f9e5f84565 100644 (file)
@@ -9,4 +9,4 @@
 
 LLVMC_PLUGIN = Hello
 
-include ../Makefile.plugins
+include ../Makefile
diff --git a/tools/llvmc2/plugins/Makefile b/tools/llvmc2/plugins/Makefile
new file mode 100644 (file)
index 0000000..568752e
--- /dev/null
@@ -0,0 +1,54 @@
+##===- tools/llvmc2/plugins/Makefile.plugins ----------------*- Makefile -*-===##
+#
+#                     The LLVM Compiler Infrastructure
+#
+# This file is distributed under the University of Illinois Open
+# Source License. See LICENSE.TXT for details.
+#
+##===----------------------------------------------------------------------===##
+
+ifndef LLVMC_PLUGIN
+
+LEVEL = ../../..
+DIRS = $(BUILTIN_PLUGINS)
+
+# TOFIX: DSO versions of plugins are not built
+
+export BUILTIN_LLVMC_PLUGIN=1
+
+include $(LEVEL)/Makefile.common
+
+else # LLVMC_PLUGIN
+
+LEVEL = ../../../..
+
+LIBRARYNAME = $(patsubst %,LLVMC%,$(LLVMC_PLUGIN))
+TOOLS_SOURCE = $(wildcard $(PROJ_SRC_DIR)/*.td)
+REQUIRES_EH = 1
+
+ifndef BUILTIN_LLVMC_PLUGIN
+LOADABLE_MODULE = 1
+endif
+
+ifneq ($(TOOLS_SOURCE),"")
+BUILD_AUTOGENERATED_INC=1
+BUILT_SOURCES = AutoGenerated.inc
+endif
+
+include $(LEVEL)/Makefile.common
+
+# TOFIX: This should go into Makefile.rules
+
+ifdef BUILD_AUTOGENERATED_INC
+TD_COMMON = $(wildcard $(LLVM_SRC_ROOT)/include/llvm/CompilerDriver/*.td)
+
+$(ObjDir)/AutoGenerated.inc.tmp: $(TOOLS_SOURCE) $(ObjDir)/.dir \
+                               $(TBLGEN) $(TD_COMMON)
+       $(Echo) "Building LLVMC configuration library with tblgen"
+       $(Verb) $(TableGen) -gen-llvmc -o $(call SYSPATH, $@) $<
+
+AutoGenerated.inc : $(ObjDir)/AutoGenerated.inc.tmp
+       $(Verb) $(CMP) -s $@ $< || $(CP) $< $@
+endif # BUILD_AUTOGENERATED_INC
+
+endif # LLVMC_PLUGIN
diff --git a/tools/llvmc2/plugins/Makefile.plugins b/tools/llvmc2/plugins/Makefile.plugins
deleted file mode 100644 (file)
index 51e297d..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-##===- tools/llvmc2/plugins/Makefile.plugins ----------------*- Makefile -*-===##
-#
-#                     The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open
-# Source License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-
-LEVEL = ../../../..
-
-ifndef LLVMC_PLUGIN
-$(error LLVMC_PLUGIN variable is not defined!)
-endif
-
-LIBRARYNAME = $(patsubst %,LLVMC%,$(LLVMC_PLUGIN))
-TOOLS_SOURCE = $(wildcard $(PROJ_SRC_DIR)/*.td)
-REQUIRES_EH = 1
-
-ifndef BUILTIN_LLVMC_PLUGIN
-LOADABLE_MODULE = 1
-endif
-
-ifneq ($(TOOLS_SOURCE),"")
-BUILD_AUTOGENERATED_INC=1
-BUILT_SOURCES = AutoGenerated.inc
-endif
-
-include $(LEVEL)/Makefile.common
-
-# TOFIX: This should go into Makefile.rules
-
-ifdef BUILD_AUTOGENERATED_INC
-TD_COMMON = $(wildcard $(LLVM_SRC_ROOT)/include/llvm/CompilerDriver/*.td)
-
-$(ObjDir)/AutoGenerated.inc.tmp: $(TOOLS_SOURCE) $(ObjDir)/.dir \
-                               $(TBLGEN) $(TD_COMMON)
-       $(Echo) "Building LLVMC configuration library with tblgen"
-       $(Verb) $(TableGen) -gen-llvmc -o $(call SYSPATH, $@) $<
-
-AutoGenerated.inc : $(ObjDir)/AutoGenerated.inc.tmp
-       $(Verb) $(CMP) -s $@ $< || $(CP) $< $@
-endif