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 PREFIX=/usr/local
BINDIR=$(PREFIX)/bin BINDIR=$(PREFIX)/bin
SRCS=$(shell find . -name '*.go' -or -name '*.mod')
all: build/stepd build/step all: build/stepd build/step
build/%: build/%: $(SRCS)
mkdir -p build
$(GO) build $(GOFLAGS) -o $@ ./cmd/$(shell basename $@) $(GO) build $(GOFLAGS) -o $@ ./cmd/$(shell basename $@)
check: check:
@ -17,6 +20,7 @@ check:
clean: clean:
rm -f build/* rm -f build/*
rmdir build
install: install:
install -Dm755 $(BUILDDIR)/stepd $(DESTDIR)$(BINDIR)/stepd install -Dm755 $(BUILDDIR)/stepd $(DESTDIR)$(BINDIR)/stepd