diff options
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 43 |
1 files changed, 19 insertions, 24 deletions
@@ -1,31 +1,26 @@ .POSIX: -PREFIX = $(HOME)/.local -INSTALL = install - -OS ?= $(shell uname -s) -ifeq ($(OS),Darwin) - CONTAINER = container -else - CONTAINER = podman -endif - -IMAGE = ghcr.io/nlordell/dbx:latest +GO = go +GOFLAGS = +SCDOC = scdoc .PHONY: all -all: - @echo "usage: make [install|container]" - -.PHONY: install -install: dbx - $(INSTALL) -d $(PREFIX)/bin - $(INSTALL) -m 755 dbx $(PREFIX)/bin/dbx +all: build man ; -.PHONY: container -container: container/Containerfile container/init - $(CONTAINER) build --tag $(IMAGE) container +.PHONY: build +build: + @ mkdir -p build/bin + @ $(GO) build $(GOFLAGS) -o build/bin/dbx ./cmd/dbx .PHONY: check -check: dbx container/init container/stop - shellcheck $^ - shfmt -d $^ +check: + @ $(GO) fmt ./... + @ $(GO) vet -fix ./... + @ $(GO) test ./... + +.PHONY: man +man: build/man/man1/dbx.1 ; + +build/man/man1/dbx.1: man/dbx.1.scd + @ mkdir -p $(@D) + @ $(SCDOC) >$@ <man/dbx.1.scd |
