public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] libgloss: merge csky into top-level Makefile
@ 2023-01-13  4:39 Mike Frysinger
  2023-01-13 10:15 ` Corinna Vinschen
  0 siblings, 1 reply; 3+ messages in thread
From: Mike Frysinger @ 2023-01-13  4:39 UTC (permalink / raw)
  To: newlib

Avoid a recursive make to speed things up a bit.
A csky-elf build shows installed objects & libs produce same code.
---
 libgloss/Makefile.am       |   3 +
 libgloss/Makefile.in       | 499 +++++++++++++++++++++++++++++++++----
 libgloss/configure         |  19 +-
 libgloss/configure.ac      |   5 +-
 libgloss/csky/Makefile.in  | 125 ----------
 libgloss/csky/Makefile.inc |  36 +++
 6 files changed, 506 insertions(+), 181 deletions(-)
 delete mode 100644 libgloss/csky/Makefile.in
 create mode 100644 libgloss/csky/Makefile.inc

diff --git a/libgloss/Makefile.am b/libgloss/Makefile.am
index daff91fdfc51..4309cd3a4b05 100644
--- a/libgloss/Makefile.am
+++ b/libgloss/Makefile.am
@@ -75,6 +75,9 @@ endif
 if CONFIG_BFIN
 include bfin/Makefile.inc
 endif
+if CONFIG_CSKY
+include csky/Makefile.inc
+endif
 if CONFIG_D30V
 include d30v/Makefile.inc
 endif
diff --git a/libgloss/configure.ac b/libgloss/configure.ac
index d636cf6d2aaf..5fb26845c2eb 100644
--- a/libgloss/configure.ac
+++ b/libgloss/configure.ac
@@ -55,8 +55,7 @@ case "${target}" in
 	config_arc=true
 	;;
   csky*-*-*)
-	AC_CONFIG_FILES([csky/Makefile])
-	subdirs="$subdirs csky"
+	config_csky=true
 	;;
   epiphany-*-*)
 	AC_CONFIG_FILES([epiphany/Makefile])
@@ -248,7 +247,7 @@ AC_SUBST(subdirs)
 dnl These subdirs have converted to non-recursive make.  Hopefully someday all
 dnl the ports above will too!
 m4_foreach_w([SUBDIR], [
-  aarch64 arc arm bfin d30v iq2000 libnosys lm32 nios2 riscv wince
+  aarch64 arc arm bfin csky d30v iq2000 libnosys lm32 nios2 riscv wince
 ], [dnl
   AM_CONDITIONAL([CONFIG_]m4_toupper(SUBDIR), [test x$config_]SUBDIR = xtrue)
 ])
diff --git a/libgloss/csky/Makefile.in b/libgloss/csky/Makefile.in
deleted file mode 100644
index ebf7ef2cd47e..000000000000
--- a/libgloss/csky/Makefile.in
+++ /dev/null
@@ -1,125 +0,0 @@
-# Copyright (c) 1995, 1996, 2001 Cygnus Support  -*- mode:makefile -*-
-#
-# The authors hereby grant permission to use, copy, modify, distribute,
-# and license this software and its documentation for any purpose, provided
-# that existing copyright notices are retained in all copies and that this
-# notice is included verbatim in any distributions. No written agreement,
-# license, or royalty fee is required for any of the authorized uses.
-# Modifications to this software may be copyrighted by their authors
-# and need not follow the licensing terms described here, provided that
-# the new terms are clearly indicated on the first page of each file where
-# they apply.
-#
-# csky semihosting support.
-#
-
-DESTDIR =
-VPATH = @srcdir@
-srcdir = @srcdir@
-objdir = .
-srcroot = $(srcdir)/../..
-objroot = $(objdir)/../..
-
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-
-host_alias = @host_alias@
-target_alias = @target_alias@
-program_transform_name = @program_transform_name@
-
-bindir = @bindir@
-libdir = @libdir@
-tooldir = $(exec_prefix)/$(target_alias)
-
-# Multilib support variables.
-# TOP is used instead of MULTI{BUILD,SRC}TOP.
-MULTIDIRS =
-MULTISUBDIR =
-MULTIDO = true
-MULTICLEAN = true
-
-INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_DATA = @INSTALL_DATA@
-
-SHELL =	/bin/sh
-
-mkinstalldirs = $(SHELL) $(srcroot)/mkinstalldirs
-
-CC = @CC@
-
-AS = @AS@
-AR = @AR@
-LD = @LD@
-RANLIB = @RANLIB@
-AR_FLAGS = qv
-
-OBJDUMP = `if [ -f ${objroot}/../binutils/objdump ] ; \
-	then echo ${objroot}/../binutils/objdump ; \
-	else t='$(program_transform_name)'; echo objdump | sed -e $$t ; fi`
-OBJCOPY = `if [ -f ${objroot}/../binutils/objcopy ] ; \
-	then echo ${objroot}/../binutils/objcopy ; \
-	else t='$(program_transform_name)'; echo objcopy | sed -e $$t ; fi`
-
-CRT0=crt0.S
-
-#
-# here's all the hosted stuff
-#
-HOSTED_BSP=	libsemi.a
-HOSTED_SRS=     io-semi.S
-HOSTED_SRC=     sbrk.c io-gdb.c io-exit.c io-close.c io-fstat.c io-gettimeofday.c \
-                io-lseek.c io-read.c io-system.c io-unlink.c io-exit.c \
-                io-gdb.c io-isatty.c io-open.c io-rename.c io-stat.c \
-                io-time.c io-write.c kill.o getpid.o
-HOSTED_OBJS=	$(patsubst %.c,%.o,$(HOSTED_SRC))
-
-INCLUDES+= -I/home/xialf/workspace/newlib-2.5.0.20171222/newlib/libc/include
-
-# Host specific makefile fragment comes in here.
-@host_makefile_frag@
-
-all :: $(HOSTED_BSP)
-
-#
-# here's where we build the board support packages for each target
-#
-
-# build hosted library
-$(HOSTED_OBJS) : %.o : %.c
-	$(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS) -nostdlib -DHOSTED=1 $(INCLUDES) -c $< -o $@
-$(HOSTED_SRS:%.S=%.o): %.o : %.S
-	$(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS) -nostdlib -DHOSTED=1 $(INCLUDES) -c $< -o $@
-
-$(HOSTED_BSP): $(HOSTED_OBJS)  $(HOSTED_SRS:%.S=%.o)
-	${AR} ${ARFLAGS} $@ $^
-	${RANLIB} $@
-
-crt0.o: $(CRT0)
-	$(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS) -c $< -o $@
-
-.PHONY: install info dvi doc install-info clean-info
-install:: install_hosted crt0.o
-	${mkinstalldirs} ${DESTDIR}${tooldir}/lib${MULTISUBDIR}
-	$(INSTALL_PROGRAM) crt0.o $(DESTDIR)$(tooldir)/lib${MULTISUBDIR}/$(crt0.o)
-
-.PHONY:install_hosted
-install_hosted::
-	${mkinstalldirs} ${DESTDIR}${tooldir}/lib${MULTISUBDIR}
-	$(INSTALL_PROGRAM) $(HOSTED_BSP) $(DESTDIR)$(tooldir)/lib${MULTISUBDIR}/$(HOSTED_BSP)
-
-# target specific makefile fragment comes in here.
-@target_makefile_frag@
-
-clean mostlyclean:
-	rm -f a.out core *.i *~ *.a *.o *-test *.srec *.dis *.x *.map
-
-distclean maintainer-clean realclean: clean
-	rm -f Makefile
-
-info dvi doc:
-install-info:
-clean-info:
-
-Makefile: Makefile.in ../config.status
-	cd .. && $(SHELL) config.status
diff --git a/libgloss/csky/Makefile.inc b/libgloss/csky/Makefile.inc
new file mode 100644
index 000000000000..7f38d659cbcd
--- /dev/null
+++ b/libgloss/csky/Makefile.inc
@@ -0,0 +1,36 @@
+## csky semihosting support.
+
+multilibtool_DATA += \
+	%D%/crt0.o
+libobjs_a_SOURCES += \
+	%D%/crt0.S
+
+## Here's all the hosted stuff.
+
+multilibtool_LIBRARIES += %D%/libsemi.a
+%C%_libsemi_a_SOURCES = \
+	%D%/io-semi.S \
+	%D%/sbrk.c \
+	%D%/io-gdb.c \
+	%D%/io-exit.c \
+	%D%/io-close.c \
+	%D%/io-fstat.c \
+	%D%/io-gettimeofday.c \
+	%D%/io-lseek.c \
+	%D%/io-read.c \
+	%D%/io-system.c \
+	%D%/io-unlink.c \
+	%D%/io-exit.c \
+	%D%/io-gdb.c \
+	%D%/io-isatty.c \
+	%D%/io-open.c \
+	%D%/io-rename.c \
+	%D%/io-stat.c \
+	%D%/io-time.c \
+	%D%/io-write.c \
+	%D%/kill.c \
+	%D%/getpid.c
+%C%_libsemi_a_CPPFLAGS = \
+	$(AM_CPPFLAGS) \
+	-nostdlib \
+	-DHOSTED=1
-- 
2.39.0


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

* Re: [PATCH] libgloss: merge csky into top-level Makefile
  2023-01-13  4:39 [PATCH] libgloss: merge csky into top-level Makefile Mike Frysinger
@ 2023-01-13 10:15 ` Corinna Vinschen
  2023-01-13 14:28   ` Mike Frysinger
  0 siblings, 1 reply; 3+ messages in thread
From: Corinna Vinschen @ 2023-01-13 10:15 UTC (permalink / raw)
  To: newlib

On Jan 12 23:39, Mike Frysinger wrote:
> Avoid a recursive make to speed things up a bit.
> A csky-elf build shows installed objects & libs produce same code.
> ---
>  libgloss/Makefile.am       |   3 +
>  libgloss/Makefile.in       | 499 +++++++++++++++++++++++++++++++++----
>  libgloss/configure         |  19 +-
>  libgloss/configure.ac      |   5 +-
>  libgloss/csky/Makefile.in  | 125 ----------
>  libgloss/csky/Makefile.inc |  36 +++
>  6 files changed, 506 insertions(+), 181 deletions(-)
>  delete mode 100644 libgloss/csky/Makefile.in
>  create mode 100644 libgloss/csky/Makefile.inc

LGTM.

Are you planning to finish up this autotools work in libgloss soon?

I'm asking because Jeff and me were discussing the yearly snapshot
release, and maybe it makes sense to wait for you to finish this up?


Thanks,
Corinna


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

* Re: [PATCH] libgloss: merge csky into top-level Makefile
  2023-01-13 10:15 ` Corinna Vinschen
