[PATCH] libgloss: merge m32r into top-level Makefile

Mike Frysinger <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <[email protected]>
Avoid a recursive make to speed things up a bit.
A m32r-elf build shows installed objects & libs produce same code.
---
 libgloss/Makefile.am       |   3 +
 libgloss/Makefile.in       | 378 +++++++++++++++++++++++++------------
 libgloss/configure         |  19 +-
 libgloss/configure.ac      |   5 +-
 libgloss/m32r/Makefile.in  | 141 --------------
 libgloss/m32r/Makefile.inc |  60 ++++++
 6 files changed, 339 insertions(+), 267 deletions(-)
 delete mode 100644 libgloss/m32r/Makefile.in
 create mode 100644 libgloss/m32r/Makefile.inc

diff --git a/libgloss/Makefile.am b/libgloss/Makefile.am
index b2aaada002d5..d51a7a2a9ade 100644
--- a/libgloss/Makefile.am
+++ b/libgloss/Makefile.am
@@ -99,6 +99,9 @@ endif
 if CONFIG_LM32
 include lm32/Makefile.inc
 endif
+if CONFIG_M32R
+include m32r/Makefile.inc
+endif
 if CONFIG_MCORE
 include mcore/Makefile.inc
 endif
diff --git a/libgloss/configure.ac b/libgloss/configure.ac
index 5518199aa6a9..60f4f35b64cc 100644
--- a/libgloss/configure.ac
+++ b/libgloss/configure.ac
@@ -66,8 +66,7 @@ case "${target}" in
 	config_i386=true
 	;;
   m32r-*-*)
-	AC_CONFIG_FILES([m32r/Makefile])
-	subdirs="$subdirs m32r"
+	config_m32r=true
 	;;
   m68hc11-*-* | m6811-*-* | m68hc12-*-* | m6812-*-*)
 	AC_CONFIG_FILES([m68hc11/Makefile])
