step/Makefile

37 lines
638 B
Makefile

.POSIX:
.SUFFIXES:
GO=go
GOFLAGS=
DESTDIR=
PREFIX=/usr/local
BINDIR=$(PREFIX)/bin
SRCS=$(shell find . -name '*.go' -or -name '*.mod')
all: build/stepd build/step
build/%: $(SRCS)
mkdir -p build
$(GO) build $(GOFLAGS) -o $@ ./cmd/$(shell basename $@)
check:
$(GO) test $(GOFLAGS) ...
clean:
rm -rf build
install:
install -Dm755 build/stepd $(DESTDIR)$(BINDIR)/stepd
install -Dm755 build/step $(DESTDIR)$(BINDIR)/step
install-openrc:
install -Dm755 openrc/stepd /etc/init.d/stepd
uninstall:
rm -f $(DESTDIR)$(BINDIR)/stepd
rm -f $(DESTDIR)$(BINDIR)/step
rm -f /etc/init.d/stepd
.PHONY: all check clean install uninstall