From f5b709854f79054c218cb9cb0036a1eeae7deeb3 Mon Sep 17 00:00:00 2001 From: Reid Spencer Date: Thu, 2 Dec 2004 09:29:49 +0000 Subject: [PATCH] For PR466: Much of what this Makefile did to make a libcrtend.a file is now supported by Makefile.rules when BYTECODE_LIBRARY=1 is specified. So, we've simplified the make rules for building this library. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18426 91177308-0d34-0410-b5e6-96231b3b80d8 --- runtime/GCCLibraries/crtend/Makefile | 45 +++++++++------------------- 1 file changed, 14 insertions(+), 31 deletions(-) diff --git a/runtime/GCCLibraries/crtend/Makefile b/runtime/GCCLibraries/crtend/Makefile index 34a69bf391b..0d42fa242d5 100644 --- a/runtime/GCCLibraries/crtend/Makefile +++ b/runtime/GCCLibraries/crtend/Makefile @@ -10,47 +10,30 @@ # This directory contains the C and C++ runtime libraries for the LLVM GCC # front-ends. See the README.txt file for more details. # -# Since this archive has strange requirements, we use almost all custom rules -# for building it. +# Since this archive has strange requirements, we use some custom rules for +# building it. # ##===----------------------------------------------------------------------===## -LEVEL = ../../.. +LEVEL=../../.. DONT_BUILD_RELINKED=1 +BYTECODE_LIBRARY=1 +LIBRARYNAME=crtend + +# Note: We're fooling Makefile.rules here. The sources listed don't exist but +# it doesn't matter. Makefile.rules just uses $(SOURCES) to generate the set of +# object files to put in the library. Since we've specified BYTECODE_LIBRARY +# above, it changes the .c suffix to .bc suffix. Below are rules to build +# each of those bytecode objects from the sources we do have in this directory. +SOURCES=comp_main.c comp_genericeh.c comp_sjljeh.c EXTRA_DIST := comp_main.lst comp_genericeh.lst comp_sjljeh.lst +include $(LEVEL)/Makefile.common + MainSrc := crtend.c listend.ll GenericEHSrc := Exception.cpp SJLJEHSrc := SJLJ-Exception.cpp -Source := $(MainSrc) $(GenericEHSrc) $(SJLJEHSrc) $(CXXEHSrc) - -include $(LEVEL)/Makefile.common - -# CRTEND_A - The result of making 'all' - the final archive file. -CRTEND_A = $(LibDir)/libcrtend.a -all:: $(CRTEND_A) - -# Installation simply requires copying the archive to it's new home. -$(bytecode_libdir)/libcrtend.a: $(CRTEND_A) $(bytecode_libdir) - $(Echo) Installing $(CRTEND_A) - $(Verb) $(INSTALL) $(CRTEND_A) $(bytecode_libdir) - -install:: $(DESTDIR)$(bytecode_libdir)/libcrtend.a -install-bytecode:: $(DESTDIR)$(bytecode_libdir)/libcrtend.a - -clean-local:: - $(Verb)$(RM) -f $(CRTEND_A) - -# The three components described in the README -Components := main genericeh sjljeh -ComponentLibs := $(Components:%=$(ObjDir)/comp_%.bc) - - -# We build libcrtend.a from the four components described in the README. -$(CRTEND_A) : $(ComponentLibs) $(LibDir)/.dir - $(Echo) Building final libcrtend.a file from components - $(Verb) $(LArchive) $@ $(ComponentLibs) MainObj := $(ObjDir)/crtend.bc $(ObjDir)/listend.bc GenericEHObj := $(ObjDir)/Exception.bc