[PATCH] libgloss: merge xstormy16 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 xstormy16-elf build shows installed objects & libs produce same code.
---
 libgloss/Makefile.am            |   3 +
 libgloss/Makefile.in            | 232 +++++++++++++++++++++++++-------
 libgloss/configure              |  19 ++-
 libgloss/configure.ac           |   5 +-
 libgloss/xstormy16/Makefile.in  | 131 ------------------
 libgloss/xstormy16/Makefile.inc |  48 +++++++
 6 files changed, 253 insertions(+), 185 deletions(-)
 delete mode 100644 libgloss/xstormy16/Makefile.in
 create mode 100644 libgloss/xstormy16/Makefile.inc

diff --git a/libgloss/Makefile.am b/libgloss/Makefile.am
index e70c9d246cb1..a877e402aff7 100644
--- a/libgloss/Makefile.am
+++ b/libgloss/Makefile.am
@@ -129,6 +129,9 @@ endif
 if CONFIG_V850
 include v850/Makefile.inc
 endif
+if CONFIG_XSTORMY16
+include xstormy16/Makefile.inc
+endif
 if CONFIG_XTENSA
 include xtensa/Makefile.inc
 endif
diff --git a/libgloss/configure.ac b/libgloss/configure.ac
index 8326889a2167..0ebc9b75b2fc 100644
--- a/libgloss/configure.ac
+++ b/libgloss/configure.ac
@@ -181,8 +181,7 @@ case "${target}" in
 	target_makefile_frag=${srcdir}/config/xc16x.mt
 	;;
   xstormy16-*-*)
-	AC_CONFIG_FILES([xstormy16/Makefile])
-	subdirs="$subdirs xstormy16"
+	config_xstormy16=true
 	;;
   xtensa-*-*)
 	config_xtensa=true
@@ -240,7 +239,7 @@ 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
-  nds32 nios2 riscv v850 wince xtensa
+  nds32 nios2 riscv v850 wince xstormy16 xtensa
 ], [dnl
   AM_CONDITIONAL([CONFIG_]m4_toupper(SUBDIR), [test x$config_]SUBDIR = xtrue)
 ])
