llvm.org GIT mirror llvm / da86e6c
Convert libraries into the BYTECODE_LIBRARY style git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7858 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 17 years ago
10 changed file(s) with 40 addition(s) and 93 deletion(s). Raw diff Collapse all Expand all
0 LEVEL = ../../..
1 LIBNAME = crtend
1 BYTECODE_LIBRARY=1
2 DONT_BUILD_RELINKED=1
3 LIBRARYNAME=crtend
4
25 Source = crtend.c listend.ll
36
47 EXPORTED_SYMBOL_LIST = __main,llvm.global_ctors,llvm.global_dtors
58
6 include ../Makefile.libs
9 include $(LEVEL)/Makefile.common
710
8 install:: $(DESTLIBNAME)
9 cp $(DESTLIBNAME) $(INSTALL_DIR)/crtend.o
10 rm $(INSTALL_DIR)/libcrtend.bc
11
12 $(LLVMGCCDIR)/bytecode-libs/crtend.o: $(LIBNAME_BC)
13 @cp $< $@
14
15 install:: $(LLVMGCCDIR)/bytecode-libs/crtend.o
16 @rm $(LLVMGCCDIR)/bytecode-libs/libcrtend.bc
0 LEVEL = ../../..
1 BYTECODE_LIBRARY=1
2 DONT_BUILD_RELINKED=1
3 LIBRARYNAME=c
14
2 LIBNAME = c
5 include $(LEVEL)/Makefile.common
36
4 include ../Makefile.libs
5
0 LEVEL = ../../..
1 BYTECODE_LIBRARY=1
2 DONT_BUILD_RELINKED=1
3 LIBRARYNAME=gcc
14
2 LIBNAME = gcc
3
4 include ../Makefile.libs
5
5 include $(LEVEL)/Makefile.common
0 LEVEL = ../../..
1 BYTECODE_LIBRARY=1
2 DONT_BUILD_RELINKED=1
3 LIBRARYNAME=m
14
2 LIBNAME = m
5 include $(LEVEL)/Makefile.common
36
4 include ../Makefile.libs
5
0 LEVEL = ../../..
1 BYTECODE_LIBRARY=1
2 DONT_BUILD_RELINKED=1
3 LIBRARYNAME=malloc
14
2 LIBNAME = malloc
3
4 include ../Makefile.libs
5
5 include $(LEVEL)/Makefile.common
0 LEVEL = ../../..
1 BYTECODE_LIBRARY=1
2 DONT_BUILD_RELINKED=1
3 LIBRARYNAME=ucb
14
2 LIBNAME = ucb
3
4 include ../Makefile.libs
5
5 include $(LEVEL)/Makefile.common
0 # Libraries Makefile: Build all subdirectories automatically
11
22 LEVEL = ../..
3 DIRS := $(sort $(filter-out Output/, $(filter-out CVS/, $(wildcard */))))
3 PARALLEL_DIRS := $(sort $(filter-out Output/, $(filter-out CVS/, $(wildcard */))))
44
55 include ${LEVEL}/Makefile.common
66
+0
-47
runtime/Makefile.libs less more
None # test/Libraries/Makefile.libs
1 #
2 # This makefile should be used by subdirectories, which are libraries that are
3 # to be compiled to llvm bytecode and linked together with a specified name.
4 #
5 # Variables to be defined before including this makefile:
6 #
7 # 1. LEVEL - Must be set as per normal semantics: The depth from the top of tree
8 # 2. LIBNAME - Name of library to link together. Forms lib.bc
9 # 3. EXPORTED_SYMBOL_LIST - If this symbol is defined, it contains a comma
10 # separated list of symbols that are exported by the library. All other
11 # symbols are marked internal, reducing namespace pollution.
12 #
13
14 DESTLIBDIR := $(LEVEL)/test/Libraries/Output
15 DESTLIBNAME := $(LEVEL)/test/Libraries/Output/lib$(LIBNAME).bc
16
17 all:: $(DESTLIBNAME)
18
19 include $(LEVEL)/test/Makefile.tests
20
21 # Figure out what object files we want to build...
22 LObjs := $(sort $(addsuffix .bc, $(basename $(Source))))
23 LObjects := $(addprefix Output/,$(LObjs))
24
25 .PRECIOUS: $(LObjects)
26
27 # If the library specified a list of symbols to export, add an internalize pass
28 # to the link options.
29 ifdef EXPORTED_SYMBOL_LIST
30 LLINK_OPTS += -internalize -internalize-public-api-list=$(EXPORTED_SYMBOL_LIST)
31 endif
32
33 # Standard set of postlink optimizations...
34 LLINK_OPTS += -inline -globaldce -funcresolve -deadtypeelim -instcombine -simplifycfg
35
36 # Link the library, then perform postlink optimization...
37 $(DESTLIBNAME): $(DESTLIBDIR)/.dir $(LObjects) $(LLINK) $(LOPT)
38 $(LLINK) -f $(LObjects) $(LDFLAGS) | \
39 $(LOPT) -f -q $(LLINK_OPTS) -o $@
40
41 # Install target for libraries: Copy into the gcc install directory.
42 #
43 INSTALL_DIR := $(LLVMGCCDIR)/bytecode-libs/
44
45 install:: $(DESTLIBNAME)
46 cp $(DESTLIBNAME) $(INSTALL_DIR)
0 LEVEL = ../../..
1 LIBNAME = dummy
2 include ../Makefile.libs
1 BYTECODE_LIBRARY=1
2 DONT_BUILD_RELINKED=1
3 LIBRARYNAME=dummy
34
5 include $(LEVEL)/Makefile.common
0 LEVEL = ../../..
1 BYTECODE_LIBRARY=1
2 #DONT_BUILD_RELINKED=1
3 LIBRARYNAME=gcc
14
2 LIBNAME = instr
5 include $(LEVEL)/Makefile.common
36
4 include ../Makefile.libs
5
6 ## We need the native libraries for libinstr because they are directly
7 ## linked into the native CBE or LLC code. That is the only practical
8 ## way to debug them!
9
10 LIBINSTR = ../Output/libinstr.$(ARCH).a
11 all:: $(LIBINSTR)
12
13 tracelib: tracelib.c
14 g++ -g -DTEST_INSTRLIB $< -o $@
15
16 Debug/tracelib.o: tracelib.c Debug/.dir
17 $(CompileC) -g $< -o $@
18
19 $(LIBINSTR): Debug/tracelib.o ../Output/.dir
20 ar r $@ $<
21
22 tracelib.c: tracelib.h