Improve Makefile

This commit is contained in:
Sasha Koshka 2024-12-11 02:32:08 -05:00
parent cbc31b64a8
commit b865dd251c

View File

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