From 96bc16f6b27e9183c293c1a77351ec71f71bc32f Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sun, 13 Feb 2022 03:11:01 -0500 Subject: newlib: libc: merge build up a directory Convert all the libc/ subdir makes into the top-level Makefile. This allows us to build all of libc from the top Makefile without using any recursive make calls. This is faster and avoids the funky lib.a logic where we unpack subdir archives to repack into a single libc.a. The machine override logic is maintained though by way of Makefile include ordering, and source file accumulation in libc_a_SOURCES. There's a few dummy.c files that are no longer necessary since we aren't doing the lib.a accumulating, so punt them. The winsup code has been pulling the internal newlib ssp library out, but that doesn't exist anymore, so change that to pull the objects. --- newlib/Makefile.am | 52 ++++++++++++++++++++++++++++++---------------------- 1 file changed, 30 insertions(+), 22 deletions(-) (limited to 'newlib/Makefile.am') diff --git a/newlib/Makefile.am b/newlib/Makefile.am index 81719660c..910894fe4 100644 --- a/newlib/Makefile.am +++ b/newlib/Makefile.am @@ -5,10 +5,12 @@ ACLOCAL_AMFLAGS = -I . -I .. -I ../config # Variables that will accumulate in subdirs. CLEANFILES = +EXTRA_DIST = PHONY = SUFFIXES = info_TEXINFOS = noinst_DATA = +INSTALL_DATA_LOCAL = # The newlib hardware floating-point routines have been disabled due to # inaccuracy. If you wish to work on them, you will need to edit the @@ -24,7 +26,6 @@ endif # values defined in terms of make variables, as is the case for CC and # friends when we are called from the top level Makefile. AM_MAKEFLAGS = \ - "AR_FLAGS=$(AR_FLAGS)" \ "CC_FOR_BUILD=$(CC_FOR_BUILD)" \ "CFLAGS=$(CFLAGS)" \ "CCASFLAGS=$(CCASFLAGS)" \ @@ -60,15 +61,13 @@ AM_MAKEFLAGS = \ FLAGS_TO_PASS=$(AM_MAKEFLAGS) -SUBDIRS = libc . - tooldir = $(exec_prefix)/$(host_alias) toollibdir = $(tooldir)/lib$(MULTISUBDIR) -AM_CPPFLAGS = $(NEWLIB_CFLAGS) $(TARGET_CFLAGS) -AR_FLAGS = rc - -noinst_DATA += stmp-targ-include +# These are useful for standalone object files like crt0.o. +AM_CFLAGS = $(AM_CFLAGS_$(subst /,_,$(@D))) $(AM_CFLAGS_$(subst /,_,$(@D)_$(/dev/null 2>/dev/null || cp libc.a libg.a @@ -177,13 +187,13 @@ crt0.o: $(CRT0_DIR)$(CRT0) $(AM_V_at)rm -f $@ $(AM_V_GEN)ln $< $@ >/dev/null 2>/dev/null || cp $< $@ -$(CRT0_DIR)$(CRT0): ; @true +$(CRT0_DIR)$(CRT0): stmp-targ-include crt1.o: $(CRT1_DIR)$(CRT1) $(AM_V_at)rm -f $@ $(AM_V_GEN)ln $< $@ >/dev/null 2>/dev/null || cp $< $@ -$(CRT1_DIR)$(CRT1): ; @true +$(CRT1_DIR)$(CRT1): stmp-targ-include targ-include: $(AM_V_GEN)$(MKDIR_P) $@ @@ -199,8 +209,6 @@ targ-include/newlib.h: newlib.h targ-include targ-include/_newlib_version.h: _newlib_version.h targ-include $(AM_V_GEN)cp _newlib_version.h $@ -all-recursive: stmp-targ-include - # The targ-include directory just holds the includes files for the # particular system and machine we have been configured for. It is # used while building. @@ -241,7 +249,7 @@ CLEANFILES += stmp-targ-include ## We hook install-multi because this Makefile doesn't have any exec targets, ## only data targets. If that ever changes, this should be removed and the ## install-exec-local in ../multilib.am will kick in. -install-data-local: install-toollibLIBRARIES install-multi +install-data-local: install-toollibLIBRARIES install-multi $(INSTALL_DATA_LOCAL) rm -f $(DESTDIR)$(toollibdir)/libg.a ln $(DESTDIR)$(toollibdir)/libc.a $(DESTDIR)$(toollibdir)/libg.a >/dev/null 2>/dev/null || cp $(DESTDIR)$(toollibdir)/libc.a $(DESTDIR)$(toollibdir)/libg.a -if [ -z "$(MULTISUBDIR)" ]; then \ -- cgit v1.2.3