From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) by sourceware.org (Postfix) with ESMTP id 9980F385842A for ; Tue, 2 Jan 2024 08:25:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9980F385842A 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 9980F385842A 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=1704183917; cv=none; b=K2MnQ77va83NzYWs8T7/k+/DOYg5B09EKntJQO14R1uStU6ubWD/NjiL2bHCnEffk8rYOjjLiuZCq5lAe71WUWAU8KM47cFAyYjmSoqhKTa2Ejsrzsks73ZOg4X/9FuvhJU0Q4NA2Dx4xNztPaONmBHIHzzr1iHfgN/02k8rpfc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704183917; c=relaxed/simple; bh=PrZq7M95fxzqwxQ/u1i5fgj2vMlY1RhmjgRmdSnRmyQ=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=NV0d5KQSpDe2YA953Zv/pYAj/xOtG+p9Hy3+W4UbB26FpSvXnH2mkPTaAoKQjSgMEzV0v4uFVr9jN2y6VJ8Bm4UFySjwHuKRPPddmig9KwTS3qCSko499fKntyxPxiT8Cao+4l1UrYFo2UIdDsXsFzizKop7t9VE+0YlcMAtuRM= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by smtp.gentoo.org (Postfix, from userid 559) id 1B8A1340BCD; Tue, 2 Jan 2024 08:25:15 +0000 (UTC) From: Mike Frysinger To: gdb-patches@sourceware.org Subject: [PATCH/submitted 2/3] sim: ppc: hoist hw.[ch] creation to top-level Date: Tue, 2 Jan 2024 02:25:07 -0500 Message-ID: <20240102072508.10504-2-vapier@gentoo.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240102072508.10504-1-vapier@gentoo.org> References: <20240102072508.10504-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: --- sim/Makefile.in | 52 ++++++++++++++++++++++++++++++++++----------- sim/ppc/Makefile.in | 37 ++------------------------------ sim/ppc/local.mk | 43 +++++++++++++++++++++++++++++++++++++ 3 files changed, 85 insertions(+), 47 deletions(-) diff --git a/sim/ppc/Makefile.in b/sim/ppc/Makefile.in index 5717ddc885ed..ed3185f399d4 100644 --- a/sim/ppc/Makefile.in +++ b/sim/ppc/Makefile.in @@ -362,8 +362,7 @@ INLINE = \ inline.c BUILT_SRC_WO_CONFIG = \ - pk.h \ - hw.h hw.c + pk.h BUILT_SRC = \ $(BUILT_SRC_WO_CONFIG) @@ -456,7 +455,7 @@ PACKAGE_SRC = pk_disklabel.c PACKAGE_OBJ = $(PACKAGE_SRC:.c=.o) -$(TARGETLIB): tmp-hw defines.h $(LIB_OBJ) $(GDB_OBJ) +$(TARGETLIB): defines.h $(LIB_OBJ) $(GDB_OBJ) $(ECHO_AR) $(AR) $(AR_FLAGS) $(TARGETLIB) $(LIB_OBJ) $(GDB_OBJ) $(ECHO_RANLIB) $(RANLIB) $(TARGETLIB) @@ -529,38 +528,6 @@ sim-fpu.o: $(srcdir)/../common/sim-fpu.c options.o: options.c $(CPU_H) $(OPTIONS_H) $(DEFINES_H) $(BASICS_H) $(IDECODE_H) $(INLINE) $(LIB_SRC) $(BUILT_SRC) ../config.status Makefile $(ECHO_CC) $(CC) -c $(STD_CFLAGS) '-DOPCODE_RULES="@sim_ppc_opcode@"' '-DIGEN_FLAGS="$(ppc_IGEN_FLAGS)"' $(srcdir)/options.c -# real hardware -hw.c hw.h: tmp-hw; @true -tmp-hw: Makefile $(HW_SRC) $(srcroot)/move-if-change - $(ECHO_GEN)# The first for loop is to remove duplicates. - $(SILENCE) f=""; \ - for i in $(HW_SRC) ; do \ - case " $$f " in \ - *" $$i "*) ;; \ - *) f="$$f $$i" ;; \ - esac ; \ - done ; \ - for hw in $$f ; do echo $$hw ; done \ - | sed -e 's/^.*\(hw_.*\)\.c/\1/' \ - -e 's/^/extern const device_descriptor /' \ - -e 's/$$/_device_descriptor\[\];/' \ - > tmp-hw.h - $(SILENCE) f=""; \ - for i in $(HW_SRC) ; do \ - case " $$f " in \ - *" $$i "*) ;; \ - *) f="$$f $$i" ;; \ - esac ; \ - done ; \ - for hw in $$f ; do echo $$hw ; done \ - | sed -e 's/^.*\(hw_.*\)\.c/\1/' \ - -e 's/^/ /' \ - -e 's/$$/_device_descriptor,/' \ - > tmp-hw.c - $(SILENCE) $(SHELL) $(srcroot)/move-if-change tmp-hw.h hw.h - $(SILENCE) $(SHELL) $(srcroot)/move-if-change tmp-hw.c hw.c - $(SILENCE) touch $@ - hw_cpu.o: hw_cpu.c $(DEVICE_TABLE_H) $(HW_CPU_H) $(INTERRUPTS_H) $(CPU_H) hw_com.o: hw_com.c $(DEVICE_TABLE_H) hw_core.o: hw_core.c $(DEVICE_TABLE_H) $(COREFILE_H) diff --git a/sim/ppc/local.mk b/sim/ppc/local.mk index 8b5a16567fe7..7d4ea357c30d 100644 --- a/sim/ppc/local.mk +++ b/sim/ppc/local.mk @@ -177,5 +177,48 @@ MOSTLYCLEANFILES += $(%C%_IGEN_TOOLS) %D%/libigen.a IGEN_OPCODE_RULES = @sim_ppc_opcode@ +## Real hardware. +## NB: The first for loop is to remove duplicates. +%C%_HW_SRC = $(sim_ppc_hw_src:%=%D%/%) +%D%/hw.c %D%/hw.h: %D%/stamp-hw ; @true +%D%/stamp-hw: Makefile $(%C%_HW_SRC) $(srcroot)/move-if-change + $(AM_V_GEN)\ + f=""; \ + for i in $(%C%_HW_SRC) ; do \ + case " $$f " in \ + *" $$i "*) ;; \ + *) f="$$f $$i" ;; \ + esac ; \ + done ; \ + for hw in $$f ; do echo $$hw ; done \ + | sed -e 's/^.*\(hw_.*\)\.c/\1/' \ + -e 's/^/extern const device_descriptor /' \ + -e 's/$$/_device_descriptor\[\];/' \ + > %D%/hw.hin; \ + f=""; \ + for i in $(%C%_HW_SRC) ; do \ + case " $$f " in \ + *" $$i "*) ;; \ + *) f="$$f $$i" ;; \ + esac ; \ + done ; \ + for hw in $$f ; do echo $$hw ; done \ + | sed -e 's/^.*\(hw_.*\)\.c/\1/' \ + -e 's/^/ /' \ + -e 's/$$/_device_descriptor,/' \ + > %D%/hw.cin + $(AM_V_at)$(SHELL) $(srcroot)/move-if-change %D%/hw.hin %D%/hw.h + $(AM_V_at)$(SHELL) $(srcroot)/move-if-change %D%/hw.cin %D%/hw.c + $(AM_V_at)touch $@ + +BUILT_SOURCES += \ + %D%/hw.h +%C%_BUILD_OUTPUTS += \ + %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 + %C%docdir = $(docdir)/%C% %C%doc_DATA = %D%/BUGS %D%/INSTALL %D%/README %D%/RUN -- 2.43.0