blob: b5e21c28d8439c8319495f58ac8db495816ff0aa [file] [log] [blame]
Chris Lattnerc1e20ac2002-03-08 23:20:52 +00001# test/Libraries/Makefile.libs
2#
3# This makefile should be used by subdirectories, which are libraries that are
4# to be compiled to llvm bytecode and linked together with a specified name.
5#
6# Variables to be defined before including this makefile:
7#
8# 1. LEVEL - Must be set as per normal semantics: The depth from the top of tree
9# 2. LIBNAME - Name of library to link together. Forms lib<LIBNAME>.bc
10#
11
12DESTLIBDIR := $(LEVEL)/test/Libraries/Output
13DESTLIBNAME := $(LEVEL)/test/Libraries/Output/lib$(LIBNAME).bc
14
15all:: $(DESTLIBNAME)
16
17include $(LEVEL)/test/Makefile.tests
18
19# Figure out what object files we want to build...
20LObjs := $(sort $(addsuffix .bc, $(basename $(Source))))
21LObjects := $(addprefix Output/,$(LObjs))
22
23.PRECIOUS: $(LObjects)
24
25# Link the library, then perform postlink optimization...
26$(DESTLIBNAME): $(DESTLIBDIR)/.dir $(LObjects)
27 $(LLINK) -f $(LObjects) | \
28 $(LOPT) -f -cleangcc -raise -constprop -dce -o $@
29
30# Install target for libraries: Copy into the gcc install directory in chris's
31# tree...
32#
33INSTALL_DIR := /home/vadve/lattner/cvs/gcc_install/lib/gcc-lib/llvm/3.1/
34
35install:: $(DESTLIBNAME)
36 cp $(DESTLIBNAME) $(INSTALL_DIR)