@ 2023-01-13 14:28   ` Mike Frysinger
  0 siblings, 0 replies; 3+ messages in thread
From: Mike Frysinger @ 2023-01-13 14:28 UTC (permalink / raw)
  To: newlib

[-- Attachment #1: Type: text/plain, Size: 1023 bytes --]

On 13 Jan 2023 11:15, Corinna Vinschen wrote:
> On Jan 12 23:39, Mike Frysinger wrote:
> > Avoid a recursive make to speed things up a bit.
> > A csky-elf build shows installed objects & libs produce same code.
> > ---
> >  libgloss/Makefile.am       |   3 +
> >  libgloss/Makefile.in       | 499 +++++++++++++++++++++++++++++++++----
> >  libgloss/configure         |  19 +-
> >  libgloss/configure.ac      |   5 +-
> >  libgloss/csky/Makefile.in  | 125 ----------
> >  libgloss/csky/Makefile.inc |  36 +++
> >  6 files changed, 506 insertions(+), 181 deletions(-)
> >  delete mode 100644 libgloss/csky/Makefile.in
> >  create mode 100644 libgloss/csky/Makefile.inc
> 
> LGTM.
> 
> Are you planning to finish up this autotools work in libgloss soon?
> 
> I'm asking because Jeff and me were discussing the yearly snapshot
> release, and maybe it makes sense to wait for you to finish this up?

i have no work planned.  i just did these last few because i was bored.
so feel free to snap it.
-mike

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

end of thread, other threads:[~2023-01-13 14:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-13  4:39 [PATCH] libgloss: merge csky into top-level Makefile Mike Frysinger
2023-01-13 10:15 ` Corinna Vinschen
2023-01-13 14:28   ` Mike Frysinger

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