make: revert switch to 'go install'

go install acts incredibly weirdly and rarely does what you want, not to
mention that it's just bad for distribution build setups. Switch back to
go build, which works properly and doesn't have half as many issues.

Fixes: 6c9628cdb1 ("Build and install from GOPATH")
Signed-off-by: Aleksa Sarai <asarai@suse.de>
This commit is contained in:
Aleksa Sarai 2017-01-25 00:07:05 +11:00
parent 6d76ea2fa1
commit 0d7147ff5c
No known key found for this signature in database
GPG key ID: 9E18AA267DDB8DB4
3 changed files with 12 additions and 10 deletions

View file

@ -13,8 +13,6 @@ ETCDIR ?= ${DESTDIR}/etc
ETCDIR_OCID ?= ${ETCDIR}/ocid
BUILDTAGS := selinux seccomp $(shell hack/btrfs_tag.sh) $(shell hack/libdm_tag.sh)
BASHINSTALLDIR=${PREFIX}/share/bash-completion/completions
GOBINDIR := $(word 1,$(subst :, ,$(GOPATH)))
PATH := $(GOBINDIR)/bin:$(PATH)
all: binaries ocid.conf docs
@ -60,15 +58,15 @@ checkseccomp: check-gopath
$(MAKE) -C test/$@
ocid: check-gopath
$(GO) install \
$(GO) build -o $@ \
-tags "$(BUILDTAGS)" \
$(PROJECT)/cmd/ocid
ocic: check-gopath
$(GO) install $(PROJECT)/cmd/ocic
$(GO) build -o $@ $(PROJECT)/cmd/ocic
kpod: check-gopath
$(GO) install $(PROJECT)/cmd/kpod
$(GO) build -o $@ $(PROJECT)/cmd/kpod
ocid.conf: ocid
ocid --config="" config --default > ocid.conf
@ -78,6 +76,7 @@ clean:
rm -fr test/testdata/redis-image
find . -name \*~ -delete
find . -name \#\* -delete
rm -f ocic ocid kpod
make -C conmon clean
make -C pause clean
make -C test/bin2img clean
@ -113,9 +112,9 @@ docs/%.8: docs/%.8.md check-gopath
docs: $(MANPAGES)
install: check-gopath
install -D -m 755 $(GOBINDIR)/bin/ocid $(BINDIR)/ocid
install -D -m 755 $(GOBINDIR)/bin/ocic $(BINDIR)/ocic
install -D -m 755 $(GOBINDIR)/bin/kpod $(BINDIR)/kpod
install -D -m 755 ocid $(BINDIR)/ocid
install -D -m 755 ocic $(BINDIR)/ocic
install -D -m 755 kpod $(BINDIR)/kpod
install -D -m 755 conmon/conmon $(LIBEXECDIR)/ocid/conmon
install -D -m 755 pause/pause $(LIBEXECDIR)/ocid/pause
install -d -m 755 $(MANDIR)/man1