Skip to contentSkip to conversation

Btrfs-progs updates to build

PATCH New David Sterba 1 participant 6 messages Nov 7, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover Btrfs-progs updates to build

We've managed to break build of snapper two times now, a new make rule 'test-build' should help us to check the build. Static build is not required to pass due to dependency on static libs that may not be widely available.

David Sterba (5):
btrfs-progs: build, add basic build test for library
btrfs-progs: build, add make target for a build test
btrfs-progs: build, gather utilities that are not built by default
btrfs-progs: build, update the clean rule
btrfs-progs: update .gitignore

 .gitignore     |  4 ++++
 Makefile       | 28 ++++++++++++++++++++----
 library-test.c | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 97 insertions(+), 4 deletions(-)
 create mode 100644 library-test.c
Signature · 1 line
1.8.4.5
#1 lore raw

PATCH 1/5 btrfs-progs: build, add basic build test for library

Basic test based on snapper code that uses the send stream API.

---
 Makefile       |  8 +++++++
 library-test.c | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 77 insertions(+)
 create mode 100644 library-test.c
Makefile +8 -0
index 203597c3e23e..99b03658a406 100644
@@ -240,6 +240,14 @@ send-test: $(objects) $(libs) send-test.o
 	@echo "    [LD]     $@"
 	$(Q)$(CC) $(CFLAGS) -o send-test $(objects) send-test.o $(LDFLAGS) $(LIBS) -lpthread
 
+library-test: $(libs_shared) library-test.o
+	@echo "    [LD]     $@"
+	$(Q)$(CC) $(CFLAGS) -o library-test library-test.o $(LDFLAGS) -lbtrfs
+
+library-test.static: $(libs_static) library-test.o
+	@echo "    [LD]     $@"
+	$(Q)$(CC) $(CFLAGS) -o library-test-static library-test.o $(LDFLAGS) $(libs_static)
+
 manpages:
 	$(Q)$(MAKE) $(MAKEOPTS) -C Documentation
 
library-test.c new file +69 -0

69 lines not on this page · raw message

Signature · 1 line
1.8.4.5
#2 lore raw

PATCH 2/5 btrfs-progs: build, add make target for a build test

In reply to David Sterba

A quick check that everything still builds.

---
 Makefile | 7 +++++++
 1 file changed, 7 insertions(+)
Makefile +7 -0
index 99b03658a406..126dc593ddfb 100644
@@ -248,6 +248,13 @@ library-test.static: $(libs_static) library-test.o
 	@echo "    [LD]     $@"
 	$(Q)$(CC) $(CFLAGS) -o library-test-static library-test.o $(LDFLAGS) $(libs_static)
 
+test-build:
+	$(MAKE) clean-all
+	$(MAKE) library-test
+	-$(MAKE) library-test.static
+	$(MAKE) -j 8 all
+	-$(MAKE) -j 8 static
+
 manpages:
 	$(Q)$(MAKE) $(MAKEOPTS) -C Documentation
 
Signature · 1 line
1.8.4.5
#3 lore raw

PATCH 3/5 btrfs-progs: build, gather utilities that are not built by default

In reply to David Sterba

Add them to build test and to clean rules.

---
 Makefile | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
Makefile +6 -1
index 126dc593ddfb..b597ad8e9b89 100644
@@ -50,6 +50,9 @@ progs = mkfs.btrfs btrfs-debug-tree btrfsck \
 	btrfs btrfs-map-logical btrfs-image btrfs-zero-log btrfs-convert \
 	btrfs-find-root btrfstune btrfs-show-super
 
+progs_extra = btrfs-corrupt-block btrfs-fragments btrfs-calc-size \
+	      btrfs-select-super
+
 progs_static = $(foreach p,$(progs),$(p).static)
 
 # external libs required by various binaries; for btrfs-foo,
@@ -254,6 +257,7 @@ test-build:
 	-$(MAKE) library-test.static
 	$(MAKE) -j 8 all
 	-$(MAKE) -j 8 static
+	$(MAKE) -j 8 $(progs_extra)
 
 manpages:
 	$(Q)$(MAKE) $(MAKEOPTS) -C Documentation
@@ -266,7 +270,8 @@ clean: $(CLEANDIRS)
 	      btrfs-zero-log btrfstune dir-test ioctl-test quick-test send-test btrfsck \
 	      btrfs.static mkfs.btrfs.static btrfs-calc-size \
 	      version.h $(check_defs) \
-	      $(libs) $(lib_links)
+	      $(libs) $(lib_links) \
+	      $(progs_extra)
 
 clean-doc:
 	@echo "Cleaning Documentation"
Signature · 1 line
1.8.4.5
#4 lore raw

PATCH 4/5 btrfs-progs: build, update the clean rule

In reply to David Sterba

Remove duplicate files, add extra progs, add library test binaries.

---
 Makefile | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
Makefile +4 -4
index b597ad8e9b89..4cae30c179b5 100644
@@ -266,12 +266,12 @@ clean-all: clean-doc clean
 
 clean: $(CLEANDIRS)
 	@echo "Cleaning"
-	$(Q)rm -f $(progs) cscope.out *.o *.o.d btrfs-convert btrfs-image btrfs-select-super \
-	      btrfs-zero-log btrfstune dir-test ioctl-test quick-test send-test btrfsck \
-	      btrfs.static mkfs.btrfs.static btrfs-calc-size \
+	$(Q)rm -f $(progs) cscope.out *.o *.o.d \
+	      dir-test ioctl-test quick-test send-test library-test library-test-static \
+	      btrfs.static mkfs.btrfs.static \
 	      version.h $(check_defs) \
 	      $(libs) $(lib_links) \
-	      $(progs_extra)
+	      $(progs_static) $(progs_extra)
 
 clean-doc:
 	@echo "Cleaning Documentation"
Signature · 1 line
1.8.4.5
#5 lore raw

PATCH 5/5 btrfs-progs: update .gitignore

In reply to David Sterba
---
 .gitignore | 4 ++++
 1 file changed, 4 insertions(+)
.gitignore +4 -0
index fc8c07a22f7f..e637b170714b 100644
@@ -1,6 +1,7 @@
 *.o
 *.static.o
 *.o.d
+tags
 .cc-defines.h
 version.h
 version
@@ -30,8 +31,11 @@ btrfs-show-super
 btrfs-zero-log
 btrfs-corrupt-block
 btrfs-select-super
+btrfs-calc-size
 btrfstune
 libbtrfs.a
 libbtrfs.so
 libbtrfs.so.0
 libbtrfs.so.0.1
+library-test
+library-test-static
Signature · 1 line
1.8.4.5