summaryrefslogtreecommitdiff
path: root/runtime/Makefile.libs
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-03-08 23:20:52 +0000
committerChris Lattner <sabre@nondot.org>2002-03-08 23:20:52 +0000
commitc1e20acc68aab02bef240fd5f13cef9762900d7a (patch)
tree075e7ac4cb35abb5067807f8a725c0c8b3be1679 /runtime/Makefile.libs
parent665ee88504ae8e4440fd1609f3d88c3481cebe12 (diff)
downloadllvm-c1e20acc68aab02bef240fd5f13cef9762900d7a.tar.gz
llvm-c1e20acc68aab02bef240fd5f13cef9762900d7a.tar.bz2
llvm-c1e20acc68aab02bef240fd5f13cef9762900d7a.tar.xz
Checkin library infrastructure for building stuff to be linked with
gccld git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1842 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'runtime/Makefile.libs')
-rw-r--r--runtime/Makefile.libs36
1 files changed, 36 insertions, 0 deletions
diff --git a/runtime/Makefile.libs b/runtime/Makefile.libs
new file mode 100644
index 0000000000..b5e21c28d8
--- /dev/null
+++ b/runtime/Makefile.libs
@@ -0,0 +1,36 @@
+# test/Libraries/Makefile.libs
+#
+# This makefile should be used by subdirectories, which are libraries that are
+# to be compiled to llvm bytecode and linked together with a specified name.
+#
+# Variables to be defined before including this makefile:
+#
+# 1. LEVEL - Must be set as per normal semantics: The depth from the top of tree
+# 2. LIBNAME - Name of library to link together. Forms lib<LIBNAME>.bc
+#
+
+DESTLIBDIR := $(LEVEL)/test/Libraries/Output
+DESTLIBNAME := $(LEVEL)/test/Libraries/Output/lib$(LIBNAME).bc
+
+all:: $(DESTLIBNAME)
+
+include $(LEVEL)/test/Makefile.tests
+
+# Figure out what object files we want to build...
+LObjs := $(sort $(addsuffix .bc, $(basename $(Source))))
+LObjects := $(addprefix Output/,$(LObjs))
+
+.PRECIOUS: $(LObjects)
+
+# Link the library, then perform postlink optimization...
+$(DESTLIBNAME): $(DESTLIBDIR)/.dir $(LObjects)
+ $(LLINK) -f $(LObjects) | \
+ $(LOPT) -f -cleangcc -raise -constprop -dce -o $@
+
+# Install target for libraries: Copy into the gcc install directory in chris's
+# tree...
+#
+INSTALL_DIR := /home/vadve/lattner/cvs/gcc_install/lib/gcc-lib/llvm/3.1/
+
+install:: $(DESTLIBNAME)
+ cp $(DESTLIBNAME) $(INSTALL_DIR) \ No newline at end of file