From 8f04dc7f67da990a10d8855fd2523d4d965393c8 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 15 Aug 2003 02:20:32 +0000 Subject: [PATCH] Convert libraries into the BYTECODE_LIBRARY style llvm-svn: 7858 --- runtime/GCCLibraries/crtend/Makefile | 16 ++++++--- runtime/GCCLibraries/libc/Makefile | 7 ++-- runtime/GCCLibraries/libgcc/Makefile | 8 ++--- runtime/GCCLibraries/libm/Makefile | 7 ++-- runtime/GCCLibraries/libmalloc/Makefile | 8 ++--- runtime/GCCLibraries/libucb/Makefile | 8 ++--- runtime/Makefile | 2 +- runtime/Makefile.libs | 47 ------------------------- runtime/libdummy/Makefile | 6 ++-- runtime/libtrace/Makefile | 24 +++---------- 10 files changed, 40 insertions(+), 93 deletions(-) delete mode 100644 runtime/Makefile.libs diff --git a/runtime/GCCLibraries/crtend/Makefile b/runtime/GCCLibraries/crtend/Makefile index 7fa16aab863..9bfb9d1ed85 100644 --- a/runtime/GCCLibraries/crtend/Makefile +++ b/runtime/GCCLibraries/crtend/Makefile @@ -1,11 +1,17 @@ LEVEL = ../../.. -LIBNAME = crtend +BYTECODE_LIBRARY=1 +DONT_BUILD_RELINKED=1 +LIBRARYNAME=crtend + Source = crtend.c listend.ll EXPORTED_SYMBOL_LIST = __main,llvm.global_ctors,llvm.global_dtors -include ../Makefile.libs +include $(LEVEL)/Makefile.common -install:: $(DESTLIBNAME) - cp $(DESTLIBNAME) $(INSTALL_DIR)/crtend.o - rm $(INSTALL_DIR)/libcrtend.bc + +$(LLVMGCCDIR)/bytecode-libs/crtend.o: $(LIBNAME_BC) + @cp $< $@ + +install:: $(LLVMGCCDIR)/bytecode-libs/crtend.o + @rm $(LLVMGCCDIR)/bytecode-libs/libcrtend.bc \ No newline at end of file diff --git a/runtime/GCCLibraries/libc/Makefile b/runtime/GCCLibraries/libc/Makefile index dbe590bc395..286f2e91a75 100644 --- a/runtime/GCCLibraries/libc/Makefile +++ b/runtime/GCCLibraries/libc/Makefile @@ -1,6 +1,7 @@ LEVEL = ../../.. +BYTECODE_LIBRARY=1 +DONT_BUILD_RELINKED=1 +LIBRARYNAME=c -LIBNAME = c - -include ../Makefile.libs +include $(LEVEL)/Makefile.common diff --git a/runtime/GCCLibraries/libgcc/Makefile b/runtime/GCCLibraries/libgcc/Makefile index fd565288eb5..fc97d44d14d 100644 --- a/runtime/GCCLibraries/libgcc/Makefile +++ b/runtime/GCCLibraries/libgcc/Makefile @@ -1,6 +1,6 @@ LEVEL = ../../.. +BYTECODE_LIBRARY=1 +DONT_BUILD_RELINKED=1 +LIBRARYNAME=gcc -LIBNAME = gcc - -include ../Makefile.libs - +include $(LEVEL)/Makefile.common diff --git a/runtime/GCCLibraries/libm/Makefile b/runtime/GCCLibraries/libm/Makefile index f3085ded5de..5b95c6f4352 100644 --- a/runtime/GCCLibraries/libm/Makefile +++ b/runtime/GCCLibraries/libm/Makefile @@ -1,6 +1,7 @@ LEVEL = ../../.. +BYTECODE_LIBRARY=1 +DONT_BUILD_RELINKED=1 +LIBRARYNAME=m -LIBNAME = m - -include ../Makefile.libs +include $(LEVEL)/Makefile.common diff --git a/runtime/GCCLibraries/libmalloc/Makefile b/runtime/GCCLibraries/libmalloc/Makefile index 9d56de0eae0..ab66132f050 100644 --- a/runtime/GCCLibraries/libmalloc/Makefile +++ b/runtime/GCCLibraries/libmalloc/Makefile @@ -1,6 +1,6 @@ LEVEL = ../../.. +BYTECODE_LIBRARY=1 +DONT_BUILD_RELINKED=1 +LIBRARYNAME=malloc -LIBNAME = malloc - -include ../Makefile.libs - +include $(LEVEL)/Makefile.common diff --git a/runtime/GCCLibraries/libucb/Makefile b/runtime/GCCLibraries/libucb/Makefile index 247caeaf06d..0eb0e9b30d3 100644 --- a/runtime/GCCLibraries/libucb/Makefile +++ b/runtime/GCCLibraries/libucb/Makefile @@ -1,6 +1,6 @@ LEVEL = ../../.. +BYTECODE_LIBRARY=1 +DONT_BUILD_RELINKED=1 +LIBRARYNAME=ucb -LIBNAME = ucb - -include ../Makefile.libs - +include $(LEVEL)/Makefile.common diff --git a/runtime/Makefile b/runtime/Makefile index 2fad2286f87..6f05ed2d5f5 100644 --- a/runtime/Makefile +++ b/runtime/Makefile @@ -1,7 +1,7 @@ # Libraries Makefile: Build all subdirectories automatically LEVEL = ../.. -DIRS := $(sort $(filter-out Output/, $(filter-out CVS/, $(wildcard */)))) +PARALLEL_DIRS := $(sort $(filter-out Output/, $(filter-out CVS/, $(wildcard */)))) include ${LEVEL}/Makefile.common diff --git a/runtime/Makefile.libs b/runtime/Makefile.libs deleted file mode 100644 index 52766e16bfc..00000000000 --- a/runtime/Makefile.libs +++ /dev/null @@ -1,47 +0,0 @@ -# test/Libraries/Makefile.libs -# -# This makefile should be used by subdirectories, which are libraries that are -# to be compiled to llvm bytecode and linked together with a specified name. -# -# Variables to be defined before including this makefile: -# -# 1. LEVEL - Must be set as per normal semantics: The depth from the top of tree -# 2. LIBNAME - Name of library to link together. Forms lib.bc -# 3. EXPORTED_SYMBOL_LIST - If this symbol is defined, it contains a comma -# separated list of symbols that are exported by the library. All other -# symbols are marked internal, reducing namespace pollution. -# - -DESTLIBDIR := $(LEVEL)/test/Libraries/Output -DESTLIBNAME := $(LEVEL)/test/Libraries/Output/lib$(LIBNAME).bc - -all:: $(DESTLIBNAME) - -include $(LEVEL)/test/Makefile.tests - -# Figure out what object files we want to build... -LObjs := $(sort $(addsuffix .bc, $(basename $(Source)))) -LObjects := $(addprefix Output/,$(LObjs)) - -.PRECIOUS: $(LObjects) - -# If the library specified a list of symbols to export, add an internalize pass -# to the link options. -ifdef EXPORTED_SYMBOL_LIST -LLINK_OPTS += -internalize -internalize-public-api-list=$(EXPORTED_SYMBOL_LIST) -endif - -# Standard set of postlink optimizations... -LLINK_OPTS += -inline -globaldce -funcresolve -deadtypeelim -instcombine -simplifycfg - -# Link the library, then perform postlink optimization... -$(DESTLIBNAME): $(DESTLIBDIR)/.dir $(LObjects) $(LLINK) $(LOPT) - $(LLINK) -f $(LObjects) $(LDFLAGS) | \ - $(LOPT) -f -q $(LLINK_OPTS) -o $@ - -# Install target for libraries: Copy into the gcc install directory. -# -INSTALL_DIR := $(LLVMGCCDIR)/bytecode-libs/ - -install:: $(DESTLIBNAME) - cp $(DESTLIBNAME) $(INSTALL_DIR) diff --git a/runtime/libdummy/Makefile b/runtime/libdummy/Makefile index 2b4af8516ec..1f7d590e259 100644 --- a/runtime/libdummy/Makefile +++ b/runtime/libdummy/Makefile @@ -1,4 +1,6 @@ LEVEL = ../../.. -LIBNAME = dummy -include ../Makefile.libs +BYTECODE_LIBRARY=1 +DONT_BUILD_RELINKED=1 +LIBRARYNAME=dummy +include $(LEVEL)/Makefile.common diff --git a/runtime/libtrace/Makefile b/runtime/libtrace/Makefile index b74e037dcff..199dd749ee8 100644 --- a/runtime/libtrace/Makefile +++ b/runtime/libtrace/Makefile @@ -1,23 +1,7 @@ LEVEL = ../../.. +BYTECODE_LIBRARY=1 +#DONT_BUILD_RELINKED=1 +LIBRARYNAME=gcc -LIBNAME = instr +include $(LEVEL)/Makefile.common -include ../Makefile.libs - -## We need the native libraries for libinstr because they are directly -## linked into the native CBE or LLC code. That is the only practical -## way to debug them! - -LIBINSTR = ../Output/libinstr.$(ARCH).a -all:: $(LIBINSTR) - -tracelib: tracelib.c - g++ -g -DTEST_INSTRLIB $< -o $@ - -Debug/tracelib.o: tracelib.c Debug/.dir - $(CompileC) -g $< -o $@ - -$(LIBINSTR): Debug/tracelib.o ../Output/.dir - ar r $@ $< - -tracelib.c: tracelib.h