llvm-6502/tools/llvmc2/plugins/Makefile

58 lines
1.4 KiB
Makefile
Raw Normal View History

##===- 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: How to build DSO versions of plugins?
export BUILTIN_LLVMC_PLUGIN=1
include $(LEVEL)/Makefile.common
else # LLVMC_PLUGIN
LEVEL = ../../../..
LIBRARYNAME := $(patsubst %,LLVMC%,$(LLVMC_PLUGIN))
REQUIRES_EH = 1
ifndef BUILTIN_LLVMC_PLUGIN
LOADABLE_MODULE = 1
endif
# This probably breaks the build with $ObjDir != $SrcDir
TOOLS_SOURCE := $(strip $(wildcard *.td))
ifneq ($(TOOLS_SOURCE),)
BUILD_AUTOGENERATED_INC = 1
BUILT_SOURCES = AutoGenerated.inc
endif
include $(LEVEL)/Makefile.common
# TOFIX: This probably should go into Makefile.rules
ifdef BUILD_AUTOGENERATED_INC
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