From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) by sourceware.org (Postfix) with ESMTP id 827B53858425 for ; Wed, 21 Dec 2022 05:33:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 827B53858425 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gentoo.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gentoo.org Received: by smtp.gentoo.org (Postfix, from userid 559) id 322D73415B7; Wed, 21 Dec 2022 05:33:24 +0000 (UTC) From: Mike Frysinger To: gdb-patches@sourceware.org Subject: [PATCH 1/3] sim: build: hoist lists of common objects up Date: Wed, 21 Dec 2022 00:33:19 -0500 Message-Id: <20221221053321.18033-1-vapier@gentoo.org> X-Mailer: git-send-email 2.39.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.1 required=5.0 tests=BAYES_00,GIT_PATCH_0,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: In order to create libsim.a in the common dir, we need the list of objects for each target. To avoid duplicating the list with the recursive make in each port, pass it down as a variable. This is a temporary hack until the top-level creates libsim.a for ports. --- sim/Makefile.in | 194 +++++++++++++++++++++----------------- sim/arch-subdir.mk.in | 3 +- sim/common/Make-common.in | 47 +-------- sim/common/local.mk | 54 +++++++++++ 4 files changed, 167 insertions(+), 131 deletions(-) diff --git a/sim/arch-subdir.mk.in b/sim/arch-subdir.mk.in index 251a9b684d93..cfde3f3fb785 100644 --- a/sim/arch-subdir.mk.in +++ b/sim/arch-subdir.mk.in @@ -71,6 +71,5 @@ CGENDIR = @cgendir@ SIM_INLINE = @SIM_INLINE@ SIM_HW_CFLAGS = @SIM_HW_CFLAGS@ -SIM_HW_SOCKSER = @SIM_HW_SOCKSER@ -SIM_HW_OBJS = $(SIM_COMMON_HW_OBJS) $(SIM_HW_DEVICES:%=dv-%.o) $(SIM_HW_SOCKSER) +SIM_HW_OBJS = $(SIM_HW_DEVICES:%=dv-%.o) @SIM_ENABLE_HW_FALSE@SIM_HW_OBJS = diff --git a/sim/common/Make-common.in b/sim/common/Make-common.in index 8e27795438a9..684d7d847ab0 100644 --- a/sim/common/Make-common.in +++ b/sim/common/Make-common.in @@ -114,50 +114,6 @@ SIM_EXTRA_DISTCLEAN = # here. Some files are used by all simulators (e.g. callback.o). # Those files are specified in LIB_OBJS below. -SIM_COMMON_HW_OBJS = \ - hw-alloc.o \ - hw-base.o \ - hw-device.o \ - hw-events.o \ - hw-handles.o \ - hw-instances.o \ - hw-ports.o \ - hw-properties.o \ - hw-tree.o \ - sim-hw.o \ - -SIM_NEW_COMMON_OBJS = \ - sim-arange.o \ - sim-bits.o \ - sim-close.o \ - sim-command.o \ - sim-config.o \ - sim-core.o \ - sim-cpu.o \ - sim-endian.o \ - sim-engine.o \ - sim-events.o \ - sim-fpu.o \ - sim-hload.o \ - sim-hrw.o \ - sim-io.o \ - sim-info.o \ - sim-memopt.o \ - sim-model.o \ - sim-module.o \ - sim-options.o \ - sim-profile.o \ - sim-reason.o \ - sim-reg.o \ - sim-signal.o \ - sim-stop.o \ - sim-syscall.o \ - sim-trace.o \ - sim-utils.o \ - sim-watch.o \ - \ - $(SIM_HW_OBJS) \ - ## End COMMON_PRE_CONFIG_FRAG ## COMMON_POST_CONFIG_FRAG @@ -180,7 +136,8 @@ BUILD_CFLAGS = $(CFLAGS_FOR_BUILD) $(CSEARCH) COMMON_DEP_CFLAGS = $(CONFIG_CFLAGS) $(CSEARCH) $(SIM_EXTRA_CFLAGS) -SIM_HW_DEVICES = cfi core pal glue $(SIM_EXTRA_HW_DEVICES) +SIM_HW_DEVICES = $(SIM_HW_DEVICES_) $(SIM_EXTRA_HW_DEVICES) +SIM_NEW_COMMON_OBJS = $(SIM_NEW_COMMON_OBJS_) $(SIM_HW_OBJS) LIBIBERTY_LIB = ../../libiberty/libiberty.a BFD_LIB = ../../bfd/libbfd.la diff --git a/sim/common/local.mk b/sim/common/local.mk index c45af29d8c71..bf9b97d04d71 100644 --- a/sim/common/local.mk +++ b/sim/common/local.mk @@ -56,6 +56,60 @@ CLEANFILES += \ ## For subdirs. ## +SIM_COMMON_HW_OBJS = \ + hw-alloc.o \ + hw-base.o \ + hw-device.o \ + hw-events.o \ + hw-handles.o \ + hw-instances.o \ + hw-ports.o \ + hw-properties.o \ + hw-tree.o \ + sim-hw.o + +SIM_NEW_COMMON_OBJS = \ + sim-arange.o \ + sim-bits.o \ + sim-close.o \ + sim-command.o \ + sim-config.o \ + sim-core.o \ + sim-cpu.o \ + sim-endian.o \ + sim-engine.o \ + sim-events.o \ + sim-fpu.o \ + sim-hload.o \ + sim-hrw.o \ + sim-io.o \ + sim-info.o \ + sim-memopt.o \ + sim-model.o \ + sim-module.o \ + sim-options.o \ + sim-profile.o \ + sim-reason.o \ + sim-reg.o \ + sim-signal.o \ + sim-stop.o \ + sim-syscall.o \ + sim-trace.o \ + sim-utils.o \ + sim-watch.o + +AM_MAKEFLAGS += SIM_NEW_COMMON_OBJS_="$(SIM_NEW_COMMON_OBJS)" + +SIM_HW_DEVICES = cfi core pal glue + +if SIM_ENABLE_HW +SIM_NEW_COMMON_OBJS += \ + $(SIM_COMMON_HW_OBJS) \ + $(SIM_HW_SOCKSER) + +AM_MAKEFLAGS += SIM_HW_DEVICES_="$(SIM_HW_DEVICES)" +endif + LIBIBERTY_LIB = ../libiberty/libiberty.a BFD_LIB = ../bfd/libbfd.la OPCODES_LIB = ../opcodes/libopcodes.la -- 2.39.0