diff options
author | Mikhail Glushenkov <foldr@codedgers.com> | 2008-10-15 09:28:50 +0000 |
---|---|---|
committer | Mikhail Glushenkov <foldr@codedgers.com> | 2008-10-15 09:28:50 +0000 |
commit | a01ab7f381948934502eb5caabc25f239867933e (patch) | |
tree | 9db15ddde4591fccc706ca1d6bb5dd4062cfdb68 /tools | |
parent | a1e6eb8b731f9274ee82fb16ca4a6496be054bae (diff) | |
download | external_llvm-a01ab7f381948934502eb5caabc25f239867933e.zip external_llvm-a01ab7f381948934502eb5caabc25f239867933e.tar.gz external_llvm-a01ab7f381948934502eb5caabc25f239867933e.tar.bz2 |
llvmc2: Some Makefile fixes and renames.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57567 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r-- | tools/llvmc2/Makefile | 2 | ||||
-rw-r--r-- | tools/llvmc2/examples/Simple.td | 17 | ||||
-rw-r--r-- | tools/llvmc2/plugins/Base/PluginMain.cpp (renamed from tools/llvmc2/plugins/Base/AutoGenerated.cpp) | 0 | ||||
-rw-r--r-- | tools/llvmc2/plugins/Clang/PluginMain.cpp (renamed from tools/llvmc2/plugins/Clang/AutoGenerated.cpp) | 0 | ||||
-rw-r--r-- | tools/llvmc2/plugins/Makefile | 17 | ||||
-rw-r--r-- | tools/llvmc2/plugins/Simple/Makefile | 12 | ||||
-rw-r--r-- | tools/llvmc2/plugins/Simple/PluginMain.cpp | 1 | ||||
-rw-r--r-- | tools/llvmc2/plugins/Simple/Simple.td | 30 |
8 files changed, 54 insertions, 25 deletions
diff --git a/tools/llvmc2/Makefile b/tools/llvmc2/Makefile index 3012065..22ca29e 100644 --- a/tools/llvmc2/Makefile +++ b/tools/llvmc2/Makefile @@ -11,7 +11,7 @@ LEVEL = ../.. BUILTIN_PLUGINS = Base DRIVER_NAME = llvmc2 -DIRS = plugins driver +DIRS = plugins driver export BUILTIN_PLUGINS export DRIVER_NAME diff --git a/tools/llvmc2/examples/Simple.td b/tools/llvmc2/examples/Simple.td deleted file mode 100644 index 4885301..0000000 --- a/tools/llvmc2/examples/Simple.td +++ /dev/null @@ -1,17 +0,0 @@ -// A simple wrapper for gcc. -// To compile, use this command: -// TOFIX - -include "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>]>; diff --git a/tools/llvmc2/plugins/Base/AutoGenerated.cpp b/tools/llvmc2/plugins/Base/PluginMain.cpp index add8acb..add8acb 100644 --- a/tools/llvmc2/plugins/Base/AutoGenerated.cpp +++ b/tools/llvmc2/plugins/Base/PluginMain.cpp diff --git a/tools/llvmc2/plugins/Clang/AutoGenerated.cpp b/tools/llvmc2/plugins/Clang/PluginMain.cpp index add8acb..add8acb 100644 --- a/tools/llvmc2/plugins/Clang/AutoGenerated.cpp +++ b/tools/llvmc2/plugins/Clang/PluginMain.cpp diff --git a/tools/llvmc2/plugins/Makefile b/tools/llvmc2/plugins/Makefile index 568752e..104e909 100644 --- a/tools/llvmc2/plugins/Makefile +++ b/tools/llvmc2/plugins/Makefile @@ -12,7 +12,7 @@ ifndef LLVMC_PLUGIN LEVEL = ../../.. DIRS = $(BUILTIN_PLUGINS) -# TOFIX: DSO versions of plugins are not built +# TOFIX: How to build DSO versions of plugins? export BUILTIN_LLVMC_PLUGIN=1 @@ -22,25 +22,28 @@ else # LLVMC_PLUGIN LEVEL = ../../../.. -LIBRARYNAME = $(patsubst %,LLVMC%,$(LLVMC_PLUGIN)) -TOOLS_SOURCE = $(wildcard $(PROJ_SRC_DIR)/*.td) +LIBRARYNAME := $(patsubst %,LLVMC%,$(LLVMC_PLUGIN)) REQUIRES_EH = 1 ifndef BUILTIN_LLVMC_PLUGIN LOADABLE_MODULE = 1 endif -ifneq ($(TOOLS_SOURCE),"") -BUILD_AUTOGENERATED_INC=1 +# 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 should go into Makefile.rules +# TOFIX: This probably should go into Makefile.rules ifdef BUILD_AUTOGENERATED_INC -TD_COMMON = $(wildcard $(LLVM_SRC_ROOT)/include/llvm/CompilerDriver/*.td) +TD_COMMON :=$(strip $(wildcard \ + $(LLVM_SRC_ROOT)/include/llvm/CompilerDriver/*.td)) $(ObjDir)/AutoGenerated.inc.tmp: $(TOOLS_SOURCE) $(ObjDir)/.dir \ $(TBLGEN) $(TD_COMMON) diff --git a/tools/llvmc2/plugins/Simple/Makefile b/tools/llvmc2/plugins/Simple/Makefile new file mode 100644 index 0000000..a69df23 --- /dev/null +++ b/tools/llvmc2/plugins/Simple/Makefile @@ -0,0 +1,12 @@ +##===- 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 + +include ../Makefile diff --git a/tools/llvmc2/plugins/Simple/PluginMain.cpp b/tools/llvmc2/plugins/Simple/PluginMain.cpp new file mode 100644 index 0000000..add8acb --- /dev/null +++ b/tools/llvmc2/plugins/Simple/PluginMain.cpp @@ -0,0 +1 @@ +#include "AutoGenerated.inc" diff --git a/tools/llvmc2/plugins/Simple/Simple.td b/tools/llvmc2/plugins/Simple/Simple.td new file mode 100644 index 0000000..2bc4011 --- /dev/null +++ b/tools/llvmc2/plugins/Simple/Simple.td @@ -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>]>; |