4c71d50a9ee5902f58bcdb5600aa89577fc4761c
[oota-llvm.git] / runtime / GCCLibraries / crtend / Makefile
1 ##===- runtime/GCCLibraries/crtend/Makefile ----------------*- Makefile -*-===##
2
3 #                     The LLVM Compiler Infrastructure
4 #
5 # This file was developed by the LLVM research group and is distributed under
6 # the University of Illinois Open Source License. See LICENSE.TXT for details.
7
8 ##===----------------------------------------------------------------------===##
9 #
10 # This directory contains the C and C++ runtime libraries for the LLVM GCC
11 # front-ends.  See the README.txt file for more details.
12 #
13 # Since this archive has strange requirements, we use some custom rules for 
14 # building it.
15 #
16 ##===----------------------------------------------------------------------===##
17
18 LEVEL = ../../..
19 DONT_BUILD_RELINKED = 1
20 BYTECODE_LIBRARY = 1
21 LIBRARYNAME = crtend
22
23 # Note: We're fooling Makefile.rules here. The sources listed don't exist but
24 # it doesn't matter. Makefile.rules just uses $(SOURCES) to generate the set of
25 # object files to put in the library. Since we've specified BYTECODE_LIBRARY
26 # above, it changes the .c suffix to .bc suffix. Below are rules to build 
27 # each of those bytecode objects from the sources we do have in this directory.
28 SOURCES = comp_main.c comp_genericeh.c comp_sjljeh.c
29
30 EXTRA_DIST   := comp_main.lst comp_genericeh.lst comp_sjljeh.lst
31
32 include $(LEVEL)/Makefile.common
33
34 MainSrc      := crtend.c listend.ll
35 GenericEHSrc := Exception.cpp
36 SJLJEHSrc    := SJLJ-Exception.cpp
37
38 MainObj      := $(ObjDir)/crtend.bc $(ObjDir)/listend.bc
39 GenericEHObj := $(ObjDir)/Exception.bc
40 SJLJEHObj    := $(ObjDir)/SJLJ-Exception.bc
41
42 # __main and ctor/dtor support component
43 $(ObjDir)/comp_main.bc: $(MainObj)
44         $(Echo) Linking $(notdir $@) component...
45         $(Verb) $(GCCLD) -link-as-library \
46         -internalize-public-api-file=$(BUILD_SRC_DIR)/comp_main.lst \
47         $(MainObj) -o $@ \
48
49 # Generic exception handling support runtime.
50 $(ObjDir)/comp_genericeh.bc: $(GenericEHObj)
51         $(Echo) Linking $(notdir $@) component...
52         $(Verb) $(GCCLD) -link-as-library \
53         -internalize-public-api-file=$(BUILD_SRC_DIR)/comp_genericeh.lst \
54         $(GenericEHObj) -o $@
55
56 # setjmp/longjmp exception handling support runtime.
57 $(ObjDir)/comp_sjljeh.bc: $(SJLJEHObj)
58         $(Echo) Linking $(notdir $@) component...
59         $(Verb) $(GCCLD) -link-as-library \
60         -internalize-public-api-file=$(BUILD_SRC_DIR)/comp_sjljeh.lst \
61         $(SJLJEHObj) -o $@