From 893593272fefaf030b32349198a3b5bd20932769 Mon Sep 17 00:00:00 2001 From: Nalin Dahyabhai Date: Tue, 31 Jan 2017 11:57:19 -0500 Subject: [PATCH] Use build tags for bin2img and copyimg Use the same build tags for bin2img and copyimg that we use for ocid, and improve detection of the case where we need to use the "libdm_no_deferred_remove" tag. Signed-off-by: Nalin Dahyabhai --- Makefile | 10 +++++----- hack/libdm_tag.sh | 3 ++- test/bin2img/Makefile | 2 +- test/copyimg/Makefile | 2 +- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index ea4a3fda..575d5e64 100644 --- a/Makefile +++ b/Makefile @@ -45,19 +45,19 @@ gofmt: @./hack/verify-gofmt.sh conmon: - make -C $@ + $(MAKE) -C $@ pause: - make -C $@ + $(MAKE) -C $@ bin2img: - make -C test/$@ + $(MAKE) -C test/$@ BUILDTAGS="$(BUILDTAGS)" copyimg: - make -C test/$@ + $(MAKE) -C test/$@ BUILDTAGS="$(BUILDTAGS)" checkseccomp: check-gopath - make -C test/$@ + $(MAKE) -C test/$@ ocid: check-gopath $(GO) install \ diff --git a/hack/libdm_tag.sh b/hack/libdm_tag.sh index 476545e3..d1f83ba1 100755 --- a/hack/libdm_tag.sh +++ b/hack/libdm_tag.sh @@ -2,10 +2,11 @@ tmpdir="$PWD/tmp.$RANDOM" mkdir -p "$tmpdir" trap 'rm -fr "$tmpdir"' EXIT -cc -c -o "$tmpdir"/libdm_tag.o -x c - > /dev/null 2> /dev/null << EOF +cc -o "$tmpdir"/libdm_tag -ldevmapper -x c - > /dev/null 2> /dev/null << EOF #include int main() { struct dm_task *task; + dm_task_deferred_remove(task); return 0; } EOF diff --git a/test/bin2img/Makefile b/test/bin2img/Makefile index 69ad14b1..67344382 100644 --- a/test/bin2img/Makefile +++ b/test/bin2img/Makefile @@ -1,5 +1,5 @@ bin2img: $(wildcard *.go) - go build -o $@ + go build -tags "$(BUILDTAGS)" -o $@ .PHONY: clean clean: diff --git a/test/copyimg/Makefile b/test/copyimg/Makefile index cb1d7f10..55f60944 100644 --- a/test/copyimg/Makefile +++ b/test/copyimg/Makefile @@ -1,5 +1,5 @@ copyimg: $(wildcard *.go) - go build -o $@ + go build -tags "$(BUILDTAGS)" -o $@ .PHONY: clean clean: