~nesv/govern

7fd852ee6de19f213e9ae5ba84b11f5c74618b81 — Nick Saika 1 year, 3 months ago 0d49f14
makefile: Add targets for building runners
1 files changed, 13 insertions(+), 7 deletions(-)

M GNUmakefile
M GNUmakefile => GNUmakefile +13 -7
@@ 15,23 15,29 @@ SOURCES	:= $(wildcard internal/agent/*.go) \
	$(wildcard internal/server/*.go) \
	$(wildcard internal/state/*.go)

GO	?= $(shell which go 2>/dev/null)
ifeq (${GO},"")
	$(error Cannot find go in your $$PATH)
endif

GC_FLAGS	?=
ifneq (${TAGS},"")
	GC_FLAGS += -tags="${TAGS}"
endif

GO_BUILD	:= go build ${GC_FLAGS}

all: ${TARGETS}

${DESTDIR}/bin/${NAME}: $(wildcard *.go) ${SOURCES}
	${GO} build ${GC_FLAGS} -o $@
	${GO_BUILD} -o $@

${DESTDIR}/libexec/${NAME}/runner/%: $(wildcard runners/%/*.go) $(wildcard runner/*.go)
	${GO} build ${GC_FLAGS} -o $@ ${PACKAGE}/runners/$*
	${GO_BUILD} -o $@ ${PACKAGE}/runners/$*

${DESTDIR}/libexec/${NAME}/runner/pkg: $(wildcard runners/pkg/*.go) $(wildcard runner/*.go)
	${GO_BUILD} -o $@ ${PACKAGE}/runners/pkg

${DESTDIR}/libexec/${NAME}/runner/file: $(wildcard runners/file/*.go) $(wildcard runner/*.go)
	${GO_BUILD} -o $@ ${PACKAGE}/runners/file

${DESTDIR}/libexec/${NAME}/runner/service: $(wildcard runners/service/*.go) $(wildcard runner/*.go)
	${GO_BUILD} -o $@ ${PACKAGE}/runners/file

.PHONY: clean
clean: