Add first proof-of-concept universal compiler driver framework based
on ideas mentioned in PR686.
Written by Mikhail Glushenkov and contributed by Codedgers, Inc.

Old llvmc will be removed soon after new one will have all its properties.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48699 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/llvmc2/Makefile b/tools/llvmc2/Makefile
new file mode 100644
index 0000000..d0c1588
--- /dev/null
+++ b/tools/llvmc2/Makefile
@@ -0,0 +1,32 @@
+##===- tools/llvmcc/Makefile -------------------------------*- Makefile -*-===##
+#
+#                     The LLVM Compiler Infrastructure
+#
+# This file is distributed under the University of Illinois Open
+# Source License. See LICENSE.TXT for details.
+#
+##===----------------------------------------------------------------------===##
+LEVEL = ../..
+TOOLNAME = llvmc2
+BUILT_SOURCES = Tools.inc
+LINK_COMPONENTS = support system
+REQUIRES_EH := 1
+
+include $(LEVEL)/Makefile.common
+
+TOOLS_TARGET=default
+ifeq ($(TOOLS_TARGET), default)
+	TOOLS_SOURCE=Example.td
+else
+	TOOLS_SOURCE=ExampleWithOpt.td
+endif
+
+# TOFIX: integrate this part into Makefile.rules?
+# The degree of horrorshowness in that file is too much for me atm.
+$(ObjDir)/Tools.inc.tmp: $(TOOLS_SOURCE) $(ObjDir)/.dir
+	$(Echo) "Building LLVMCC configuration library with tblgen"
+	$(Verb) $(TableGen) -gen-llvmcc -o $@ $<
+
+Tools.inc : $(ObjDir)/Tools.inc.tmp
+	$(Verb) $(CMP) -s $@ $< || $(CP) $< $@
+