From patchwork Mon Jun 23 02:23: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: 4397581 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 A336C9F26E for ; Mon, 23 Jun 2014 02:24:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CE5BC2022A for ; Mon, 23 Jun 2014 02:24:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A372B20114 for ; Mon, 23 Jun 2014 02:24:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752040AbaFWCYH (ORCPT ); Sun, 22 Jun 2014 22:24:07 -0400 Received: from ny.voidptr.de ([5.45.110.253]:42542 "EHLO ny.voidptr.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752015AbaFWCYE (ORCPT ); Sun, 22 Jun 2014 22:24:04 -0400 Received: from beta.passau.voidptr.de (188-192-82-106-dynip.superkabel.de [188.192.82.106]) by ny.voidptr.de (Postfix) with ESMTPSA id 40F6F5AFCE; Mon, 23 Jun 2014 04:24:01 +0200 (CEST) Received: (nullmailer pid 3575 invoked by uid 1000); Mon, 23 Jun 2014 02:24:00 -0000 From: Nils Steinger To: linux-btrfs@vger.kernel.org Cc: Nils Steinger Subject: [PATCH v2] btrfs-progs: Add uninstall targets to Makefiles. Date: Mon, 23 Jun 2014 04:23:48 +0200 Message-Id: <1403490228-3513-1-git-send-email-git@n-st.de> X-Mailer: git-send-email 1.9.1 In-Reply-To: <53A78988.7050602@jp.fujitsu.com> References: <53A78988.7050602@jp.fujitsu.com> 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, T_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 Reviewed-by: Satoru Takeuchi --- v2: As Satoru Takeuchi pointed out, I forgot to remove $(libs) in the main Makefile. Documentation/Makefile | 4 ++++ Makefile | 9 +++++++++ 2 files changed, 13 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..fe6a2f8 100644 --- a/Makefile +++ b/Makefile @@ -257,6 +257,15 @@ $(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) + rmdir -p --ignore-fail-on-non-empty $(DESTDIR)$(libdir) + cd $(DESTDIR)$(bindir); rm -f btrfsck fsck.btrfs $(progs) + rmdir -p --ignore-fail-on-non-empty $(DESTDIR)$(bindir) + ifneq ($(MAKECMDGOALS),clean) -include $(objects:.o=.o.d) $(cmd-objects:.o=.o.d) $(subst .btrfs,, $(filter-out btrfsck.o.d, $(progs:=.o.d))) endif