Fix build with objdir != srcdir.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65826 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Mikhail Glushenkov 2009-03-02 09:03:36 +00:00
parent 95e2aa8967
commit b14f5b5e9d
6 changed files with 46 additions and 53 deletions

View File

@ -9,6 +9,8 @@
LEVEL = ../..
#ifndef LLVMC_PLUGIN
# The current plan is to make the user copy the skeleton project and change only
# this file (and plugins/UserPlugin, of course).
@ -18,3 +20,43 @@ export LLVMC_BUILTIN_PLUGINS = Base Clang
DIRS = plugins driver
include $(LEVEL)/Makefile.common
else # LLVMC_PLUGIN
# We are included from plugins/PluginName/Makefile...
# TODO: This part must be merged into Makefile.rules.
LEVEL = ../../../..
LIBRARYNAME := $(patsubst %,plugin_llvmc_%,$(LLVMC_PLUGIN))
REQUIRES_EH := 1
# Build a dynamic library if the user runs `make` from plugins/PluginName
ifndef LLVMC_BUILTIN_PLUGIN
LOADABLE_MODULE = 1
endif
# TableGen stuff...
ifneq ($(BUILT_SOURCES),)
BUILD_AUTOGENERATED_INC=1
endif
include $(LEVEL)/Makefile.common
ifdef BUILD_AUTOGENERATED_INC
TOOLS_SOURCE := $(strip $(wildcard $(PROJ_SRC_DIR)/*.td))
TD_COMMON :=$(strip $(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

View File

@ -1,49 +0,0 @@
##===- tools/llvmc/Makefile.llvmc --------------------------*- Makefile -*-===##
#
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open
# Source License. See LICENSE.TXT for details.
#
##===----------------------------------------------------------------------===##
# TODO: This must be eventually merged into Makefile.rules.
ifdef LLVMC_PLUGIN
# We are included from plugins/PluginName/Makefile...
LEVEL = ../../../..
LIBRARYNAME := $(patsubst %,plugin_llvmc_%,$(LLVMC_PLUGIN))
REQUIRES_EH := 1
# Build a dynamic library if the user runs `make` from plugins/PluginName
ifndef LLVMC_BUILTIN_PLUGIN
LOADABLE_MODULE = 1
endif
# TableGen stuff...
ifneq ($(BUILT_SOURCES),)
BUILD_AUTOGENERATED_INC=1
endif
include $(LEVEL)/Makefile.common
ifdef BUILD_AUTOGENERATED_INC
TOOLS_SOURCE := $(strip $(wildcard $(PROJ_SRC_DIR)/*.td))
TD_COMMON :=$(strip $(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

View File

@ -12,4 +12,4 @@ LEVEL = ../..
LLVMC_PLUGIN = Base
BUILT_SOURCES = AutoGenerated.inc
include $(LEVEL)/Makefile.llvmc
include $(LEVEL)/Makefile

View File

@ -12,4 +12,4 @@ LEVEL = ../..
LLVMC_PLUGIN = Clang
BUILT_SOURCES = AutoGenerated.inc
include $(LEVEL)/Makefile.llvmc
include $(LEVEL)/Makefile

View File

@ -11,4 +11,4 @@ LEVEL = ../..
LLVMC_PLUGIN = Hello
include $(LEVEL)/Makefile.llvmc
include $(LEVEL)/Makefile

View File

@ -12,4 +12,4 @@ LEVEL = ../..
LLVMC_PLUGIN = Simple
BUILT_SOURCES = AutoGenerated.inc
include $(LEVEL)/Makefile.llvmc
include $(LEVEL)/Makefile