public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] sim: moxie: hoist dtb rules up to common builds
@ 2021-12-04 18:56 Mike Frysinger
  0 siblings, 0 replies; only message in thread
From: Mike Frysinger @ 2021-12-04 18:56 UTC (permalink / raw)
  To: gdb-patches

These rules don't depend on the target compiler settings, so hoist
the build logic up to the common builds for better parallelization.
---
 sim/Makefile.am       |   3 ++
 sim/Makefile.in       | 110 +++++++++++++++++++++++++++++++-----------
 sim/moxie/Makefile.in |  20 --------
 sim/moxie/local.mk    |  32 ++++++++++++
 4 files changed, 116 insertions(+), 49 deletions(-)
 create mode 100644 sim/moxie/local.mk

diff --git a/sim/Makefile.am b/sim/Makefile.am
index c3e7e767c47b..b58f50aabd35 100644
--- a/sim/Makefile.am
+++ b/sim/Makefile.am
@@ -107,6 +107,9 @@ endif
 if SIM_ENABLE_ARCH_mn10300
 include mn10300/local.mk
 endif
+if SIM_ENABLE_ARCH_moxie
+include moxie/local.mk
+endif
 if SIM_ENABLE_ARCH_or1k
 include or1k/local.mk
 endif
diff --git a/sim/moxie/Makefile.in b/sim/moxie/Makefile.in
index 6671389c2939..0e8b20afc8af 100644
--- a/sim/moxie/Makefile.in
+++ b/sim/moxie/Makefile.in
@@ -17,32 +17,12 @@
 
 ## COMMON_PRE_CONFIG_FRAG
 
-dtbdir = $(datadir)/gdb/dtb
-
 SIM_OBJS = \
 	$(SIM_NEW_COMMON_OBJS) \
 	interp.o \
 	sim-resume.o
 
 SIM_EXTRA_LIBS = -lm -lz
-SIM_EXTRA_INSTALL = install-dtb
 SIM_EXTRA_CFLAGS = -DDTB="\"$(dtbdir)/moxie-gdb.dtb\""
 
 ## COMMON_POST_CONFIG_FRAG
-
-all: moxie-gdb.dtb
-
-moxie-gdb.dtb: $(MAINT) moxie-gdb.dts
-	@echo Regenerating moxie-gdb.dtb
-	if test "x$(DTC)" != x; then \
-	  $(DTC) -O dtb -o moxie-gdb.dtb ${srcdir}/moxie-gdb.dts || exit 1; \
-	  $(SHELL) $(srcroot)/move-if-change moxie-gdb.dtb ${srcdir}/moxie-gdb.dtb || exit 1; \
-	else \
-	  echo "Could not update the moxie-gdb.dtb file because the device "; \
-	  echo "tree compiler tool (dtc) is missing.  Install the tool to "; \
-	  echo "update the device tree blob."; \
-	fi
-
-install-dtb: moxie-gdb.dtb
-	$(SHELL) $(srcdir)/../../mkinstalldirs $(DESTDIR)$(dtbdir)
-	$(INSTALL_DATA) $(srcdir)/moxie-gdb.dtb $(DESTDIR)$(dtbdir)/moxie-gdb.dtb
diff --git a/sim/moxie/local.mk b/sim/moxie/local.mk
new file mode 100644
index 000000000000..b73bd853bb5e
--- /dev/null
+++ b/sim/moxie/local.mk
@@ -0,0 +1,32 @@
+# See sim/Makefile.am
+#
+# Copyright (C) 1993-2021 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+dtbdir = $(datadir)/gdb/dtb
+
+dtb_DATA = %D%/moxie-gdb.dtb
+
+%D%/moxie-gdb.dtb: @MAINT@ %D%/moxie-gdb.dts %D%/$(am__dirstamp)
+	$(AM_V_GEN) \
+	if test "x$(DTC)" != x; then \
+	  $(DTC) -O dtb -o $@.tmp ${srcdir}/%D%/moxie-gdb.dts || exit 1; \
+	  $(SHELL) $(srcroot)/move-if-change $@.tmp ${srcdir}/%D%/moxie-gdb.dtb || exit 1; \
+	  touch ${srcdir}/%D%/moxie-gdb.dtb; \
+	else \
+	  echo "Could not update the moxie-gdb.dtb file because the device "; \
+	  echo "tree compiler tool (dtc) is missing.  Install the tool to "; \
+	  echo "update the device tree blob."; \
+	fi
-- 
2.33.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-12-04 18:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-04 18:56 [PATCH] sim: moxie: hoist dtb rules up to common builds 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).