1 ##===- runtime/GCCLibraries/crtend/Makefile ----------------*- Makefile -*-===##
3 # The LLVM Compiler Infrastructure
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.
8 ##===----------------------------------------------------------------------===##
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.
13 # Since this archive has strange requirements, we use some custom rules for
16 ##===----------------------------------------------------------------------===##
19 DONT_BUILD_RELINKED = 1
23 # Note: We're using FAKE_SOURCES because the comp_*.c don't really exists.
24 # However this makefile builds comp_*.bc and that's what we want in the library.
25 # The FAKE_SOURCES variable supports this kind of construction. It uses the
26 # FAKE_SOURCES to determine a list of things to build, but doesn't use
27 # FAKE_SOURCES for dependencies, distribution, etc. It is assumed the makefile
28 # will know how to build the objects eventhough the sources don't exist.
30 FAKE_SOURCES := comp_main.c comp_genericeh.c comp_sjljeh.c
32 MainSrc := crtend.c listend.ll
33 GenericEHSrc := Exception.cpp
34 SJLJEHSrc := SJLJ-Exception.cpp
36 EXTRA_DIST := $(MainSrc) $(GenericEHSrc) $(SJLJEHSrc) \
37 comp_main.lst comp_genericeh.lst comp_sjljeh.lst
39 include $(LEVEL)/Makefile.common
41 MainObj := $(ObjDir)/crtend.bc $(ObjDir)/listend.bc
42 GenericEHObj := $(ObjDir)/Exception.bc
43 SJLJEHObj := $(ObjDir)/SJLJ-Exception.bc
45 # __main and ctor/dtor support component
46 $(ObjDir)/comp_main.bc: $(MainObj)
47 $(Echo) Linking $(notdir $@) component...
48 $(Verb) $(GCCLD) -link-as-library \
49 -internalize-public-api-file=$(BUILD_SRC_DIR)/comp_main.lst \
52 # Generic exception handling support runtime.
53 $(ObjDir)/comp_genericeh.bc: $(GenericEHObj)
54 $(Echo) Linking $(notdir $@) component...
55 $(Verb) $(GCCLD) -link-as-library \
56 -internalize-public-api-file=$(BUILD_SRC_DIR)/comp_genericeh.lst \
59 # setjmp/longjmp exception handling support runtime.
60 $(ObjDir)/comp_sjljeh.bc: $(SJLJEHObj)
61 $(Echo) Linking $(notdir $@) component...
62 $(Verb) $(GCCLD) -link-as-library \
63 -internalize-public-api-file=$(BUILD_SRC_DIR)/comp_sjljeh.lst \