2008-11-25 21:38:12 +00:00
|
|
|
##===- tools/llvmc/Makefile --------------------------------*- Makefile -*-===##
|
2008-03-23 08:57:20 +00:00
|
|
|
#
|
|
|
|
# The LLVM Compiler Infrastructure
|
|
|
|
#
|
|
|
|
# This file is distributed under the University of Illinois Open
|
|
|
|
# Source License. See LICENSE.TXT for details.
|
|
|
|
#
|
|
|
|
##===----------------------------------------------------------------------===##
|
2008-10-02 21:15:05 +00:00
|
|
|
|
2008-03-23 08:57:20 +00:00
|
|
|
LEVEL = ../..
|
|
|
|
|
2009-03-02 09:03:36 +00:00
|
|
|
#ifndef LLVMC_PLUGIN
|
|
|
|
|
2009-03-02 09:01:14 +00:00
|
|
|
# The current plan is to make the user copy the skeleton project and change only
|
|
|
|
# this file (and plugins/UserPlugin, of course).
|
|
|
|
|
|
|
|
export LLVMC_BASED_DRIVER_NAME = llvmc
|
|
|
|
export LLVMC_BUILTIN_PLUGINS = Base Clang
|
2008-10-02 21:15:05 +00:00
|
|
|
|
2009-03-02 09:01:14 +00:00
|
|
|
DIRS = plugins driver
|
2008-10-02 21:15:05 +00:00
|
|
|
|
2008-03-23 08:57:20 +00:00
|
|
|
include $(LEVEL)/Makefile.common
|
2009-03-02 09:03:36 +00:00
|
|
|
|
|
|
|
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
|