summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorDaniel Silverstone <daniel.silverstone@codethink.co.uk>2012-07-04 10:12:30 +0100
committerDaniel Silverstone <daniel.silverstone@codethink.co.uk>2012-07-09 14:04:04 +0100
commitaab0fcb8ae7386475598fd2bef887cf0f9f3b65a (patch)
tree0e870806daf521177b370ce917b4680e10f10c02 /Makefile
parent47c9a2a0db829711d4bd6959122400fe85548b83 (diff)
downloadbtrfs-progs-aab0fcb8ae7386475598fd2bef887cf0f9f3b65a.tar.gz
MAKEFILE: Fix parallelism capability
Fix the parallelism capability of the Makefile by ensuring that version.h is built appropriately. Without this change, version.sh is run in parallel with compiles which can fail as a result.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile20
1 files changed, 18 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 834be47..69aeb86 100644
--- a/Makefile
+++ b/Makefile
@@ -30,10 +30,24 @@ endif
$(check) $<
$(CC) $(DEPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c $<
+MAKE:=$(MAKE) --no-print-directory
-all: version $(progs) manpages
+ifeq ($(SUB),)
-version:
+.DEFAULT_GOAL := all
+
+clean:
+ @$(MAKE) SUB=1 $@
+
+%:
+ @$(MAKE) SUB=1 version
+ @$(MAKE) SUB=1 $@
+
+else
+
+all: $(progs) manpages
+
+version: version.sh
bash version.sh
btrfs: $(objects) btrfs.o btrfs_cmds.o scrub.o
@@ -114,3 +128,5 @@ install: $(progs) install-man
if [ -e btrfs-convert ]; then $(INSTALL) btrfs-convert $(DESTDIR)$(bindir); fi
-include .*.d
+
+endif