public inbox for newlib-cvs@sourceware.org
help / color / mirror / Atom feed
From: Michael Frysinger <vapier@sourceware.org>
To: newlib-cvs@sourceware.org
Subject: [newlib-cygwin] newlib: powerpc: simplify reallocr & callocr build logic
Date: Thu, 17 Feb 2022 01:02:56 +0000 (GMT)	[thread overview]
Message-ID: <20220217010256.522B73858D20@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=40748cd73a0408be4095f03cdf12b9e2ff18c912

commit 40748cd73a0408be4095f03cdf12b9e2ff18c912
Author: Mike Frysinger <vapier@gentoo.org>
Date:   Mon Feb 14 21:35:57 2022 -0500

    newlib: powerpc: simplify reallocr & callocr build logic
    
    Replace the custom build rules (which require copying & pasting from the
    current Makefile) with small stub files.  This allows us to drop the rules
    entirely and let Automake provide everything.

Diff:
---
 newlib/libc/machine/powerpc/Makefile.am    |  8 +-------
 newlib/libc/machine/powerpc/Makefile.in    | 20 +++++++++++++-------
 newlib/libc/machine/powerpc/vec_callocr.c  |  2 ++
 newlib/libc/machine/powerpc/vec_reallocr.c |  2 ++
 4 files changed, 18 insertions(+), 14 deletions(-)

diff --git a/newlib/libc/machine/powerpc/Makefile.am b/newlib/libc/machine/powerpc/Makefile.am
index 54d9c58c5..eebe640de 100644
--- a/newlib/libc/machine/powerpc/Makefile.am
+++ b/newlib/libc/machine/powerpc/Makefile.am
@@ -45,13 +45,7 @@ endif
 lib_a_DEPENDENCIES = $(lib_a_LIBADD)
 EXTRA_lib_a_SOURCES = \
   vfprintf.c vfscanf.c \
-  vec_malloc.c vec_calloc.c vec_free.c vec_realloc.c vec_mallocr.c \
+  vec_malloc.c vec_calloc.c vec_free.c vec_realloc.c vec_mallocr.c vec_callocr.c vec_reallocr.c \
   atosfix16.c atosfix32.c atosfix64.c atoufix16.c atoufix32.c atoufix64.c \
   simdldtoa.c strtosfix16.c strtosfix32.c strtosfix64.c strtoufix16.c \
   strtoufix32.c strtoufix64.c ufix64toa.c
-
-lib_a-vec_reallocr.o: vec_mallocr.c
-	$(CC) $(DEFS) -DINTERNAL_NEWLIB -DDEFINE_VECREALLOC $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-vec_reallocr.o `test -f 'vec_mallocr.c' || echo '$(srcdir)/'`vec_mallocr.c
-
-lib_a-vec_callocr.o: vec_mallocr.c
-	$(CC) $(DEFS) -DINTERNAL_NEWLIB -DDEFINE_VECCALLOC $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-vec_callocr.o `test -f 'vec_mallocr.c' || echo '$(srcdir)/'`vec_mallocr.c
diff --git a/newlib/libc/machine/powerpc/Makefile.in b/newlib/libc/machine/powerpc/Makefile.in
index 0ca6bd916..261c1e874 100644
--- a/newlib/libc/machine/powerpc/Makefile.in
+++ b/newlib/libc/machine/powerpc/Makefile.in
@@ -333,7 +333,7 @@ lib_a_LIBADD = $(am__append_1) $(am__append_2)
 lib_a_DEPENDENCIES = $(lib_a_LIBADD)
 EXTRA_lib_a_SOURCES = \
   vfprintf.c vfscanf.c \
-  vec_malloc.c vec_calloc.c vec_free.c vec_realloc.c vec_mallocr.c \
+  vec_malloc.c vec_calloc.c vec_free.c vec_realloc.c vec_mallocr.c vec_callocr.c vec_reallocr.c \
   atosfix16.c atosfix32.c atosfix64.c atoufix16.c atoufix32.c atoufix64.c \
   simdldtoa.c strtosfix16.c strtosfix32.c strtosfix64.c strtoufix16.c \
   strtoufix32.c strtoufix64.c ufix64toa.c
@@ -440,6 +440,18 @@ lib_a-vec_mallocr.o: vec_mallocr.c
 lib_a-vec_mallocr.obj: vec_mallocr.c
 	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-vec_mallocr.obj `if test -f 'vec_mallocr.c'; then $(CYGPATH_W) 'vec_mallocr.c'; else $(CYGPATH_W) '$(srcdir)/vec_mallocr.c'; fi`
 
+lib_a-vec_callocr.o: vec_callocr.c
+	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-vec_callocr.o `test -f 'vec_callocr.c' || echo '$(srcdir)/'`vec_callocr.c
+
+lib_a-vec_callocr.obj: vec_callocr.c
+	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-vec_callocr.obj `if test -f 'vec_callocr.c'; then $(CYGPATH_W) 'vec_callocr.c'; else $(CYGPATH_W) '$(srcdir)/vec_callocr.c'; fi`
+
+lib_a-vec_reallocr.o: vec_reallocr.c
+	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-vec_reallocr.o `test -f 'vec_reallocr.c' || echo '$(srcdir)/'`vec_reallocr.c
+
+lib_a-vec_reallocr.obj: vec_reallocr.c
+	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-vec_reallocr.obj `if test -f 'vec_reallocr.c'; then $(CYGPATH_W) 'vec_reallocr.c'; else $(CYGPATH_W) '$(srcdir)/vec_reallocr.c'; fi`
+
 lib_a-atosfix16.o: atosfix16.c
 	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-atosfix16.o `test -f 'atosfix16.c' || echo '$(srcdir)/'`atosfix16.c
 
@@ -694,12 +706,6 @@ uninstall-am:
 .PRECIOUS: Makefile
 
 
-lib_a-vec_reallocr.o: vec_mallocr.c
-	$(CC) $(DEFS) -DINTERNAL_NEWLIB -DDEFINE_VECREALLOC $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-vec_reallocr.o `test -f 'vec_mallocr.c' || echo '$(srcdir)/'`vec_mallocr.c
-
-lib_a-vec_callocr.o: vec_mallocr.c
-	$(CC) $(DEFS) -DINTERNAL_NEWLIB -DDEFINE_VECCALLOC $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-vec_callocr.o `test -f 'vec_mallocr.c' || echo '$(srcdir)/'`vec_mallocr.c
-
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
 .NOEXPORT:
diff --git a/newlib/libc/machine/powerpc/vec_callocr.c b/newlib/libc/machine/powerpc/vec_callocr.c
new file mode 100644
index 000000000..6ce00d0cd
--- /dev/null
+++ b/newlib/libc/machine/powerpc/vec_callocr.c
@@ -0,0 +1,2 @@
+#define DEFINE_VECCALLOC
+#include "vec_mallocr.c"
diff --git a/newlib/libc/machine/powerpc/vec_reallocr.c b/newlib/libc/machine/powerpc/vec_reallocr.c
new file mode 100644
index 000000000..d1d99dec8
--- /dev/null
+++ b/newlib/libc/machine/powerpc/vec_reallocr.c
@@ -0,0 +1,2 @@
+#define DEFINE_VECREALLOC
+#include "vec_mallocr.c"


                 reply	other threads:[~2022-02-17  1:02 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220217010256.522B73858D20@sourceware.org \
    --to=vapier@sourceware.org \
    --cc=newlib-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).