DESTDIR=
pfx=/usr/local
flavour=$(shell if stack --version >/dev/null 2>&1; then echo stack; elif cabal --version >/dev/null 2>&1; then echo cabal; else echo simple; fi)
+parallel=$(filter -j%, $(MAKEFLAGS))
build: build-$(flavour)
install: install-$(flavour) install-common
build-stack:
stack setup
- stack build --pedantic
+ stack build
install-stack: build-stack
install -d -m755 $(DESTDIR)$(pfx)/bin
cabal update
cabal install --only-dependencies --enable-tests $(CONSTRAINTS)
cabal configure --enable-tests
- cabal build
+ cabal build $(parallel)
cabal test
install-cabal: build-cabal
build-simple: Setup
./Setup configure --prefix=$(pfx)
- ./Setup build
+ ./Setup build $(parallel)
install-simple: build-simple
./Setup copy --destdir=$(DESTDIR)
all: $(subst .hs,,$(wildcard *.hs))
%: %.hs
- ghc -Wall -threaded --make $<
+ ghc -Wall -threaded $<
clean:
override_dh_auto_build:
mkdir -p $(CURDIR)/.home
- LC_ALL=C.UTF-8 LANG=C.UTF-8 HOME=$(CURDIR)/.home dh_auto_build -- pfx=/usr
+ LC_ALL=C.UTF-8 LANG=C.UTF-8 HOME=$(CURDIR)/.home dh_auto_build --parallel -- pfx=/usr
override_dh_auto_install:
mkdir -p $(CURDIR)/.home
- LC_ALL=C.UTF-8 LANG=C.UTF-8 HOME=$(CURDIR)/.home dh_auto_install -- pfx=/usr
+ LC_ALL=C.UTF-8 LANG=C.UTF-8 HOME=$(CURDIR)/.home dh_auto_install --parallel -- pfx=/usr