1 # -*- makefile-gmake -*-
5 # CONFIGURE_ARGS :: arguments to be passed to ./Setup configure
6 # default: --disable-optimization
8 # RUN_COMMAND :: command to be run for "make run"
16 SETUP_FILE ?= $(wildcard Setup.*hs)
17 CABAL_FILE ?= $(wildcard *.cabal)
19 CONFIGURE_ARGS := --disable-optimization
21 build: dist/setup-config Setup
24 ifeq ($(RUN_COMMAND),)
26 @echo "cabal-package.mk: No command to run."
27 @echo "cabal-package.mk: If you want to run something, define RUN_COMMAND variable."
30 @echo ".:.:. Let's go .:.:."
34 dist/setup-config: $(CABAL_FILE) Setup
35 ./Setup configure $(CONFIGURE_ARGS)
41 $(RM_RF) dist Setup *.o *.hi .setup-config *.buildinfo
42 $(FIND) . -name '*~' -exec rm -f {} \;
44 doc: dist/setup-config Setup
48 $(SUDO) ./Setup install
56 .PHONY: build run clean install doc sdist test