summaryrefslogtreecommitdiff
path: root/runtime/Makefile.libs
blob: 66d6a7563ce2684747b8fb793f82be3e9cc20275 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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) $(LDFLAGS) | \
	   $(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)