[llvm-commits] CVS: llvm/Makefile.rules
Reid Spencer
reid at x10sys.com
Sat Dec 4 21:17:33 PST 2004
Changes in directory llvm:
Makefile.rules updated: 1.250 -> 1.251
---
Log message:
Add ability to make a single bytecode module from others
---
Diffs of the changes: (+43 -0)
Index: llvm/Makefile.rules
diff -u llvm/Makefile.rules:1.250 llvm/Makefile.rules:1.251
--- llvm/Makefile.rules:1.250 Sat Dec 4 16:34:09 2004
+++ llvm/Makefile.rules Sat Dec 4 23:17:22 2004
@@ -465,6 +465,47 @@
# Library Build Rules: Four ways to build a library
###############################################################################
+#---------------------------------------------------------
+# Bytecode Module Targets:
+# If the user set MODULE_NAME then they want to build a
+# bytecode module from the sources. We compile all the
+# sources and link it together into a single bytecode
+# module.
+#---------------------------------------------------------
+
+ifdef MODULE_NAME
+
+Module := $(LibDir)/$(MODULE_NAME).bc
+LinkModule := $(LLVMGCC) -shared -nostdlib
+
+ifdef EXPORTED_SYMBOL_FILE
+LinkMOdule += -Xlinker -internalize-public-api-file=$(EXPORTED_SYMBOL_FILE)
+endif
+
+$(Module): $(BUILT_SOURCES) $(ObjectsBC) $(LibDir)/.dir $(GCCLD)
+ $(Echo) Building $(BuildMOde) Bytecode Module $(notdir $@)
+ $(Verb) $(LinkModule) -o $@ $(ObjectsBC)
+
+all-local:: $(Module)
+
+clean-local::
+ifneq ($(strip $(Module)),)
+ -$(Verb) $(RM) -f $(Module)
+endif
+
+DestModule := $(bytecode_libdir)/$(MODULE_NAME).bc
+
+install-local:: $(DestModule)
+
+$(DestModule): $(bytecode_libdir) $(Module)
+ $(Echo) Installing $(BuildMode) Bytecode Module $(DestModule)
+ $(Verb) $(INSTALL) $(Module) $@
+
+uninstall-local::
+ $(Echo) Uninstalling $(BuildMode) Bytecode Module $(DestModule)
+ -$(Verb) $(RM) -f $(DestModule)
+
+endif
# if we're building a library ...
ifdef LIBRARYNAME
@@ -1299,6 +1340,7 @@
$(Echo) "LibDir : " '$(LibDir)'
$(Echo) "ToolDir : " '$(ToolDir)'
$(Echo) "ExmplDir : " '$(ExmplDir)'
+ $(Echo) "Sources : " '$(Sources)'
$(Echo) "TDFiles : " '$(TDFiles)'
$(Echo) "INCFiles : " '$(INCFiles)'
$(Echo) "Compile.CXX : " '$(Compile.CXX)'
@@ -1306,3 +1348,4 @@
$(Echo) "Archive : " '$(Archive)'
$(Echo) "YaccFiles : " '$(YaccFiles)'
$(Echo) "LexFiles : " '$(LexFiles)'
+ $(Echo) "Module : " '$(Module)'
More information about the llvm-commits
mailing list