From d559b58fd4cc1646bbc5c4a9c0889678ce427e90 Mon Sep 17 00:00:00 2001 From: Aleksa Sarai Date: Sat, 15 Oct 2016 15:48:18 +1100 Subject: [PATCH] makefile: fix binary dependencies OCID_LINK is necessary to correctly build all of the binaries. This syntax is a GNU Make-ism[1] that allows you to specify a path dependency without rebuilding the target if the dependency is newer than the target. [1]: https://www.gnu.org/software/make/manual/html_node/Prerequisite-Types.html Signed-off-by: Aleksa Sarai --- Makefile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 82a076c1..e142c08f 100644 --- a/Makefile +++ b/Makefile @@ -40,11 +40,12 @@ conmon: pause: make -C $@ -GO_SRC = $(shell find . -name \*.go) -ocid: $(GO_SRC) ${OCID_LINK} +GO_SRC = $(shell find . -name \*.go) + +ocid: $(GO_SRC) | ${OCID_LINK} go build --tags "$(BUILDTAGS)" -o $@ ./cmd/server/ -ocic: $(GO_SRC) +ocic: $(GO_SRC) | ${OCID_LINK} go build -o $@ ./cmd/client/ ocid.conf: ocid