39 lines
857 B
Makefile
39 lines
857 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:
|
|
@-hlint -g --cc > $(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
|
|
@$<
|