packages feed

suffixtree-0.2: Makefile

prefix := $(HOME)
_lib := lib64
ghc := ghc
ghcflags := $(shell awk -F: '/ghc-options/{print $$2}' suffixtree.cabal)

all: build tests

build: .installed-pkg-config

.installed-pkg-config: Setup config
	./Setup build

config: .setup-config

.setup-config: Setup
	./Setup configure -p --user --prefix=$(prefix) --libdir=$(prefix)/$(_lib)

doc: config
	./Setup haddock

install: build
	./Setup install

Setup: Setup.lhs
	$(ghc) -O --make $@

.PHONY: tests
tests: build
	$(MAKE) -C tests

inplace:
	$(ghc) $(ghcflags) --make Data/*.hs

sdist: Setup
	./Setup sdist

clean:
	./Setup clean
	-rm -f Setup *.hi *.o Data/*.hi Data/*.o
	-rm -rf dist