[vmkit-commits] [vmkit] r54677 - in /vmkit/trunk: Makefile.common.in Makefile.rules lib/Mvm/LLVMRuntime/ lib/Mvm/Runtime/LLVMRuntime.ll lib/Mvm/Runtime/Makefile

Nicolas Geoffray nicolas.geoffray at lip6.fr
Tue Aug 12 03:10:42 PDT 2008


Author: geoffray
Date: Tue Aug 12 05:10:40 2008
New Revision: 54677

URL: http://llvm.org/viewvc/llvm-project?rev=54677&view=rev
Log:
Provide a rule for generating the LLVM runtime. The .ll file
can now be in the same folder and generation is only done once.


Added:
    vmkit/trunk/Makefile.rules
    vmkit/trunk/lib/Mvm/Runtime/LLVMRuntime.ll
      - copied unchanged from r54639, vmkit/trunk/lib/Mvm/LLVMRuntime/LLVMRuntime.ll
Removed:
    vmkit/trunk/lib/Mvm/LLVMRuntime/
Modified:
    vmkit/trunk/Makefile.common.in
    vmkit/trunk/lib/Mvm/Runtime/Makefile

Modified: vmkit/trunk/Makefile.common.in
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/Makefile.common.in?rev=54677&r1=54676&r2=54677&view=diff

==============================================================================
--- vmkit/trunk/Makefile.common.in (original)
+++ vmkit/trunk/Makefile.common.in Tue Aug 12 05:10:40 2008
@@ -42,3 +42,5 @@
 ifeq ($(GCLIB), BoehmGC)
   LIBS += -lgc
 endif
+
+include $(LEVEL)/Makefile.rules

Added: vmkit/trunk/Makefile.rules
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/Makefile.rules?rev=54677&view=auto

==============================================================================
--- vmkit/trunk/Makefile.rules (added)
+++ vmkit/trunk/Makefile.rules Tue Aug 12 05:10:40 2008
@@ -0,0 +1,24 @@
+ifdef VMKIT_RUNTIME
+
+LLFiles := $(strip $(wildcard $(PROJ_SRC_DIR)/*.ll))
+CPPFiles := $(filter %.cpp,$(BUILT_SOURCES))
+.PRECIOUS: $(CPPFiles)
+
+# All of these files depend on tblgen and the .td files.
+$(CPPFiles) : $(LLVMAS) $(LLC) $(LLFiles)
+
+# CPPFiles rule: All of the tblgen generated files are emitted to 
+# $(ObjDir)/%.inc.tmp, instead of emitting them directly to %.inc.  This allows
+# us to only "touch" the real file if the contents of it change.  IOW, if
+# tblgen is modified, all of the .inc.tmp files are regereated, but no
+# dependencies of the .inc files are, unless the contents of the .inc file
+# changes.
+$(CPPFiles) : %.cpp : %.ll
+	$(Echo) "Building $(<F) LLVM runtime"
+	$(Verb) $(LLVMAS) -f $(<F) -o - | $(LLC) -march=cpp -cppgen=contents -f -o $@
+
+
+clean-local::
+	$(Verb) $(RM) -f $(CPPFiles)
+
+endif

Modified: vmkit/trunk/lib/Mvm/Runtime/Makefile
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/Runtime/Makefile?rev=54677&r1=54676&r2=54677&view=diff

==============================================================================
--- vmkit/trunk/lib/Mvm/Runtime/Makefile (original)
+++ vmkit/trunk/lib/Mvm/Runtime/Makefile Tue Aug 12 05:10:40 2008
@@ -11,6 +11,8 @@
 include $(LEVEL)/Makefile.config
 
 LIBRARYNAME = Mvm
-include $(LEVEL)/Makefile.common
+VMKIT_RUNTIME = Mvm
+
+BUILT_SOURCES = LLVMRuntime.cpp
 
-CXX.Flags += -I../LLVMRuntime
+include $(LEVEL)/Makefile.common





More information about the vmkit-commits mailing list