CABAL_FILE = twitprox.cabal
GHC        = ghc
EXECUTABLE = ./dist/build/twitprox/twitprox

build: dist/setup-config Setup
	./Setup build

run: build
	$(EXECUTABLE)

dist/setup-config: $(CABAL_FILE) Setup
	./Setup configure

Setup: Setup.lhs
	$(GHC) --make Setup

clean:
	rm -rf dist Setup Setup.o Setup.hi
	find . -name '*~' -exec rm -f {} \;

install: build
	sudo ./Setup install

test: build
	./Setup test

sdist: Setup
	./Setup sdist

.PHONY: build run clean install doc sdist
