public inbox for newlib-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin] libgloss: arm: inline multi-build logic
@ 2022-12-20 0:07 Michael Frysinger
0 siblings, 0 replies; only message in thread
From: Michael Frysinger @ 2022-12-20 0:07 UTC (permalink / raw)
To: newlib-cvs
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=6668403d2da566e5f269e20c428a2e813dc00eba
commit 6668403d2da566e5f269e20c428a2e813dc00eba
Author: Mike Frysinger <vapier@gentoo.org>
Date: Tue Dec 13 21:08:04 2022 -0500
libgloss: arm: inline multi-build logic
Since no other port uses this custom libgloss multi-build.in logic,
and it's making things difficult to unify, drop it all. The set of
installed objects and their content should be the same.
There is a difference in the builds: currently we compile all the
objects in this subdir twice, but only a subset of them use a diff
set of flags, and are actually installed (the librdimon.a and its
objects). So this change speeds things up by removing the duplicate
compilation.
There is a short term cost in having to duplicate the compile rules
for the files that are different, but this is minor when compared to
being able to delete the unused multi-build logic (which we'll do in
a sep commit), and we'll be able to clean this up when we move the
code to unified automake.
None of this should be confused with the common multilib logic.
This is *multi-build* which is processed in parallel.
Diff:
---
libgloss/arm/Makefile.in | 92 +++++++++++++++++++++++++-----------------------
1 file changed, 47 insertions(+), 45 deletions(-)
diff --git a/libgloss/arm/Makefile.in b/libgloss/arm/Makefile.in
index 45d889409..5dab75f75 100644
--- a/libgloss/arm/Makefile.in
+++ b/libgloss/arm/Makefile.in
@@ -29,15 +29,8 @@ MULTISRCTOP =
MULTIBUILDTOP =
MULTIDIRS =
MULTISUBDIR =
-MULTILIBNAME =
MULTIDO = true
MULTICLEAN = true
-MULTI_FLAGS_FOR_TARGET = MULTI_DEFAULT_FLAGS
-MULTI_DEFAULT_FLAGS = -DSEMIHOST_V2
-
-MULTIDIRS += semihv2m
-MULTIDIR_semihv2m_FLAGS = $(MULTI_DEFAULT_FLAGS) -DSEMIHOST_V2_MIXED_MODE
-MULTIDIR_semihv2m_NAME = -v2m
SHELL = /bin/sh
@@ -84,15 +77,15 @@ RDPMON_OBJS = ftruncate.o libcfunc.o syscalls.o trap.o truncate.o _exit.o _kill.
RDPMON_SCRIPTS = rdpmon.specs
RDPMON_INSTALL = install-rdpmon
-RDIMON_CRT0 = rdimon-crt0${${MULTILIBNAME}}.o
-RDIMON_BSP = librdimon${${MULTILIBNAME}}.a
+RDIMON_CRT0 = rdimon-crt0.o rdimon-crt0-v2m.o
+RDIMON_BSP = librdimon.a librdimon-v2m.a
RDIMON_OBJS = $(patsubst %,rdimon-%,$(RDPMON_OBJS))
-RDIMON_SCRIPTS = rdimon${${MULTILIBNAME}}.specs \
- aprofile-validation${${MULTILIBNAME}}.specs \
- aprofile-ve${${MULTILIBNAME}}.specs
+_RDIMON_SCRIPTS = rdimon.specs \
+ aprofile-validation.specs \
+ aprofile-ve.specs
+RDIMON_SCRIPTS = $(_RDIMON_SCRIPTS) $(patsubst %.specs,%-v2m.specs,$(_RDIMON_SCRIPTS))
RDIMON_INSTALL = install-rdimon
-
-CFLAGS = -g
+RDIMON_SEMIHV2M_OBJS = $(patsubst %.o,rdimon-%-v2m.o,$(RDPMON_OBJS))
# Here is all of the eval board stuff
PID_SCRIPTS = pid.specs
@@ -121,7 +114,6 @@ all: ${CRT0} ${LINUX_CRT0} ${LINUX_BSP} ${REDBOOT_CRT0} ${REDBOOT_OBJS} ${RDPMON
else true; fi; \
else true; fi; \
done
- $(MAKE) $(AM_MAKEFLAGS) all-recursive
#
# here's where we build the test programs for each target
@@ -133,34 +125,58 @@ test:
crt0.o: crt0.S
redboot-crt0.o: redboot-crt0.S
redboot-syscalls.o: redboot-syscalls.c $(srcdir)/../syscall.h
- $(CC) $(CFLAGS_FOR_TARGET) $($(MULTI_FLAGS_FOR_TARGET)) $(CFLAGS) $(INCLUDES) -o $@ -c $<
+ $(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS) $(INCLUDES) -DSEMIHOST_V2 -o $@ -c $<
rdpmon-crt0.o: crt0.S
- $(CC) $(CFLAGS_FOR_TARGET) $($(MULTI_FLAGS_FOR_TARGET)) $(CFLAGS) $(INCLUDES) -DARM_RDP_MONITOR -o $@ -c $<
+ $(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS) $(INCLUDES) -DSEMIHOST_V2 -DARM_RDP_MONITOR -o $@ -c $<
-rdimon-crt0${${MULTILIBNAME}}.o: crt0.S
- $(CC) $(CFLAGS_FOR_TARGET) $($(MULTI_FLAGS_FOR_TARGET)) $(CFLAGS) $(INCLUDES) -DARM_RDI_MONITOR -o $@ -c $<
+rdimon-crt0.o: crt0.S
+ $(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS) $(INCLUDES) -DSEMIHOST_V2 -DARM_RDI_MONITOR -o $@ -c $<
rdimon-ftruncate.o: ftruncate.c
- $(CC) $(CFLAGS_FOR_TARGET) $($(MULTI_FLAGS_FOR_TARGET)) $(CFLAGS) $(INCLUDES) -DARM_RDI_MONITOR -o $@ -c $<
+ $(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS) $(INCLUDES) -DSEMIHOST_V2 -DARM_RDI_MONITOR -o $@ -c $<
rdimon-trap.o: trap.S
- $(CC) $(CFLAGS_FOR_TARGET) $($(MULTI_FLAGS_FOR_TARGET)) $(CFLAGS) $(INCLUDES) -DARM_RDI_MONITOR -o $@ -c $<
+ $(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS) $(INCLUDES) -DSEMIHOST_V2 -DARM_RDI_MONITOR -o $@ -c $<
rdimon-truncate.o: truncate.c
- $(CC) $(CFLAGS_FOR_TARGET) $($(MULTI_FLAGS_FOR_TARGET)) $(CFLAGS) $(INCLUDES) -DARM_RDI_MONITOR -o $@ -c $<
+ $(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS) $(INCLUDES) -DSEMIHOST_V2 -DARM_RDI_MONITOR -o $@ -c $<
rdimon-_exit.o: _exit.c
- $(CC) $(CFLAGS_FOR_TARGET) $($(MULTI_FLAGS_FOR_TARGET)) $(CFLAGS) $(INCLUDES) -DARM_RDI_MONITOR -o $@ -c $<
+ $(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS) $(INCLUDES) -DSEMIHOST_V2 -DARM_RDI_MONITOR -o $@ -c $<
rdimon-_kill.o: _kill.c
- $(CC) $(CFLAGS_FOR_TARGET) $($(MULTI_FLAGS_FOR_TARGET)) $(CFLAGS) $(INCLUDES) -DARM_RDI_MONITOR -o $@ -c $<
+ $(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS) $(INCLUDES) -DSEMIHOST_V2 -DARM_RDI_MONITOR -o $@ -c $<
rdimon-syscalls.o: syscalls.c
- $(CC) $(CFLAGS_FOR_TARGET) $($(MULTI_FLAGS_FOR_TARGET)) $(CFLAGS) $(INCLUDES) -DARM_RDI_MONITOR -o $@ -c $<
+ $(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS) $(INCLUDES) -DSEMIHOST_V2 -DARM_RDI_MONITOR -o $@ -c $<
rdimon-libcfunc.o: libcfunc.c
- $(CC) $(CFLAGS_FOR_TARGET) $($(MULTI_FLAGS_FOR_TARGET)) $(CFLAGS) $(INCLUDES) -DARM_RDI_MONITOR -o $@ -c $<
+ $(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS) $(INCLUDES) -DSEMIHOST_V2 -DARM_RDI_MONITOR -o $@ -c $<
+
+rdimon-crt0-v2m.o: crt0.S
+ $(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS) $(INCLUDES) -DSEMIHOST_V2 -DSEMIHOST_V2_MIXED_MODE -DARM_RDI_MONITOR -o $@ -c $<
+
+rdimon-ftruncate-v2m.o: ftruncate.c
+ $(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS) $(INCLUDES) -DSEMIHOST_V2 -DSEMIHOST_V2_MIXED_MODE -DARM_RDI_MONITOR -o $@ -c $<
+
+rdimon-trap-v2m.o: trap.S
+ $(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS) $(INCLUDES) -DSEMIHOST_V2 -DSEMIHOST_V2_MIXED_MODE -DARM_RDI_MONITOR -o $@ -c $<
+
+rdimon-truncate-v2m.o: truncate.c
+ $(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS) $(INCLUDES) -DSEMIHOST_V2 -DSEMIHOST_V2_MIXED_MODE -DARM_RDI_MONITOR -o $@ -c $<
+
+rdimon-_exit-v2m.o: _exit.c
+ $(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS) $(INCLUDES) -DSEMIHOST_V2 -DSEMIHOST_V2_MIXED_MODE -DARM_RDI_MONITOR -o $@ -c $<
+
+rdimon-_kill-v2m.o: _kill.c
+ $(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS) $(INCLUDES) -DSEMIHOST_V2 -DSEMIHOST_V2_MIXED_MODE -DARM_RDI_MONITOR -o $@ -c $<
+
+rdimon-syscalls-v2m.o: syscalls.c
+ $(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS) $(INCLUDES) -DSEMIHOST_V2 -DSEMIHOST_V2_MIXED_MODE -DARM_RDI_MONITOR -o $@ -c $<
+
+rdimon-libcfunc-v2m.o: libcfunc.c
+ $(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS) $(INCLUDES) -DSEMIHOST_V2 -DSEMIHOST_V2_MIXED_MODE -DARM_RDI_MONITOR -o $@ -c $<
$(LINUX_BSP): $(LINUX_OBJS)
${AR} ${ARFLAGS} $@ $^
@@ -170,27 +186,17 @@ $(RDPMON_BSP): $(RDPMON_OBJS)
${AR} ${ARFLAGS} $@ $^
${RANLIB} $@
-$(RDIMON_BSP): $(RDIMON_OBJS)
+librdimon.a: $(RDIMON_OBJS)
+ ${AR} ${ARFLAGS} $@ $^
+ ${RANLIB} $@
+
+librdimon-v2m.a: $(RDIMON_SEMIHV2M_OBJS)
${AR} ${ARFLAGS} $@ $^
${RANLIB} $@
# Multilib support.
.PHONY: libgloss-multi-do all-multi clean-multi install-multi
-all-recursive: all-multi
-clean-recursive: clean-multi
-install-recursive: install-multi
-
-# The $(MAKE) comments below are to enable parallel building.
-all-multi:
- $(MAKE) $(AM_MAKEFLAGS) DO=all libgloss-multi-do
-
-clean-multi:
- $(MAKE) $(AM_MAKEFLAGS) DO=clean libgloss-multi-do
-
-install-multi:
- $(MAKE) $(AM_MAKEFLAGS) DO=install libgloss-multi-do
-
clean mostlyclean:
rm -f a.out core *.i *.o *-test *.srec *.dis *.x $(SIM_BSP) $(IQ80310_BSP)
@rootpre=`pwd`/; export rootpre; \
@@ -202,7 +208,6 @@ clean mostlyclean:
else true; fi; \
else true; fi; \
done
- $(MAKE) $(AM_MAKEFLAGS) clean-recursive
distclean maintainer-clean realclean: clean
rm -f Makefile config.status *~
@@ -218,7 +223,6 @@ install: ${CRT0_INSTALL} ${LINUX_INSTALL} ${REDBOOT_INSTALL} ${RDPMON_INSTALL} $
else true; fi; \
else true; fi; \
done
- $(MAKE) $(AM_MAKEFLAGS) install-recursive
install-nano:
${mkinstalldirs} ${DESTDIR}${tooldir}/lib${MULTISUBDIR}
@@ -268,5 +272,3 @@ Makefile: Makefile.in config.status @host_makefile_frag_path@
config.status: configure
$(SHELL) config.status --recheck
-
-include $(srcdir)/../multi-build.in
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-12-20 0:07 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-20 0:07 [newlib-cygwin] libgloss: arm: inline multi-build logic Michael 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).