mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-17 05:29:24 +00:00
Re-apply Makefile changes. Fix build with srcdir != objdir.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57636 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
e79f5ef4e7
commit
cc30d9caa5
@ -9,11 +9,9 @@
|
|||||||
|
|
||||||
LEVEL = ../..
|
LEVEL = ../..
|
||||||
|
|
||||||
##### FIXME: Does not work when objdir != srcdir
|
BUILTIN_PLUGINS = Base
|
||||||
#####BUILTIN_PLUGINS = Base
|
|
||||||
|
|
||||||
DRIVER_NAME = llvmc2
|
DRIVER_NAME = llvmc2
|
||||||
DIRS = plugins driver
|
DIRS = plugins driver
|
||||||
|
|
||||||
export BUILTIN_PLUGINS
|
export BUILTIN_PLUGINS
|
||||||
export DRIVER_NAME
|
export DRIVER_NAME
|
||||||
|
@ -121,7 +121,7 @@ generic::
|
|||||||
|
|
||||||
$ mv Simple.td MyPlugin.td
|
$ mv Simple.td MyPlugin.td
|
||||||
|
|
||||||
Note that the plugin source directory should be placed into
|
Note that the plugin source directory should be placed under
|
||||||
``$LLVMC_DIR/plugins`` to make use of the existing build
|
``$LLVMC_DIR/plugins`` to make use of the existing build
|
||||||
infrastructure. To build a version of the LLVMC executable called
|
infrastructure. To build a version of the LLVMC executable called
|
||||||
``mydriver`` with your plugin compiled in, use the following command::
|
``mydriver`` with your plugin compiled in, use the following command::
|
||||||
|
@ -8,5 +8,6 @@
|
|||||||
##===----------------------------------------------------------------------===##
|
##===----------------------------------------------------------------------===##
|
||||||
|
|
||||||
LLVMC_PLUGIN = Base
|
LLVMC_PLUGIN = Base
|
||||||
|
BUILT_SOURCES = AutoGenerated.inc
|
||||||
|
|
||||||
include ../Makefile
|
include ../Makefile
|
||||||
|
1
tools/llvmc2/plugins/Base/PluginMain.cpp
Normal file
1
tools/llvmc2/plugins/Base/PluginMain.cpp
Normal file
@ -0,0 +1 @@
|
|||||||
|
#include "AutoGenerated.inc"
|
@ -8,6 +8,7 @@
|
|||||||
##===----------------------------------------------------------------------===##
|
##===----------------------------------------------------------------------===##
|
||||||
|
|
||||||
LLVMC_PLUGIN = Clang
|
LLVMC_PLUGIN = Clang
|
||||||
|
BUILT_SOURCES = AutoGenerated.inc
|
||||||
|
|
||||||
include ../Makefile
|
include ../Makefile
|
||||||
|
|
||||||
|
1
tools/llvmc2/plugins/Clang/PluginMain.cpp
Normal file
1
tools/llvmc2/plugins/Clang/PluginMain.cpp
Normal file
@ -0,0 +1 @@
|
|||||||
|
#include "AutoGenerated.inc"
|
@ -12,8 +12,7 @@ ifndef LLVMC_PLUGIN
|
|||||||
LEVEL = ../../..
|
LEVEL = ../../..
|
||||||
DIRS = $(BUILTIN_PLUGINS)
|
DIRS = $(BUILTIN_PLUGINS)
|
||||||
|
|
||||||
# TOFIX: DSO versions of plugins are not built
|
# TOFIX: Should we also build DSO versions of plugins?
|
||||||
|
|
||||||
export BUILTIN_LLVMC_PLUGIN=1
|
export BUILTIN_LLVMC_PLUGIN=1
|
||||||
|
|
||||||
include $(LEVEL)/Makefile.common
|
include $(LEVEL)/Makefile.common
|
||||||
@ -22,25 +21,27 @@ else # LLVMC_PLUGIN
|
|||||||
|
|
||||||
LEVEL = ../../../..
|
LEVEL = ../../../..
|
||||||
|
|
||||||
LIBRARYNAME = $(patsubst %,LLVMC%,$(LLVMC_PLUGIN))
|
LIBRARYNAME := $(patsubst %,LLVMC%,$(LLVMC_PLUGIN))
|
||||||
TOOLS_SOURCE = $(wildcard $(PROJ_SRC_DIR)/*.td)
|
|
||||||
REQUIRES_EH = 1
|
REQUIRES_EH = 1
|
||||||
|
|
||||||
ifndef BUILTIN_LLVMC_PLUGIN
|
ifndef BUILTIN_LLVMC_PLUGIN
|
||||||
LOADABLE_MODULE = 1
|
LOADABLE_MODULE = 1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq ($(TOOLS_SOURCE),"")
|
ifneq ($(BUILT_SOURCES),)
|
||||||
BUILD_AUTOGENERATED_INC=1
|
BUILD_AUTOGENERATED_INC=1
|
||||||
BUILT_SOURCES = AutoGenerated.inc
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
include $(LEVEL)/Makefile.common
|
include $(LEVEL)/Makefile.common
|
||||||
|
|
||||||
# TOFIX: This should go into Makefile.rules
|
# TOFIX: This probably should go into Makefile.rules
|
||||||
|
|
||||||
ifdef BUILD_AUTOGENERATED_INC
|
ifdef BUILD_AUTOGENERATED_INC
|
||||||
TD_COMMON = $(wildcard $(LLVM_SRC_ROOT)/include/llvm/CompilerDriver/*.td)
|
|
||||||
|
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 \
|
$(ObjDir)/AutoGenerated.inc.tmp: $(TOOLS_SOURCE) $(ObjDir)/.dir \
|
||||||
$(TBLGEN) $(TD_COMMON)
|
$(TBLGEN) $(TD_COMMON)
|
||||||
|
13
tools/llvmc2/plugins/Simple/Makefile
Normal file
13
tools/llvmc2/plugins/Simple/Makefile
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
##===- tools/llvmc2/plugins/Simple/Makefile ------------------*- Makefile -*-===##
|
||||||
|
#
|
||||||
|
# The LLVM Compiler Infrastructure
|
||||||
|
#
|
||||||
|
# This file is distributed under the University of Illinois Open Source
|
||||||
|
# License. See LICENSE.TXT for details.
|
||||||
|
#
|
||||||
|
##===----------------------------------------------------------------------===##
|
||||||
|
|
||||||
|
LLVMC_PLUGIN = Simple
|
||||||
|
BUILT_SOURCES = AutoGenerated.inc
|
||||||
|
|
||||||
|
include ../Makefile
|
1
tools/llvmc2/plugins/Simple/PluginMain.cpp
Normal file
1
tools/llvmc2/plugins/Simple/PluginMain.cpp
Normal file
@ -0,0 +1 @@
|
|||||||
|
#include "AutoGenerated.inc"
|
30
tools/llvmc2/plugins/Simple/Simple.td
Normal file
30
tools/llvmc2/plugins/Simple/Simple.td
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
// A simple wrapper for gcc.
|
||||||
|
// To compile, use this command:
|
||||||
|
//
|
||||||
|
// $ cd $LLVMC2_DIR
|
||||||
|
// $ make DRIVER_NAME=mygcc BUILTIN_PLUGINS=Simple
|
||||||
|
//
|
||||||
|
// To build this plugin as a dynamic library:
|
||||||
|
//
|
||||||
|
// $ cd $LLVMC2_DIR
|
||||||
|
// $ make BUILTIN_PLUGINS=""
|
||||||
|
// $ cd plugins/Simple
|
||||||
|
// $ make
|
||||||
|
//
|
||||||
|
// Run as:
|
||||||
|
//
|
||||||
|
// $ llvmc2 -load $LLVM_DIR/Release/lib/LLVMCSimple.so
|
||||||
|
|
||||||
|
include "llvm/CompilerDriver/Common.td"
|
||||||
|
|
||||||
|
def gcc : Tool<
|
||||||
|
[(in_language "c"),
|
||||||
|
(out_language "executable"),
|
||||||
|
(output_suffix "out"),
|
||||||
|
(cmd_line "gcc $INFILE -o $OUTFILE"),
|
||||||
|
(sink)
|
||||||
|
]>;
|
||||||
|
|
||||||
|
def LanguageMap : LanguageMap<[LangToSuffixes<"c", ["c"]>]>;
|
||||||
|
|
||||||
|
def CompilationGraph : CompilationGraph<[Edge<root, gcc>]>;
|
Loading…
Reference in New Issue
Block a user