From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) by sourceware.org (Postfix) with ESMTP id C6B843858292 for ; Wed, 3 Jan 2024 06:21:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C6B843858292 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gentoo.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gentoo.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org C6B843858292 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2001:470:ea4a:1:5054:ff:fec7:86e4 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704262899; cv=none; b=WFY+oG/O3RbQm4Al9PABMggHl/A0NwpDamknnR+VvVG5e64X/uT+w+U+eF6apY/TU6B4rfEjOO03aA/E1O9xpYmc/Nnze+amg+rtxRE7RbmoK8BqRnDow+9xAL8W/q1Qudrfwhy+h8nWSZL6V9WkHdseP2VVIUoHpdhVioc9+yU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704262899; c=relaxed/simple; bh=gFMjRecgW5+hvPVWv/iR9RJATe0PXNH6MO8MuV7nS+I=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=LVXPyqll8sq8eR832rBUKAnHvW1t8BEIxNh44sPuAcrKVEJP91JlC+Agq0yb3v10G9XO2p9UbA7NHr86dXso5nzP0odmHu3BxSUjmm3+Gg9SxBZWvU46xKkPvbkWSG9hpq/BndLSLYi62qu7xXyIA1WNLk5vdTH66MzuajUCcLQ= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by smtp.gentoo.org (Postfix, from userid 559) id 790E2340813; Wed, 3 Jan 2024 06:21:36 +0000 (UTC) From: Mike Frysinger To: gdb-patches@sourceware.org Subject: [PATCH/committed 2/5] sim: ppc: move libsim.a creation to top-level Date: Wed, 3 Jan 2024 01:21:29 -0500 Message-ID: <20240103062132.24338-2-vapier@gentoo.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240103062132.24338-1-vapier@gentoo.org> References: <20240103062132.24338-1-vapier@gentoo.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.3 required=5.0 tests=BAYES_00,GIT_PATCH_0,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,SPF_HELO_PASS,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE 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: The objects are still compiled in the subdir, but the creation of the archive itself is in the top-level. This is a required step before we can move compilation itself up, and makes it easier to review. The downside is that each object compile is a recursive make instead of a single one. It adds some overhead, so it's not great, but it shouldn't be a big deal. This will go away once compilation is hoisted up. --- sim/Makefile.in | 111 ++++++++++++++++++++++++++++++++++++-------- sim/configure | 1 - sim/configure.ac | 1 - sim/ppc/Makefile.in | 9 +--- sim/ppc/local.mk | 54 ++++++++++++++++++--- 5 files changed, 141 insertions(+), 35 deletions(-) diff --git a/sim/configure.ac b/sim/configure.ac index bc51492fd478..cd84040945b7 100644 --- a/sim/configure.ac +++ b/sim/configure.ac @@ -64,7 +64,6 @@ m4_define([SIM_BUILD_TARGET], [dnl AS_VAR_APPEND([SIM_ENABLED_ARCHES], [" $1"]) m4_if($2, [true], [dnl AC_CONFIG_FILES($1/Makefile) - subdirs="$subdirs $1" ]) AC_CONFIG_FILES($1/.gdbinit:common/gdbinit.in) ]) diff --git a/sim/ppc/Makefile.in b/sim/ppc/Makefile.in index 7841e75d4ce8..8c055689e6e1 100644 --- a/sim/ppc/Makefile.in +++ b/sim/ppc/Makefile.in @@ -97,10 +97,7 @@ INCLUDES = -I. -I$(srcdir) $(LIB_INCLUDES) $(BFD_INCLUDES) -I../.. LIBIBERTY_LIB = ../../libiberty/libiberty.a BFD_LIB = ../../bfd/libbfd.la - -TARGETLIB = libsim.a - -all: $(TARGETLIB) $(GDB_OBJ) +all: .c.o: $(ECHO_CC) $(CC) -c $(STD_CFLAGS) $< @@ -444,10 +441,6 @@ PACKAGE_SRC = pk_disklabel.c PACKAGE_OBJ = $(PACKAGE_SRC:.c=.o) -$(TARGETLIB): defines.h $(LIB_OBJ) $(GDB_OBJ) - $(ECHO_AR) $(AR) $(AR_FLAGS) $(TARGETLIB) $(LIB_OBJ) $(GDB_OBJ) - $(ECHO_RANLIB) $(RANLIB) $(TARGETLIB) - psim.o: psim.c $(CPU_H) $(IDECODE_H) $(OPTIONS_H) $(TREE_H) $(BFD_H) bits.o: bits.c $(BASICS_H) diff --git a/sim/ppc/local.mk b/sim/ppc/local.mk index 3c36b60df5a4..90f9489e4644 100644 --- a/sim/ppc/local.mk +++ b/sim/ppc/local.mk @@ -26,6 +26,53 @@ AM_CPPFLAGS_%C% = \ $(sim_ppc_model) $(sim_ppc_default_model) $(sim_ppc_model_issue) \ $(sim_ppc_switch) +%C%_libsim_a_SOURCES = \ + $(common_libcommon_a_SOURCES) +%C%_libsim_a_LIBADD = \ + %D%/debug.o \ + %D%/bits.o \ + %D%/sim-endian.o \ + %D%/os_emul.o \ + %D%/emul_generic.o \ + %D%/emul_bugapi.o \ + %D%/emul_chirp.o \ + %D%/emul_netbsd.o \ + %D%/emul_unix.o \ + %D%/registers.o \ + %D%/vm.o \ + %D%/corefile.o \ + %D%/model.o \ + %D%/spreg.o \ + %D%/cpu.o \ + %D%/interrupts.o \ + %D%/events.o \ + %D%/cap.o \ + %D%/device.o \ + %D%/tree.o \ + %D%/device_table.o \ + %D%/itable.o \ + %D%/mon.o \ + %D%/icache.o \ + %D%/semantics.o \ + %D%/idecode.o \ + %D%/support.o \ + %D%/sim-fpu.o \ + %D%/psim.o \ + %D%/pk_disklabel.o \ + $(patsubst %,%D%/%,$(sim_ppc_hw_obj)) \ + %D%/options.o \ + %D%/gdb-sim.o \ + %D%/sim_calls.o + +noinst_LIBRARIES += %D%/libsim.a + +## common/sim-endian.c is matched before ppc/sim-endian.c due to the pattern +## rule below. Force the ppc version until we can unify the two properly. +%D%/sim-endian.o: $(srcdir)/%D%/sim-endian.c ; $(SIM_COMPILE) + +%D%/%.o: common/%.c ; $(SIM_COMPILE) +-@am__include@ %D%/$(DEPDIR)/*.Po + %C%_run_SOURCES = \ %D%/main.c %C%_run_LDADD = \ @@ -34,13 +81,11 @@ AM_CPPFLAGS_%C% = \ ## This makes sure common parts are available before building the arch-subdirs ## which will refer to these. -SIM_ALL_RECURSIVE_DEPS += common/libcommon.a -%D%/libsim.a: common/libcommon.a +%D%/%.o: %D%/%.c | common/libcommon.a %D%/defines.h %D%/stamp-igen %D%/hw.c %D%/hw.h $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F) noinst_PROGRAMS += %D%/run -SIM_ALL_RECURSIVE_DEPS += %D%/defines.h %D%/defines.h: %D%/stamp-defines ; @true %D%/stamp-defines: config.h Makefile $(AM_V_GEN)sed -n -e '/^#define HAVE_/s/ 1$$/",/' -e '/^#define HAVE_/s//"HAVE_/p' < config.h > %D%/defines.hin @@ -120,7 +165,6 @@ BUILT_SOURCES += \ $(%C%_BUILT_SRC_FROM_IGEN) \ %D%/stamp-igen -SIM_ALL_RECURSIVE_DEPS += %D%/stamp-igen $(%C%_BUILT_SRC_FROM_IGEN): %D%/stamp-igen %C%_IGEN_OPCODE_RULES = %D%/@sim_ppc_opcode@ @@ -224,7 +268,6 @@ BUILT_SOURCES += \ %D%/hw.c \ %D%/hw.h \ %D%/stamp-hw -SIM_ALL_RECURSIVE_DEPS += %D%/stamp-hw %D%/hw.c %D%/hw.h: %D%/stamp-igen ## Real packages @@ -249,7 +292,6 @@ $(srcdir)/%D%/pk.h: @MAINT@ %D%/stamp-pk ; @true $(AM_V_at)touch $@ %C%_BUILD_OUTPUTS += %D%/stamp-pk -SIM_ALL_RECURSIVE_DEPS += %D%/stamp-pk %C%docdir = $(docdir)/%C% %C%doc_DATA = %D%/BUGS %D%/INSTALL %D%/README %D%/RUN -- 2.43.0