diff --git a/libgloss/xstormy16/Makefile.in b/libgloss/xstormy16/Makefile.in
deleted file mode 100644
index 49d8a8deacfe..000000000000
--- a/libgloss/xstormy16/Makefile.in
+++ /dev/null
@@ -1,131 +0,0 @@
-#
-#
-
-DESTDIR =
-VPATH = @srcdir@ @srcdir@/..
-srcdir = @srcdir@
-objdir = .
-srcroot = $(srcdir)/../..
-objroot = $(objdir)/../..
-
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-
-host_alias = @host_alias@
-target_alias = @target_alias@
-
-bindir = @bindir@
-libdir = @libdir@
-tooldir = $(exec_prefix)/$(target_alias)
-
-INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_DATA = @INSTALL_DATA@
-
-# Multilib support variables.
-# TOP is used instead of MULTI{BUILD,SRC}TOP.
-MULTIDIRS =
-MULTISUBDIR =
-
-SHELL =	/bin/sh
-
-mkinstalldirs = $(SHELL) $(srcroot)/mkinstalldirs
-
-CC = @CC@
-
-AS = @AS@
-AR = @AR@
-LD = @LD@
-RANLIB = @RANLIB@
-
-# Yuk.
-OBJCOPY = $(subst ranlib,objcopy,$(RANLIB))
-
-OBJS		= isatty.o
-CFLAGS		= -g -O2
-ASFLAGS		= --gdwarf2
-SCRIPTS		= 
-CRT		= crt0.o crti.o crtn.o
-
-# Here is all of the simulator stuff
-SIM_SCRIPTS	= sim_high.ld sim_rom.ld
-SIM_LDFLAGS	=
-SIM_BSP		= libsim.a
-SIM_OBJS	= syscalls.o sim_malloc_start.o
-
-# Here is stuff for building apps for GDB on the EVA board
-EVA_APP_BSP     = libeva_app.a
-EVA_APP_OBJS    = close.o fstat.o getpid.o kill.o lseek.o open.o \
-                  stat.o unlink.o eva_app.o
-EVA_APP_SCRIPTS = eva_app.ld
-
-# Stub stuff
-EVA_STUB_HEX    = eva_stub.hex
-EVA_STUB        = eva_stub.elf
-EVA_STUB_OBJS   = xstormy16_stub.o crt0_stub.o
-
-# Host specific makefile fragment comes in here.
-@host_makefile_frag@
-
-#
-# build a test program for each target board. Just trying to get
-# it to link is a good test, so we ignore all the errors for now.
-#
-# all: ${MON_CRT0} ${MON_BSP}
-all: ${CRT} ${SIM_BSP} ${EVA_APP_BSP} ${EVA_STUB_HEX}
-
-#
-# here's where we build the board support packages for each target
-#
-${SIM_BSP}: ${OBJS} ${SIM_OBJS}
-	${AR} ${ARFLAGS} ${SIM_BSP} ${SIM_OBJS} ${OBJS}
-	${RANLIB} ${SIM_BSP}
-
-${EVA_APP_BSP}: ${OBJS} ${EVA_APP_OBJS}
-	${AR} ${ARFLAGS} ${EVA_APP_BSP} ${EVA_APP_OBJS} ${OBJS}
-	${RANLIB} ${EVA_APP_BSP}
-
-${EVA_STUB_HEX}: ${EVA_STUB}
-	${OBJCOPY} -O ihex $< $@
-
-${EVA_STUB}: ${EVA_STUB_OBJS} ${srcdir}/eva_stub.ld
-	${CC} -g -Os -nostartfiles -T${srcdir}/eva_stub.ld ${EVA_STUB_OBJS} -o $@
-
-
-#
-# here's where we build the test programs for each target
-#
-.PHONY: test
-test:	
-	true
-
-#
-#
-#
-.c.S:
-	${CC} ${CFLAGS_FOR_TARGET} -c $<
-
-clean mostlyclean:
-	rm -f a.out core *.i *.o *-test *.srec *.dis *.x *.hex $(SIM_BSP) $(EVA_APP_BSP) $(EVA_STUB) 
-
-distclean maintainer-clean realclean: clean
-	rm -f Makefile *~
-
-.PHONY: install info install-info clean-info
-install: 
-	${mkinstalldirs} ${DESTDIR}${tooldir}/lib${MULTISUBDIR}
-	set -e; for x in ${SIM_BSP} ${CRT} ${EVA_APP_BSP} ${EVA_STUB_HEX} ${EVA_STUB} ; do\
-	  ${INSTALL_DATA} $$x $(DESTDIR)${tooldir}/lib${MULTISUBDIR}/$$x; \
-	done
-	@for script in ${SCRIPTS} ${SIM_SCRIPTS} ${EVA_APP_SCRIPTS}; do\
-	  ${INSTALL_DATA} ${srcdir}/$${script} $(DESTDIR)${tooldir}/lib${MULTISUBDIR}/$${script}; \
-	done
-
-
-doc:
-info:
-install-info:
-clean-info:
-
-Makefile: Makefile.in ../config.status
-	cd .. && $(SHELL) config.status
diff --git a/libgloss/xstormy16/Makefile.inc b/libgloss/xstormy16/Makefile.inc
new file mode 100644
index 000000000000..527838c8982a
--- /dev/null
+++ b/libgloss/xstormy16/Makefile.inc
@@ -0,0 +1,48 @@
+multilibtool_DATA += \
+	%D%/crt0.o \
+	%D%/crti.o \
+	%D%/crtn.o
+libobjs_a_SOURCES += \
+	%D%/crt0.s \
+	%D%/crti.s \
+	%D%/crtn.s
+
+## Here is all of the simulator stuff
+multilibtool_DATA += \
+	%D%/sim_high.ld \
+	%D%/sim_rom.ld
+multilibtool_LIBRARIES += %D%/libsim.a
+%C%_libsim_a_SOURCES = \
+	%D%/syscalls.S \
+	%D%/sim_malloc_start.s \
+	%D%/isatty.c
+
+## Here is stuff for building apps for GDB on the EVA board
+multilibtool_DATA += %D%/eva_app.ld
+multilibtool_LIBRARIES += %D%/libeva_app.a
+%C%_libeva_app_a_SOURCES = \
+	%D%/close.c \
+	%D%/fstat.c \
+	%D%/getpid.c \
+	%D%/kill.c \
+	%D%/lseek.c \
+	%D%/open.c \
+	%D%/stat.c \
+	%D%/unlink.c \
+	%D%/eva_app.c \
+	%D%/isatty.c
+
+## Stub stuff
+multilibtool_DATA += \
+	%D%/eva_stub.elf \
+	%D%/eva_stub.hex
+
+%D%/eva_stub.hex: %D%/eva_stub.elf
+	$(AM_V_GEN)$(OBJCOPY) -O ihex $< $@
+
+libobjs_a_SOURCES += \
+	%D%/xstormy16_stub.c \
+	%D%/crt0_stub.s
+%D%/eva_stub.elf: %D%/xstormy16_stub.o %D%/crt0_stub.o %D%/eva_stub.ld
+	$(AM_V_CCLD)$(LINK) -nostartfiles -T$(srcdir)/%D%/eva_stub.ld \
+		%D%/xstormy16_stub.o %D%/crt0_stub.o
-- 
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.