From b865dd251c8d40741066f155fa553a7296c939fd Mon Sep 17 00:00:00 2001 From: Sasha Koshka Date: Wed, 11 Dec 2024 02:32:08 -0500 Subject: [PATCH] Improve Makefile --- Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 1eed3b7..257134d 100644 --- a/Makefile +++ b/Makefile @@ -7,9 +7,12 @@ DESTDIR= PREFIX=/usr/local BINDIR=$(PREFIX)/bin +SRCS=$(shell find . -name '*.go' -or -name '*.mod') + all: build/stepd build/step -build/%: +build/%: $(SRCS) + mkdir -p build $(GO) build $(GOFLAGS) -o $@ ./cmd/$(shell basename $@) check: @@ -17,6 +20,7 @@ check: clean: rm -f build/* + rmdir build install: install -Dm755 $(BUILDDIR)/stepd $(DESTDIR)$(BINDIR)/stepd