From patchwork Thu Aug 14 19:36:48 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nils Steinger X-Patchwork-Id: 4725261 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D215FC0338 for ; Thu, 14 Aug 2014 19:36:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9CA97201DE for ; Thu, 14 Aug 2014 19:36:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B6711201ED for ; Thu, 14 Aug 2014 19:36:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753978AbaHNTgy (ORCPT ); Thu, 14 Aug 2014 15:36:54 -0400 Received: from ny.voidptr.de ([5.45.110.253]:35173 "EHLO ny.voidptr.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753817AbaHNTgx (ORCPT ); Thu, 14 Aug 2014 15:36:53 -0400 Received: from beta.passau.voidptr.de (188-192-74-226-dynip.superkabel.de [188.192.74.226]) by ny.voidptr.de (Postfix) with ESMTPSA id 8653884376A; Thu, 14 Aug 2014 21:36:52 +0200 (CEST) Received: (nullmailer pid 13455 invoked by uid 1000); Thu, 14 Aug 2014 19:36:52 -0000 From: Nils Steinger To: linux-btrfs@vger.kernel.org Cc: Nils Steinger , David Sterba Subject: [PATCH v3] btrfs-progs: Add uninstall targets to Makefiles. Date: Thu, 14 Aug 2014 21:36:48 +0200 Message-Id: <1408045008-13399-2-git-send-email-nst@voidptr.de> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1408045008-13399-1-git-send-email-nst@voidptr.de> References: <1408045008-13399-1-git-send-email-nst@voidptr.de> In-Reply-To: <20140627123201.GB1553@twin.jikos.cz> Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Nils Steinger --- v2: As Satoru Takeuchi pointed out, I forgot to remove $(libs) in the main Makefile. v3: David Sterba suggested not to remove the $(bindir) and $(libdir), since those might be needed by other programs, even if the btrfs uninstallation leaves them empty. Documentation/Makefile | 4 ++++ Makefile | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/Documentation/Makefile b/Documentation/Makefile index 45299bb..5c9780b 100644 --- a/Documentation/Makefile +++ b/Documentation/Makefile @@ -76,6 +76,10 @@ install-man: man $(INSTALL) -m 644 $(GZ_MAN8) $(DESTDIR)$(man8dir) $(LNS) btrfs-check.8.gz $(DESTDIR)$(man8dir) +uninstall: + cd $(DESTDIR)$(man8dir); rm -f btrfs-check.8.gz $(GZ_MAN8) + rmdir -p --ignore-fail-on-non-empty $(DESTDIR)$(man8dir) + clean: $(RM) *.xml *.xml+ *.8 *.8.gz diff --git a/Makefile b/Makefile index 76565e8..de5bd9e 100644 --- a/Makefile +++ b/Makefile @@ -257,6 +257,13 @@ $(INSTALLDIRS): @echo "Making install in $(patsubst install-%,%,$@)" $(Q)$(MAKE) $(MAKEOPTS) -C $(patsubst install-%,%,$@) install +uninstall: + $(Q)$(MAKE) $(MAKEOPTS) -C Documentation uninstall + cd $(DESTDIR)$(incdir); rm -f $(headers) + rmdir -p --ignore-fail-on-non-empty $(DESTDIR)$(incdir) + cd $(DESTDIR)$(libdir); rm -f $(lib_links) $(libs) + cd $(DESTDIR)$(bindir); rm -f btrfsck fsck.btrfs $(progs) + ifneq ($(MAKECMDGOALS),clean) -include $(objects:.o=.o.d) $(cmd-objects:.o=.o.d) $(subst .btrfs,, $(filter-out btrfsck.o.d, $(progs:=.o.d))) endif