#!/usr/bin/make -f RTS_WAYS := $(shell ghc --info | grep -e 'RTS ways') export DEB_SETUP_GHC_CONFIGURE_ARGS := $(shell test -e /usr/bin/ghci || echo --flags=-th) ifeq (,$(filter $(RTS_WAYS),thr_dyn)) export DEB_SETUP_GHC_CONFIGURE_ARGS += --flags=-threaded endif export DEB_ENABLE_TESTS = yes # haskell-aeson needs a lot of memory during compilation. # Unfortunately, this amount of memory is not available on all platforms, # and error: "virtual memory exhausted: Cannot allocate memory." could appear. # # In this case possible solution could be using ggc-min-expand. # This parameter specifies the minimum percentage by which the # garbage collector’s heap should be allowed to expand between collections. # Tuning this may improve compilation speed; it has no effect on code generation. # # http://hostingfu.com/article/compiling-with-gcc-on-low-memory-vps # -- Dejan Latinovic ifneq (,$(filter $(DEB_BUILD_ARCH),mips mipsel)) export DEB_SETUP_GHC_CONFIGURE_ARGS += --ghc-options="-optc--param -optcggc-min-expand=10" endif # Disable tests on powerpc due to memory constraints ifneq (,$(filter $(DEB_BUILD_ARCH),powerpc)) export DEB_ENABLE_TESTS = no endif %: dh $@