]> sourceware.org Git - newlib-cygwin.git/commit
newlib: libm: merge build up a directory
authorMike Frysinger <vapier@gentoo.org>
Thu, 10 Feb 2022 05:50:36 +0000 (00:50 -0500)
committerMike Frysinger <vapier@gentoo.org>
Fri, 18 Feb 2022 01:56:32 +0000 (20:56 -0500)
commitac9f8c46b1bc37df1a4209d9bff6e911f7d6b281
tree3fc189353f8f577e2825e86d7c7893c3ed690ec2
parentf2b053f49ed2bd7b4da8cf4ed3a608dc2f425c2b
newlib: libm: merge build up a directory

Convert all the libm/ subdir makes into the top-level Makefile.  This
allows us to build all of libm 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 libm.a.  The
machine override logic is maintained though by way of Makefile include
ordering, and source file accumulation in libm_a_SOURCES.

One thing to note is that this will require GNU Make because of:
libm_a_CFLAGS = ... $(libm_a_CFLAGS_$(subst /,_,$(@D)))
This was the only way I could find to supporting per-dir compiler
settings, and I couldn't find a POSIX compatible way of transforming
the variable content.  I don't think this is a big deal as other
Makefiles in the tree are using GNU Make-specific syntax, but I call
this out as it's the only one so far in the new automake code that
I've been writing.

Automake doesn't provide precise control over the output object names
(by design).  This is fine by default as we get consistent names in all
the subdirs: libm_a-<source>.o.  But this relies on using the same set
of compiler flags for all objects.  We currently compile libm/common/
with different optimizations than the rest.

If we want to compile objects differently, we can create an intermediate
archive with the subset of objects with unique flags, and then add those
objects to the main archive.  But Automake will use a different prefix
for the objects, and thus we can't rely on ordering to override.

But if we leverage $@, we can turn Automake's CFLAGS into a multiplex
on a per-dir (and even per-file if we wanted) basis.  Unfortunately,
since $@ contains /, Automake complains it's an invalid name.  While
GNU Make supports this, it's a POSIX extension, so Automake flags it.
Using $(subst) avoids the Automake warning to get a POSIX compliant
name, albeit with a GNU Make extension.
55 files changed:
newlib/Makefile.am
newlib/Makefile.in
newlib/configure
newlib/libm/Makefile.am [deleted file]
newlib/libm/Makefile.in [deleted file]
newlib/libm/Makefile.inc
newlib/libm/acinclude.m4
newlib/libm/common/Makefile.am [deleted file]
newlib/libm/common/Makefile.in [deleted file]
newlib/libm/common/Makefile.inc
newlib/libm/complex/Makefile.am [deleted file]
newlib/libm/complex/Makefile.in [deleted file]
newlib/libm/complex/Makefile.inc
newlib/libm/fenv/Makefile.am [deleted file]
newlib/libm/fenv/Makefile.in [deleted file]
newlib/libm/fenv/Makefile.inc
newlib/libm/machine/aarch64/Makefile.am [deleted file]
newlib/libm/machine/aarch64/Makefile.in [deleted file]
newlib/libm/machine/aarch64/Makefile.inc [new file with mode: 0644]
newlib/libm/machine/arm/Makefile.am [deleted file]
newlib/libm/machine/arm/Makefile.in [deleted file]
newlib/libm/machine/arm/Makefile.inc [new file with mode: 0644]
newlib/libm/machine/i386/Makefile.am [deleted file]
newlib/libm/machine/i386/Makefile.in [deleted file]
newlib/libm/machine/i386/Makefile.inc [new file with mode: 0644]
newlib/libm/machine/mips/Makefile.am [deleted file]
newlib/libm/machine/mips/Makefile.in [deleted file]
newlib/libm/machine/mips/Makefile.inc [new file with mode: 0644]
newlib/libm/machine/nds32/Makefile.am [deleted file]
newlib/libm/machine/nds32/Makefile.in [deleted file]
newlib/libm/machine/nds32/Makefile.inc [new file with mode: 0644]
newlib/libm/machine/powerpc/Makefile.am [deleted file]
newlib/libm/machine/powerpc/Makefile.in [deleted file]
newlib/libm/machine/powerpc/Makefile.inc [new file with mode: 0644]
newlib/libm/machine/pru/Makefile.am [deleted file]
newlib/libm/machine/pru/Makefile.in [deleted file]
newlib/libm/machine/pru/Makefile.inc [new file with mode: 0644]
newlib/libm/machine/riscv/Makefile.am [deleted file]
newlib/libm/machine/riscv/Makefile.in [deleted file]
newlib/libm/machine/riscv/Makefile.inc [new file with mode: 0644]
newlib/libm/machine/sparc/Makefile.am [deleted file]
newlib/libm/machine/sparc/Makefile.in [deleted file]
newlib/libm/machine/sparc/Makefile.inc [new file with mode: 0644]
newlib/libm/machine/spu/Makefile.am [deleted file]
newlib/libm/machine/spu/Makefile.in [deleted file]
newlib/libm/machine/spu/Makefile.inc [new file with mode: 0644]
newlib/libm/machine/x86_64/Makefile.am [deleted file]
newlib/libm/machine/x86_64/Makefile.in [deleted file]
newlib/libm/machine/x86_64/Makefile.inc [new file with mode: 0644]
newlib/libm/math/Makefile.am [deleted file]
newlib/libm/math/Makefile.in [deleted file]
newlib/libm/math/Makefile.inc
newlib/libm/mathfp/Makefile.am [deleted file]
newlib/libm/mathfp/Makefile.in [deleted file]
newlib/libm/mathfp/Makefile.inc
This page took 0.040826 seconds and 5 git commands to generate.