Build annotator to bin directory

This commit is contained in:
Alexander Kobjolke 2022-03-04 14:03:49 +01:00
parent 9871b1280b
commit 6dff1caf5d
2 changed files with 8 additions and 8 deletions

View file

@ -3,30 +3,30 @@ default: all
all: build all: build
build: builddir build/annotator build: builddir build/bin/annotator
GHCFLAGS = -iapp -isrc -Wall -outputdir build GHCFLAGS = -iapp -isrc -Wall -O2 -outputdir build/.obj
DESTDIR = ~/.local DESTDIR = ~/.local
BINDIR = ${DESTDIR}/bin BINDIR = ${DESTDIR}/bin
builddir: builddir:
mkdir -p build mkdir -p build/bin build/.obj
build/annotator: app/Main.hs src/*.hs build/bin/annotator: app/Main.hs src/*.hs
ghc --make $(GHCFLAGS) $< -o $@ ghc --make $(GHCFLAGS) $< -o $@
watch: watch:
@git ls-files src app Makefile | entr make -s build install @git ls-files src app Makefile | entr make -s build install
clean: clean:
@rm -rf build
@find . -name "*.hi" -delete @find . -name "*.hi" -delete
@find . -name "*.fix" -delete @find . -name "*.fix" -delete
distclean: clean distclean: clean
@rm -rf build
@rm -rf dist @rm -rf dist
install: build/annotator install: build/bin/annotator
@install -D -t ${BINDIR} $< @install -D -t ${BINDIR} $<
release: script/make-release release: script/make-release

View file

@ -4,12 +4,12 @@
set -e set -e
base=$(readlink -f $(dirname "$0")/..) base=$(readlink -f $(dirname "$0")/..)
make -C "${base}" build >/dev/null make -C "${base}" build >/dev/null
version=$(${base}/build/annotator --short-version) version=$(${base}/build/bin/annotator --short-version)
release=annotator-${version} release=annotator-${version}
out=${base}/dist/${release} out=${base}/dist/${release}
pkg=${out}.tar.gz pkg=${out}.tar.gz
make -C "${base}" install DESTDIR=${out} >/dev/null make -C "${base}" install DESTDIR=${out} >/dev/null
pushd ${base}/dist >/dev/null pushd ${base}/dist >/dev/null
tar cfz ${pkg}.tar.gz ${release} tar cfz ${pkg} ${release}
popd >/dev/null popd >/dev/null
echo created release for version ${version}: ${pkg} echo created release for version ${version}: ${pkg}