@@ -236,7 +235,7 @@ 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 csky d30v frv i386 i960 iq2000 libnosys lm32
-  mcore mn10200 mn10300 moxie msp430
+  m32r mcore mn10200 mn10300 moxie msp430
   nds32 nios2 riscv rl78 rx v850 wince xstormy16 xtensa
 ], [dnl
   AM_CONDITIONAL([CONFIG_]m4_toupper(SUBDIR), [test x$config_]SUBDIR = xtrue)
diff --git a/libgloss/m32r/Makefile.in b/libgloss/m32r/Makefile.in
deleted file mode 100644
index 786502eb8b1a..000000000000
--- a/libgloss/m32r/Makefile.in
+++ /dev/null
@@ -1,141 +0,0 @@
-# Makefile for libgloss/m32r
-# Copyright (c) 1996, 1998 Cygnus Support.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms are permitted
-# provided that the above copyright notice and this paragraph are
-# duplicated in all such forms and that any documentation,
-# and/or other materials related to such
-# distribution and use acknowledge that the software was developed
-# at Cygnus Support, Inc.  Cygnus Support, Inc. may not be used to
-# endorse or promote products derived from this software without
-# specific prior written permission.
-# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
-# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-
-DESTDIR =
-VPATH = @srcdir@ @srcdir@/..
-srcdir = @srcdir@
-objdir = .
-srcroot = $(srcdir)/../..
-objroot = $(objdir)/../..
-
-host_alias = @host_alias@
-target_alias = @target_alias@
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-bindir = @bindir@
-libdir = @libdir@
-tooldir = $(exec_prefix)/$(target_alias)
-
-TOP = ../..
-SRCTOP = ../..
-
-# Multilib support variables.
-# TOP is used instead of MULTI{BUILD,SRC}TOP.
-MULTISRCTOP =
-MULTIBUILDTOP =
-MULTIDIRS =
-MULTISUBDIR =
-MULTIDO = true
-MULTICLEAN = true
-
-INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_DATA = @INSTALL_DATA@
-
-SHELL = /bin/sh
-
-CC = @CC@
-
-AS = @AS@
-AR = @AR@
-LD = @LD@
-RANLIB = @RANLIB@
-
-AR_FLAGS = qv
-BISON = bison
-MAKEINFO = makeinfo
-
-.NOEXPORT:
-MAKEOVERRIDES=
-
-TARGETDOC = ../../targetdep.tex
-
-CRT0 = crt0.o
-GDBLIB = m32r-lib.o
-GDBSTUB = m32r-stub.o
-EVASCRIPT = eva.ld
-STUBSCRIPT = eva-stub.ld
-
-GENERIC_LIBOBJS = \
-	chmod.o close.o exit.o fstat.o getpid.o isatty.o kill.o lseek.o \
-	open.o raise.o read.o sbrk.o stat.o unlink.o utime.o write.o
-
-LIBOBJS = trap0.o $(GENERIC_LIBOBJS)
-LIBGLOSS = libgloss.a
-
-MONLIBOBJS = trapmon0.o $(GENERIC_LIBOBJS)
-MONLIBGLOSS = libmon.a
-MONSPECS = mon.specs
-
-# Host specific makefile fragment comes in here.
-@host_makefile_frag@
-
-all: $(CRT0) $(LIBGLOSS) $(MONLIBGLOSS) $(GDBLIB) $(GDBSTUB)
-
-libgloss.a: $(LIBOBJS)
-	$(AR) $(ARFLAGS) $@ $(LIBOBJS)
-	$(RANLIB) $@
-
-libmon.a: $(MONLIBOBJS)
-	$(AR) $(ARFLAGS) $@ $(MONLIBOBJS)
-	$(RANLIB) $@
-
-install:
-	mkdir -p $(DESTDIR)$(tooldir)/lib${MULTISUBDIR}
-	$(INSTALL_DATA) $(CRT0) $(DESTDIR)$(tooldir)/lib${MULTISUBDIR}/$(CRT0)
-	$(INSTALL_DATA) $(LIBGLOSS) $(DESTDIR)$(tooldir)/lib${MULTISUBDIR}/$(LIBGLOSS)
-	$(INSTALL_DATA) $(MONLIBGLOSS) $(DESTDIR)$(tooldir)/lib${MULTISUBDIR}/$(MONLIBGLOSS)
-	$(INSTALL_DATA) $(GDBLIB) $(DESTDIR)$(tooldir)/lib${MULTISUBDIR}/$(GDBLIB)
-	$(INSTALL_DATA) $(GDBSTUB) $(DESTDIR)$(tooldir)/lib${MULTISUBDIR}/$(GDBSTUB)
-	$(INSTALL_DATA) $(srcdir)/$(EVASCRIPT) $(DESTDIR)$(tooldir)/lib/$(EVASCRIPT)
-	$(INSTALL_DATA) $(srcdir)/$(STUBSCRIPT) $(DESTDIR)$(tooldir)/lib/$(STUBSCRIPT)
-	$(INSTALL_DATA) $(srcdir)/$(MONSPECS) $(DESTDIR)$(tooldir)/lib/$(MONSPECS)
-
-clean mostlyclean:
-	rm -f *~ *.[oa]
-
-distclean maintainer-clean realclean: clean
-	rm -f Makefile
-
-info doc:
-install-info:
-clean-info:
-
-Makefile: Makefile.in ../config.status
-	cd .. && $(SHELL) config.status
-
-# to support SunOS VPATH
-crt0.o: crt0.S
-m32r-lib.o: m32r-lib.c
-m32r-stub.o: m32r-stub.c
-chmod.o: chmod.c
-close.o: close.c
-exit.o: exit.c
-fstat.o: fstat.c
-getpid.o: getpid.c
-isatty.o: isatty.c
-kill.o: kill.c
-lseek.o: lseek.c
-open.o: open.c
-raise.o: raise.c
-read.o: read.c
-sbrk.o: sbrk.c
-stat.o: stat.c
-unlink.o: unlink.c
-utime.o: utime.c
-write.o: write.c
-trap0.o: trap0.S
-trapmon0.o: trapmon0.c
diff --git a/libgloss/m32r/Makefile.inc b/libgloss/m32r/Makefile.inc
new file mode 100644
index 000000000000..7870cf8899ca
--- /dev/null
+++ b/libgloss/m32r/Makefile.inc
@@ -0,0 +1,60 @@
+## Makefile for libgloss/m32r
+## Copyright (c) 1996, 1998 Cygnus Support.
+## All rights reserved.
+##
+## Redistribution and use in source and binary forms are permitted
+## provided that the above copyright notice and this paragraph are
+## duplicated in all such forms and that any documentation,
+## and/or other materials related to such
+## distribution and use acknowledge that the software was developed
+## at Cygnus Support, Inc.  Cygnus Support, Inc. may not be used to
+## endorse or promote products derived from this software without
+## specific prior written permission.
+## THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
+## IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+## WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+
+if !HAVE_MULTISUBDIR
+multilibtool_DATA += \
+	%D%/eva.ld \
+	%D%/eva-stub.ld \
+	%D%/mon.specs
+endif
+
+multilibtool_DATA += %D%/crt0.o
+libobjs_a_SOURCES += %D%/crt0.S
+
+%C%_common_lib_sources = \
+	%D%/chmod.c \
+	%D%/close.c \
+	%D%/exit.c \
+	%D%/fstat.c \
+	%D%/getpid.c \
+	%D%/isatty.c \
+	%D%/kill.c \
+	%D%/lseek.c \
+	%D%/open.c \
+	%D%/raise.c \
+	%D%/read.c \
+	%D%/sbrk.c \
+	%D%/stat.c \
+	%D%/unlink.c \
+	%D%/utime.c \
+	%D%/write.c
+
+multilibtool_LIBRARIES += %D%/libgloss.a
+%C%_libgloss_a_SOURCES = \
+	%D%/trap0.S \
+	$(%C%_common_lib_sources)
+
+multilibtool_LIBRARIES += %D%/libmon.a
+%C%_libmon_a_SOURCES = \
+	%D%/trapmon0.c \
+	$(%C%_common_lib_sources)
+
+multilibtool_DATA += \
+	%D%/m32r-lib.o \
+	%D%/m32r-stub.o
+libobjs_a_SOURCES += \
+	%D%/m32r-lib.c \
+	%D%/m32r-stub.c
-- 
2.43.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.