summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2017-10-13 20:04:37 +0200
committerDavid Sterba <dsterba@suse.com>2017-10-13 20:15:58 +0200
commitaafb4593feeb4fc55644416c620d0caff2c141d5 (patch)
treee1780e1dfb5e7a963dafbf6e4e0971ac372709b8 /Makefile
parent5286ec58f54eb9c51f960ede71238938068836ed (diff)
btrfs-progs: build: add absolute path for topdir
We'll need TOPDIR to be ./ but library-test is intentionally built outside of the git repository so we need to make them separate. Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile5
1 files changed, 3 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index b1f3388..5450df3 100644
--- a/Makefile
+++ b/Makefile
@@ -59,6 +59,7 @@ DEBUG_LDFLAGS_DEFAULT =
DEBUG_LDFLAGS_INTERNAL =
DEBUG_LDFLAGS :=
+ABSTOPDIR = $(shell pwd)
TOPDIR := $(shell pwd)
# Common build flags
@@ -487,7 +488,7 @@ library-test: library-test.c $(libs_shared)
@echo " [TEST PREP] $@"$(eval TMPD=$(shell mktemp -d))
$(Q)mkdir -p $(TMPD)/include/btrfs && \
cp $(libbtrfs_headers) $(TMPD)/include/btrfs && \
- cd $(TMPD) && $(CC) -I$(TMPD)/include -o $@ $(addprefix $(TOPDIR)/,$^) -Wl,-rpath=$(TOPDIR) -lbtrfs
+ cd $(TMPD) && $(CC) -I$(TMPD)/include -o $@ $(addprefix $(ABSTOPDIR)/,$^) -Wl,-rpath=$(ABSTOPDIR) -lbtrfs
@echo " [TEST RUN] $@"
$(Q)cd $(TMPD) && ./$@
@echo " [TEST CLEAN] $@"
@@ -497,7 +498,7 @@ library-test.static: library-test.c $(libs_static)
@echo " [TEST PREP] $@"$(eval TMPD=$(shell mktemp -d))
$(Q)mkdir -p $(TMPD)/include/btrfs && \
cp $(libbtrfs_headers) $(TMPD)/include/btrfs && \
- cd $(TMPD) && $(CC) -I$(TMPD)/include -o $@ $(addprefix $(TOPDIR)/,$^) $(STATIC_LDFLAGS) $(STATIC_LIBS)
+ cd $(TMPD) && $(CC) -I$(TMPD)/include -o $@ $(addprefix $(ABSTOPDIR)/,$^) $(STATIC_LDFLAGS) $(STATIC_LIBS)
@echo " [TEST RUN] $@"
$(Q)cd $(TMPD) && ./$@
@echo " [TEST CLEAN] $@"