1 # test/Libraries/Makefile.libs
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.
6 # Variables to be defined before including this makefile:
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
12 DESTLIBDIR := $(LEVEL)/test/Libraries/Output
13 DESTLIBNAME := $(LEVEL)/test/Libraries/Output/lib$(LIBNAME).bc
17 include $(LEVEL)/test/Makefile.tests
19 # Figure out what object files we want to build...
20 LObjs := $(sort $(addsuffix .bc, $(basename $(Source))))
21 LObjects := $(addprefix Output/,$(LObjs))
23 .PRECIOUS: $(LObjects)
25 # Link the library, then perform postlink optimization...
26 $(DESTLIBNAME): $(DESTLIBDIR)/.dir $(LObjects)
27 $(LLINK) -f $(LObjects) $(LDFLAGS) | \
28 $(LOPT) -f -deadtypeelim -raise -constprop -dce -o $@
30 # Install target for libraries: Copy into the gcc install directory in chris's
33 INSTALL_DIR := /home/vadve/lattner/cvs/gcc_install_x86/llvm/lib/
35 install:: $(DESTLIBNAME)
36 cp $(DESTLIBNAME) $(INSTALL_DIR)