From patchwork Fri Jul 25 13:41:57 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nils Steinger X-Patchwork-Id: 4623081 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 5C2699F36A for ; Fri, 25 Jul 2014 13:42:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 733D320204 for ; Fri, 25 Jul 2014 13:42:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 09689201FE for ; Fri, 25 Jul 2014 13:42:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752336AbaGYNmN (ORCPT ); Fri, 25 Jul 2014 09:42:13 -0400 Received: from ny.voidptr.de ([5.45.110.253]:58812 "EHLO ny.voidptr.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752142AbaGYNmM (ORCPT ); Fri, 25 Jul 2014 09:42:12 -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 5827480D336; Fri, 25 Jul 2014 15:42:10 +0200 (CEST) Received: (nullmailer pid 10260 invoked by uid 1000); Fri, 25 Jul 2014 13:42:09 -0000 From: "n.st" To: linux-btrfs@vger.kernel.org Cc: Nils Steinger , David Sterba Subject: [PATCH v3] btrfs-progs: Add uninstall targets to Makefiles. Date: Fri, 25 Jul 2014 15:41:57 +0200 Message-Id: <1406295717-10193-1-git-send-email-git@n-st.de> X-Mailer: git-send-email 1.9.1 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=-6.9 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 From: Nils Steinger 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