From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) by sourceware.org (Postfix) with ESMTP id DA3383858D32 for ; Fri, 13 Jan 2023 04:40:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DA3383858D32 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gentoo.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gentoo.org Received: by smtp.gentoo.org (Postfix, from userid 559) id 87EBD340B0B; Fri, 13 Jan 2023 04:40:00 +0000 (UTC) From: Mike Frysinger To: newlib@sourceware.org Subject: [PATCH] libgloss: merge csky into top-level Makefile Date: Thu, 12 Jan 2023 23:39:57 -0500 Message-Id: <20230113043957.8892-1-vapier@gentoo.org> X-Mailer: git-send-email 2.39.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.2 required=5.0 tests=BAYES_00,GIT_PATCH_0,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: 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