From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1521) id 269A53858413; Tue, 10 Jan 2023 06:28:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 269A53858413 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1673332105; bh=rE9hDQ/Ew0KPIyJrdYr84OCCJh6bbdh5vz901LMeeUA=; h=From:To:Subject:Date:From; b=rWAcl1yV+lyhH3QlPw8lAa6w0Ty1pKYW8teTfeaVLkAU+pkEEMucHQJSvlw+5XM2p Gb8juE+ikY5OhyOZsgdnu2BJDf8fLNEqXrigyQMXcxLOtKGgAhKooBoA8AlmbIz+VU /GlnxuSXrjjFfUgJtxkk55C0Z9T0Lt3eFvIXRdb4= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Michael Frysinger To: gdb-cvs@sourceware.org Subject: [binutils-gdb] sim: common: move test-hw-events to top-level build X-Act-Checkin: binutils-gdb X-Git-Author: Mike Frysinger X-Git-Refname: refs/heads/master X-Git-Oldrev: b36a89d135a85ee0c41620b1dd47625c7cbf26ab X-Git-Newrev: b014c9b0872a05ec9fc3c63e712b4208654241af Message-Id: <20230110062825.269A53858413@sourceware.org> Date: Tue, 10 Jan 2023 06:28:25 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Db014c9b0872a= 05ec9fc3c63e712b4208654241af commit b014c9b0872a05ec9fc3c63e712b4208654241af Author: Mike Frysinger Date: Sun Jan 1 19:03:28 2023 -0500 sim: common: move test-hw-events to top-level build =20 This is an internal developer target that isn't normally compiled, but it can still be occasionally useful. Move it to the top-level build so we can kill off common/Make-common.in. Diff: --- sim/Makefile.in | 6 ++++++ sim/common/Make-common.in | 5 ----- sim/common/hw-events.c | 2 ++ sim/common/local.mk | 9 +++++++++ 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/sim/Makefile.in b/sim/Makefile.in index 099bfd56b98..c13239058bc 100644 --- a/sim/Makefile.in +++ b/sim/Makefile.in @@ -4585,6 +4585,12 @@ common/version.c-stamp: $(srcroot)/gdb/version.in $(= srcroot)/bfd/version.h $(src $(AM_V_at)$(SHELL) $(srcroot)/move-if-change $@.tmp $(@:-stamp=3D) $(AM_V_at)touch $@ =20 +.PRECIOUS: %/test-hw-events.o +%/test-hw-events.o: common/hw-events.c + $(AM_V_CC)$(COMPILE) -DMAIN -c -o $@ $< +%/test-hw-events: %/test-hw-events.o %/libsim.a + $(AM_V_CCLD)$(LINK) -o $@ $^ $(SIM_COMMON_LIBS) $(LIBS) + # FIXME This is one very simple-minded way of generating the file hw-confi= g.h. %/hw-config.h: %/stamp-hw ; @true %/stamp-hw: Makefile diff --git a/sim/common/Make-common.in b/sim/common/Make-common.in index 15242c61264..a081525c91c 100644 --- a/sim/common/Make-common.in +++ b/sim/common/Make-common.in @@ -154,11 +154,6 @@ override COMPILE.pre =3D source=3D'$<' object=3D'$@' l= ibtool=3Dno \ override POSTCOMPILE =3D endif =20 -test-hw-events: $(srccom)/hw-events.c libsim.a - $(ECHO_CCLD) $(LIBTOOL) $(AM_V_lt) --tag=3DCC --mode=3Dlink \ - $(CC) $(ALL_CFLAGS) -DMAIN -o test-hw-events$(EXEEXT) \ - $(srccom)/hw-events.c libsim.a $(EXTRA_LIBS) - # Support targets. =20 install: diff --git a/sim/common/hw-events.c b/sim/common/hw-events.c index 99e2f1a7fd8..fc579a85706 100644 --- a/sim/common/hw-events.c +++ b/sim/common/hw-events.c @@ -23,6 +23,8 @@ along with this program. If not, see . */ #include #include =20 +#include "sim/callback.h" + #include "hw-main.h" #include "hw-base.h" =20 diff --git a/sim/common/local.mk b/sim/common/local.mk index 32b5db6a6ee..f79a3011374 100644 --- a/sim/common/local.mk +++ b/sim/common/local.mk @@ -52,6 +52,15 @@ noinst_LIBRARIES +=3D %D%/libcommon.a CLEANFILES +=3D \ %D%/version.c %D%/version.c-stamp =20 +## NB: This is a bit of a hack. If we can generalize the common/ files, w= e can +## turn this from an arch-specific %/test-hw-events into a common/test-hw-= events +## program. +.PRECIOUS: %/test-hw-events.o +%/test-hw-events.o: common/hw-events.c + $(AM_V_CC)$(COMPILE) -DMAIN -c -o $@ $< +%/test-hw-events: %/test-hw-events.o %/libsim.a + $(AM_V_CCLD)$(LINK) -o $@ $^ $(SIM_COMMON_LIBS) $(LIBS) + ## ## For subdirs. ##