Makefile: Don't encode bindir in the tar archive

Prior to this commit we go build -o bin/foo, archive it, and
expand the archive, leaving the resulting artifact in bin.

This doesn't allow us to easily change the bin directory, or
move parts of the makefile around to make things more modular.

This commit changes the behaviour to:
go build -o foo, archive it, expand to `bin`

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
This commit is contained in:
Dave Tucker
2021-05-26 09:57:58 +01:00
parent f4c4ab1c8c
commit 452910c625
2 changed files with 4 additions and 4 deletions

View File

@@ -26,12 +26,12 @@ all: default
LINUXKIT_DEPS=$(wildcard *.go) $(wildcard */*.go) Makefile
$(LINUXKIT): tmp_linuxkit_bin.tar | bin
tar xf $<
tar -C $(dir $(LINUXKIT)) -xf $<
rm $<
touch $@
tmp_linuxkit_bin.tar: $(LINUXKIT_DEPS)
tar cf - -C . . | docker run --rm --net=none --log-driver=none -i $(CROSS) $(GO_COMPILE) --package github.com/linuxkit/linuxkit/src/cmd/linuxkit --ldflags "-X github.com/linuxkit/linuxkit/src/cmd/linuxkit/version.GitCommit=$(GIT_COMMIT) -X github.com/linuxkit/linuxkit/src/cmd/linuxkit/version.Version=$(VERSION)" -o bin/linuxkit > $@
tar cf - -C . . | docker run --rm --net=none --log-driver=none -i $(CROSS) $(GO_COMPILE) --package github.com/linuxkit/linuxkit/src/cmd/linuxkit --ldflags "-X github.com/linuxkit/linuxkit/src/cmd/linuxkit/version.GitCommit=$(GIT_COMMIT) -X github.com/linuxkit/linuxkit/src/cmd/linuxkit/version.Version=$(VERSION)" -o $(notdir $(LINUXKIT)) > $@
.PHONY: test-cross
test-cross: