diff mbox

btrfs-progs: Add a rule to build a static mkfs.btrfs

Message ID 20130311211714.GA8494@kabis (mailing list archive)
State Accepted, archived
Headers show

Commit Message

Antoine Sirinelli March 11, 2013, 9:17 p.m. UTC
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(-)

Comments

David Sterba March 12, 2013, 3:24 p.m. UTC | #1
On Mon, Mar 11, 2013 at 09:17:17PM +0000, Antoine Sirinelli wrote:
> 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.

Added to integration queue, thanks.

david
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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