2022-01-21 15:12:26 +08:00
|
|
|
info_TEXINFOS += %D%/libm.texi
|
|
|
|
%C%_libm_TEXINFOS = %D%/targetdep.tex $(LIBM_CHEWOUT_FILES)
|
|
|
|
|
|
|
|
LIBM_CHEWOUT_FILES =
|
|
|
|
|
|
|
|
LIBM_CHAPTERS =
|
2022-01-22 11:50:42 +08:00
|
|
|
LIBM_DOCBOOK_OUT_FILES = $(LIBM_CHEWOUT_FILES:.def=.xml)
|
2022-02-10 12:26:19 +08:00
|
|
|
$(LIBM_CHEWOUT_FILES): $(MKDOC)
|
2022-01-21 15:12:26 +08:00
|
|
|
|
|
|
|
%D%/libm.dvi: %D%/targetdep.tex $(LIBM_CHEWOUT_FILES)
|
|
|
|
|
|
|
|
%D%/targetdep.tex.stamp: $(LIBM_CHAPTERS)
|
|
|
|
$(AM_V_GEN)cat $^ > $@.tmp
|
|
|
|
$(AM_V_at)$(SHELL) $(newlib_basedir)/../move-if-change $@.tmp $(@:.stamp=)
|
|
|
|
$(AM_V_at)touch $@
|
|
|
|
%D%/targetdep.tex: %D%/targetdep.tex.stamp; @true
|
|
|
|
|
2022-05-02 20:55:13 +08:00
|
|
|
%D%/libm.xml: %D%/libm.in.xml $(LIBM_CHAPTERS) $(LIBM_DOCBOOK_OUT_FILES)
|
2022-01-22 11:50:42 +08:00
|
|
|
$(AM_V_at)\
|
|
|
|
for chapter in $(LIBM_CHAPTERS); do \
|
|
|
|
$(TEXI2DOCBOOK) < $(srcdir)/$$chapter > %D%/`basename $${chapter%.tex}`.xml || exit 1; \
|
|
|
|
done
|
|
|
|
$(AM_V_GEN)xsltproc --xinclude --path $(builddir)/%D% --nonet $(srcdir)/refcontainers.xslt $< > $@.tmp
|
2022-05-02 20:55:13 +08:00
|
|
|
$(AM_V_at)$(SHELL) $(newlib_basedir)/../move-if-change $@.tmp $@
|
2022-01-22 11:50:42 +08:00
|
|
|
|
2022-05-02 20:55:14 +08:00
|
|
|
%C%_man.stamp: %D%/libm.xml
|
2022-05-02 20:55:15 +08:00
|
|
|
$(AM_V_GEN)xmlto --skip-validation -o %D% --searchpath $(builddir)/%D% man -m $(srcdir)/man.xsl $(XMLTO_MAN_QUIET) %D%/libm.xml
|
2022-05-02 20:55:14 +08:00
|
|
|
$(AM_V_at)touch $@
|
|
|
|
man: %C%_man.stamp
|
2022-01-22 11:50:42 +08:00
|
|
|
|
2022-05-02 20:55:14 +08:00
|
|
|
%C%_install-man: %C%_man.stamp
|
2022-01-22 11:50:42 +08:00
|
|
|
$(MKDIR_P) $(DESTDIR)$(mandir)/man3
|
|
|
|
$(INSTALL_DATA) %D%/*.3 $(DESTDIR)$(mandir)/man3/
|
|
|
|
install-man: %C%_install-man
|
|
|
|
|
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.
2022-02-10 13:50:36 +08:00
|
|
|
## The order of includes is important for two reasons:
|
|
|
|
## * The integrated documentation (chapter ordering).
|
|
|
|
## * Object overridding -- machine dir must come last.
|
|
|
|
## Do not change the order without considering the doc impact.
|
|
|
|
|
2022-01-21 15:12:26 +08:00
|
|
|
if NEWLIB_HW_FP
|
|
|
|
include %D%/mathfp/Makefile.inc
|
|
|
|
else
|
|
|
|
include %D%/math/Makefile.inc
|
|
|
|
endif
|
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.
2022-02-10 13:50:36 +08:00
|
|
|
include %D%/common/Makefile.inc
|
2023-05-06 02:39:17 +08:00
|
|
|
|
|
|
|
if HAVE_FPMATH_H
|
|
|
|
include %D%/ld/Makefile.inc
|
|
|
|
endif # HAVE_FPMATH_H
|
|
|
|
|
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.
2022-02-10 13:50:36 +08:00
|
|
|
include %D%/complex/Makefile.inc
|
|
|
|
include %D%/fenv/Makefile.inc
|
2022-03-14 10:28:25 +08:00
|
|
|
include %D%/test/Makefile.inc
|
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.
2022-02-10 13:50:36 +08:00
|
|
|
|
|
|
|
if HAVE_LIBM_MACHINE_AARCH64
|
|
|
|
include %D%/machine/aarch64/Makefile.inc
|
2023-05-06 02:39:17 +08:00
|
|
|
include %D%/ld128/Makefile.inc
|
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.
2022-02-10 13:50:36 +08:00
|
|
|
endif
|
2022-12-03 04:00:11 +08:00
|
|
|
if HAVE_LIBM_MACHINE_AMDGCN
|
|
|
|
include %D%/machine/amdgcn/Makefile.inc
|
|
|
|
endif
|
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.
2022-02-10 13:50:36 +08:00
|
|
|
if HAVE_LIBM_MACHINE_ARM
|
|
|
|
include %D%/machine/arm/Makefile.inc
|
|
|
|
endif
|
|
|
|
if HAVE_LIBM_MACHINE_I386
|
|
|
|
include %D%/machine/i386/Makefile.inc
|
2023-05-06 02:39:17 +08:00
|
|
|
include %D%/ld80/Makefile.inc
|
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.
2022-02-10 13:50:36 +08:00
|
|
|
endif
|
|
|
|
if HAVE_LIBM_MACHINE_MIPS
|
|
|
|
include %D%/machine/mips/Makefile.inc
|
|
|
|
endif
|
|
|
|
if HAVE_LIBM_MACHINE_NDS32
|
|
|
|
include %D%/machine/nds32/Makefile.inc
|
|
|
|
endif
|
|
|
|
if HAVE_LIBM_MACHINE_POWERPC
|
|
|
|
include %D%/machine/powerpc/Makefile.inc
|
|
|
|
endif
|
|
|
|
if HAVE_LIBM_MACHINE_PRU
|
|
|
|
include %D%/machine/pru/Makefile.inc
|
|
|
|
endif
|
|
|
|
if HAVE_LIBM_MACHINE_SPARC
|
|
|
|
include %D%/machine/sparc/Makefile.inc
|
|
|
|
endif
|
|
|
|
if HAVE_LIBM_MACHINE_SPU
|
|
|
|
include %D%/machine/spu/Makefile.inc
|
|
|
|
endif
|
|
|
|
if HAVE_LIBM_MACHINE_RISCV
|
|
|
|
include %D%/machine/riscv/Makefile.inc
|
|
|
|
endif
|
|
|
|
if HAVE_LIBM_MACHINE_X86_64
|
|
|
|
include %D%/machine/x86_64/Makefile.inc
|
2023-05-06 02:39:17 +08:00
|
|
|
include %D%/ld80/Makefile.inc
|
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.
2022-02-10 13:50:36 +08:00
|
|
|
endif
|
2022-01-21 15:12:26 +08:00
|
|
|
|
|
|
|
CLEANFILES += \
|
|
|
|
%D%/targetdep.tex \
|
|
|
|
%D%/targetdep.tex.stamp \
|
2022-01-22 11:50:42 +08:00
|
|
|
$(LIBM_CHEWOUT_FILES) \
|
|
|
|
$(LIBM_DOCBOOK_OUT_FILES) \
|
2022-05-02 20:55:14 +08:00
|
|
|
%D%/*.xml %C%_man.stamp %D%/*.3
|