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 AD2223858C2B for ; Sat, 5 Nov 2022 08:27:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org AD2223858C2B 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 C684534128D; Sat, 5 Nov 2022 08:27:31 +0000 (UTC) From: Mike Frysinger To: gdb-patches@sourceware.org Subject: [PATCH 2/3] sim: build: add uninstall support Date: Sat, 5 Nov 2022 15:27:26 +0700 Message-Id: <20221105082727.32094-2-vapier@gentoo.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221105082727.32094-1-vapier@gentoo.org> References: <20221105082727.32094-1-vapier@gentoo.org> 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,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: This never worked before, but adding it to the common top-level dir is pretty easy to do now that we're unified. --- sim/Makefile.am | 8 +++++ sim/Makefile.in | 66 ++++++++++++++++++++++----------------- sim/common/Make-common.in | 1 + sim/erc32/local.mk | 4 +++ sim/ppc/Makefile.in | 1 + 5 files changed, 52 insertions(+), 28 deletions(-) diff --git a/sim/Makefile.am b/sim/Makefile.am index 523d8f8dec96..4e4068a3539f 100644 --- a/sim/Makefile.am +++ b/sim/Makefile.am @@ -63,6 +63,8 @@ SIM_ALL_RECURSIVE_DEPS = SIM_INSTALL_DATA_LOCAL_DEPS = ## Deps to add to the install-exec-local target. SIM_INSTALL_EXEC_LOCAL_DEPS = +## Deps to add to the uninstall-local target. +SIM_UNINSTALL_LOCAL_DEPS = # Generate target constants for newlib/libgloss from its source tree. # This file is shipped with distributions so we build in the source dir. @@ -165,3 +167,9 @@ install-exec-local: installdirs $(SIM_INSTALL_EXEC_LOCAL_DEPS) $(INSTALL_PROGRAM) $$d/run$(EXEEXT) $(DESTDIR)$(bindir)/$$n$(EXEEXT) || exit 1; \ fi; \ done + +uninstall-local: $(SIM_UNINSTALL_LOCAL_DEPS) + rm -f $(DESTDIR)$(bindir)/run $(DESTDIR)$(libdir)/libsim.a + for d in $(SUBDIRS); do \ + rm -f $(DESTDIR)$(bindir)/run-$$d $(DESTDIR)$(libdir)/libsim-$$d.a; \ + done diff --git a/sim/common/Make-common.in b/sim/common/Make-common.in index bd50f052dae9..290fa2c171d9 100644 --- a/sim/common/Make-common.in +++ b/sim/common/Make-common.in @@ -322,6 +322,7 @@ stamp-modules: Makefile $(SIM_OBJS:.o=.c) install: installdirs: +uninstall: check: diff --git a/sim/erc32/local.mk b/sim/erc32/local.mk index 3b858a671d80..36baeb96614c 100644 --- a/sim/erc32/local.mk +++ b/sim/erc32/local.mk @@ -23,3 +23,7 @@ sim-%D-install-exec-local: installdirs $(AM_V_at)$(MKDIR_P) $(DESTDIR)$(bindir) n=`echo sis | sed '$(program_transform_name)'`; \ $(INSTALL_PROGRAM) %D%/sis$(EXEEXT) $(DESTDIR)$(bindir)/$$n$(EXEEXT) + +SIM_UNINSTALL_LOCAL_DEPS += sim-%D%-uninstall-local +sim-%D%-uninstall-local: + rm -f $(DESTDIR)$(bindir)/sis diff --git a/sim/ppc/Makefile.in b/sim/ppc/Makefile.in index 4fe4fd9597c0..d7b9df0819f4 100644 --- a/sim/ppc/Makefile.in +++ b/sim/ppc/Makefile.in @@ -845,3 +845,4 @@ install-pdf: install: installdirs: +uninstall: -- 2.38.1