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 <nalin@redhat.com>
This commit is contained in:
Nalin Dahyabhai 2017-01-31 11:57:19 -05:00
parent d6ab91be27
commit 893593272f
4 changed files with 9 additions and 8 deletions

View file

@ -45,19 +45,19 @@ gofmt:
@./hack/verify-gofmt.sh @./hack/verify-gofmt.sh
conmon: conmon:
make -C $@ $(MAKE) -C $@
pause: pause:
make -C $@ $(MAKE) -C $@
bin2img: bin2img:
make -C test/$@ $(MAKE) -C test/$@ BUILDTAGS="$(BUILDTAGS)"
copyimg: copyimg:
make -C test/$@ $(MAKE) -C test/$@ BUILDTAGS="$(BUILDTAGS)"
checkseccomp: check-gopath checkseccomp: check-gopath
make -C test/$@ $(MAKE) -C test/$@
ocid: check-gopath ocid: check-gopath
$(GO) install \ $(GO) install \

View file

@ -2,10 +2,11 @@
tmpdir="$PWD/tmp.$RANDOM" tmpdir="$PWD/tmp.$RANDOM"
mkdir -p "$tmpdir" mkdir -p "$tmpdir"
trap 'rm -fr "$tmpdir"' EXIT 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 <libdevmapper.h> #include <libdevmapper.h>
int main() { int main() {
struct dm_task *task; struct dm_task *task;
dm_task_deferred_remove(task);
return 0; return 0;
} }
EOF EOF

View file

@ -1,5 +1,5 @@
bin2img: $(wildcard *.go) bin2img: $(wildcard *.go)
go build -o $@ go build -tags "$(BUILDTAGS)" -o $@
.PHONY: clean .PHONY: clean
clean: clean:

View file

@ -1,5 +1,5 @@
copyimg: $(wildcard *.go) copyimg: $(wildcard *.go)
go build -o $@ go build -tags "$(BUILDTAGS)" -o $@
.PHONY: clean .PHONY: clean
clean: clean: