public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH/committed] sim: ppc: simplify filter_host.c logic
@ 2024-01-01 21:24 Mike Frysinger
  0 siblings, 0 replies; only message in thread
From: Mike Frysinger @ 2024-01-01 21:24 UTC (permalink / raw)
  To: gdb-patches

Switch this from a build-time generation to a static include.  This
makes the build rules a bit simpler, especially as we move them to
Automake from hand-written makefiles.
---
 sim/ppc/Makefile.in   |  8 +-------
 sim/ppc/filter_host.c | 18 ++++++++++++++++++
 2 files changed, 19 insertions(+), 7 deletions(-)
 create mode 100644 sim/ppc/filter_host.c

diff --git a/sim/ppc/Makefile.in b/sim/ppc/Makefile.in
index 48adacc0971a..ee8fb0462eb5 100644
--- a/sim/ppc/Makefile.in
+++ b/sim/ppc/Makefile.in
@@ -613,20 +613,14 @@ tmp-igen: igen $(srcdir)/powerpc.igen $(srcdir)/altivec.igen $(srcdir)/e500.igen
 		-n support.c   -f  support.c
 	$(SILENCE) touch $@
 
-# NOTE: Some versions of make don't handle files created as side-effects
-# uncomment the below if that is the case.
-
 $(TARGETLIB): tmp-igen
 itable.h itable.c icache.h icache.c idecode.h idecode.c semantics.h semantics.c model.h model.c support.h support.c: tmp-igen
 
 igen: igen.o table.o lf.o misc.o filter_host.o ld-decode.o ld-cache.o filter.o ld-insn.o gen-model.o gen-itable.o gen-icache.o gen-semantics.o gen-idecode.o gen-support.o
 	$(ECHO_CCLD) $(LINK_FOR_BUILD) igen.o table.o lf.o misc.o filter_host.o ld-decode.o ld-cache.o filter.o ld-insn.o gen-model.o gen-itable.o gen-icache.o gen-semantics.o gen-idecode.o gen-support.o
 
-filter_host.c: filter_filename.c
-	$(ECHO_GEN) cat $(srcdir)/filter_filename.c > filter_host.c
-
 filter_host.o: filter_host.c $(CONFIG_H) $(FILTER_FILENAME_H)
-	$(ECHO_CC) $(COMPILE_FOR_BUILD) -c filter_host.c
+	$(ECHO_CC) $(COMPILE_FOR_BUILD) -c $(srcdir)/filter_host.c
 
 table.o: table.c $(CONFIG_H) $(MISC_H) $(LF_H) $(TABLE_H)
 	$(ECHO_CC) $(COMPILE_FOR_BUILD) -c $(srcdir)/table.c
diff --git a/sim/ppc/filter_host.c b/sim/ppc/filter_host.c
new file mode 100644
index 000000000000..87d9bbc2e222
--- /dev/null
+++ b/sim/ppc/filter_host.c
@@ -0,0 +1,18 @@
+/* Shim to share files between build & host programs.
+
+   Copyright (C) 2024 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/>.  */
+
+#include "filter_filename.c"
-- 
2.43.0


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

only message in thread, other threads:[~2024-01-01 21:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-01 21:24 [PATCH/committed] sim: ppc: simplify filter_host.c logic 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).