@@ 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: