Chris Lattner | c1e20ac | 2002-03-08 23:20:52 +0000 | [diff] [blame] | 1 | # 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 | |
| 12 | DESTLIBDIR := $(LEVEL)/test/Libraries/Output |
| 13 | DESTLIBNAME := $(LEVEL)/test/Libraries/Output/lib$(LIBNAME).bc |
| 14 | |
| 15 | all:: $(DESTLIBNAME) |
| 16 | |
| 17 | include $(LEVEL)/test/Makefile.tests |
| 18 | |
| 19 | # Figure out what object files we want to build... |
| 20 | LObjs := $(sort $(addsuffix .bc, $(basename $(Source)))) |
| 21 | LObjects := $(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 | # |
| 33 | INSTALL_DIR := /home/vadve/lattner/cvs/gcc_install/lib/gcc-lib/llvm/3.1/ |
| 34 | |
| 35 | install:: $(DESTLIBNAME) |
| 36 | cp $(DESTLIBNAME) $(INSTALL_DIR) |