annotator/Makefile
2023-01-05 13:41:18 +00:00

39 lines
910 B
Makefile

.PHONY: default all install watch clean build release distclean lint
default: all
all: build
build: builddir build/bin/annotator
GHCFLAGS = -iapp -isrc -Wall -O2 -outputdir build/.obj
BUILDDIR = build
DESTDIR = ~/.local
BINDIR = ${DESTDIR}/bin
DOCDIR = ${DESTDIR}/share/doc/annotator
builddir:
mkdir -p $(BUILDDIR)/bin $(BUILDDIR)/.obj $(BUILDDIR)/ci $(BUILDDIR)/dist
$(BUILDDIR)/bin/annotator: app/Main.hs src/*.hs
ghc --make $(GHCFLAGS) $< -o $@
watch:
@git ls-files src app Makefile | entr make -s build install
lint: builddir
hlint lint --git --cc --no-exit-code | tr -d '\0' | jq -s . > $(BUILDDIR)/ci/hlint.report.json
clean:
@rm -rf $(BUILDDIR)
@find . -name "*.hi" -delete
@find . -name "*.fix" -delete
distclean: clean
@rm -rf dist
install: $(BUILDDIR)/bin/annotator
@install -m 0755 -D -t ${BINDIR} $<
@install -m 0644 -D -t ${DOCDIR} README.md
release: script/make-release
@$<