public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] newlib: powerpc: simplify reallocr & callocr build logic
@ 2022-02-15  3:02 Mike Frysinger
  2022-02-16  8:52 ` Corinna Vinschen
  0 siblings, 1 reply; 2+ messages in thread
From: Mike Frysinger @ 2022-02-15  3:02 UTC (permalink / raw)
  To: newlib

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.
---
 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(-)
 create mode 100644 newlib/libc/machine/powerpc/vec_callocr.c
 create mode 100644 newlib/libc/machine/powerpc/vec_reallocr.c

diff --git a/newlib/libc/machine/powerpc/Makefile.am b/newlib/libc/machine/powerpc/Makefile.am
index 54d9c58c59dd..eebe640dee84 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 bd3eed7246db..dfacb6faaf54 100644
--- a/newlib/libc/machine/powerpc/Makefile.in
+++ b/newlib/libc/machine/powerpc/Makefile.in
@@ -332,7 +332,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
@@ -439,6 +439,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
 
@@ -693,12 +705,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 000000000000..6ce00d0cd070
--- /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 000000000000..d1d99dec8414
--- /dev/null
+++ b/newlib/libc/machine/powerpc/vec_reallocr.c
@@ -0,0 +1,2 @@
+#define DEFINE_VECREALLOC
+#include "vec_mallocr.c"
-- 
2.34.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] newlib: powerpc: simplify reallocr & callocr build logic
  2022-02-15  3:02 [PATCH] newlib: powerpc: simplify reallocr & callocr build logic Mike Frysinger
@ 2022-02-16  8:52 ` Corinna Vinschen
  0 siblings, 0 replies; 2+ messages in thread
From: Corinna Vinschen @ 2022-02-16  8:52 UTC (permalink / raw)
  To: newlib

On Feb 14 22:02, Mike Frysinger wrote:
> 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.
> ---
>  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(-)
>  create mode 100644 newlib/libc/machine/powerpc/vec_callocr.c
>  create mode 100644 newlib/libc/machine/powerpc/vec_reallocr.c

LGTM


Thanks,
Corinna


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-02-16  8:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-15  3:02 [PATCH] newlib: powerpc: simplify reallocr & callocr build logic Mike Frysinger
2022-02-16  8:52 ` Corinna Vinschen

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).