Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Antoine Sirinelli <antoine@monte-stello.com>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH] btrfs-progs: Add a rule to build a static mkfs.btrfs
Date: Mon, 11 Mar 2013 21:17:17 +0000	[thread overview]
Message-ID: <20130311211714.GA8494@kabis> (raw)

[-- Attachment #1: Type: text/plain, Size: 1641 bytes --]

Static mkfs.btrfs can be used to "bootstrap" a system from a live CD
which does not provide mkfs.btrfs.

The executable produced is named mkfs.btrfs.static and built by invoking
the "static" make rule.

Signed-off-by: Antoine Sirinelli <antoine@monte-stello.com>
---
 Makefile |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index bea8ae9..e986e51 100644
--- a/Makefile
+++ b/Makefile
@@ -72,7 +72,7 @@ all: version.h $(progs) manpages
 # NOTE: For static compiles, you need to have all the required libs
 # 	static equivalent available
 #
-static: version.h btrfs.static
+static: version.h btrfs.static mkfs.btrfs.static
 
 version.h:
 	$(Q)bash version.sh
@@ -116,6 +116,11 @@ mkfs.btrfs: $(objects) mkfs.o
 	@echo "    [LD]     $@"
 	$(Q)$(CC) $(CFLAGS) -o mkfs.btrfs $(objects) mkfs.o $(LDFLAGS) $(LIBS) -lblkid
 
+mkfs.btrfs.static: $(static_objects) mkfs.static.o
+	@echo "    [LD]     $@"
+	$(Q)$(CC) $(STATIC_CFLAGS) -o mkfs.btrfs.static mkfs.static.o \
+		$(static_objects) $(STATIC_LDFLAGS) $(STATIC_LIBS)
+
 btrfs-debug-tree: $(objects) debug-tree.o
 	@echo "    [LD]     $@"
 	$(Q)$(CC) $(CFLAGS) -o btrfs-debug-tree $(objects) debug-tree.o $(LDFLAGS) $(LIBS)
@@ -178,7 +183,7 @@ clean :
 	@echo "Cleaning"
 	$(Q)rm -f $(progs) cscope.out *.o .*.d btrfs-convert btrfs-image btrfs-select-super \
 	      btrfs-zero-log btrfstune dir-test ioctl-test quick-test send-test btrfs.static btrfsck \
-	      version.h
+	      version.h mkfs.btrfs.static
 	$(Q)$(MAKE) $(MAKEOPTS) -C man $@
 
 install: $(progs) install-man
-- 
1.7.10.4


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

             reply	other threads:[~2013-03-11 21:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-11 21:17 Antoine Sirinelli [this message]
2013-03-12 15:24 ` [PATCH] btrfs-progs: Add a rule to build a static mkfs.btrfs David Sterba

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=20130311211714.GA8494@kabis \
    --to=antoine@monte-stello.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox