From 888b239d18a1a11f6aa632d6b22694f61c62d821 Mon Sep 17 00:00:00 2001 From: Sig Lange Date: Thu, 25 Feb 2021 11:29:44 -0800 Subject: [PATCH] add makefile --- Makefile | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..0e363ba --- /dev/null +++ b/Makefile @@ -0,0 +1,28 @@ +.PHONY: install + +TOPDIR = $(shell pwd) + +export GOWORKSPACE := $(shell pwd) +export GOBIN := $(GOWORKSPACE)/bin +export GO111MODULE := on + +GO_BINS = +GO_BINS += runitcmd + +all: + $(MAKE) compile + +compile: + mkdir -p tmp + mkdir -p $(GOBIN) + go install github.com/... + +install: + mkdir -p $(DESTDIR)/$(INSTALL_PREFIX)/bin/ + $(MAKE) install-bins + +install-bins: $(addprefix installbin-, $(GO_BINS)) + +$(addprefix installbin-, $(GO_BINS)): + $(eval BIN=$(@:installbin-%=%)) + cp -v $(GOBIN)/$(BIN) $(DESTDIR)/$(INSTALL_PREFIX)/bin/