All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nils Steinger <git@n-st.de>
To: linux-btrfs@vger.kernel.org
Cc: Nils Steinger <git@n-st.de>
Subject: [PATCH v2] btrfs-progs: Add uninstall targets to Makefiles.
Date: Mon, 23 Jun 2014 04:23:48 +0200	[thread overview]
Message-ID: <1403490228-3513-1-git-send-email-git@n-st.de> (raw)
In-Reply-To: <53A78988.7050602@jp.fujitsu.com>

Signed-off-by: Nils Steinger <git@n-st.de>
---

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
-- 
1.9.1


  reply	other threads:[~2014-06-23  2:24 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-20 19:48 [PATCH] btrfs-progs: Add uninstall targets to Makefiles Nils Steinger
2014-06-20 19:48 ` Nils Steinger
2014-06-23  1:57   ` Satoru Takeuchi
2014-06-23  2:23     ` Nils Steinger [this message]
2014-06-23  2:33       ` [PATCH v2] " Satoru Takeuchi
2014-06-23 15:04       ` David Sterba
2014-06-25 19:40         ` Nils Steinger
2014-06-27 12:32           ` David Sterba
2014-07-25 13:41             ` [PATCH v3] " n.st
2014-07-25 13:48             ` [PATCH v2] " Nils Steinger
2014-08-14 19:36             ` [PATCH v3] " Nils Steinger
  -- strict thread matches above, loose matches on Subject: below --
2014-08-14 19:36 Nils Steinger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1403490228-3513-1-git-send-email-git@n-st.de \
    --to=git@n-st.de \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.