From: Mikhail Glushenkov Date: Fri, 3 Oct 2008 10:26:37 +0000 (+0000) Subject: Fix build breakage when objdir!=srcdir (proper fix). X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=c32dece5a84980d3c82db5b4cb9fd4fc279618ce;p=oota-llvm.git Fix build breakage when objdir!=srcdir (proper fix). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56999 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/tools/llvmc2/Makefile b/tools/llvmc2/Makefile index 63f933deb2e..3f35de09178 100644 --- a/tools/llvmc2/Makefile +++ b/tools/llvmc2/Makefile @@ -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 diff --git a/tools/llvmc2/plugins/Base/Makefile b/tools/llvmc2/plugins/Base/Makefile index d8f7610b07e..89cdaf4a9e8 100644 --- a/tools/llvmc2/plugins/Base/Makefile +++ b/tools/llvmc2/plugins/Base/Makefile @@ -9,4 +9,4 @@ LLVMC_PLUGIN = Base -include ../Makefile.plugins +include ../Makefile diff --git a/tools/llvmc2/plugins/Clang/Makefile b/tools/llvmc2/plugins/Clang/Makefile index da1043ed04c..e48824aa952 100644 --- a/tools/llvmc2/plugins/Clang/Makefile +++ b/tools/llvmc2/plugins/Clang/Makefile @@ -9,5 +9,5 @@ LLVMC_PLUGIN = Clang -include ../Makefile.plugins +include ../Makefile diff --git a/tools/llvmc2/plugins/Hello/Makefile b/tools/llvmc2/plugins/Hello/Makefile index 0fcaaa7dc5d..f0d51ddbfcb 100644 --- a/tools/llvmc2/plugins/Hello/Makefile +++ b/tools/llvmc2/plugins/Hello/Makefile @@ -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 index 00000000000..568752e5784 --- /dev/null +++ b/tools/llvmc2/plugins/Makefile @@ -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 index 51e297d3758..00000000000 --- a/tools/llvmc2/plugins/Makefile.plugins +++ /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