on master help sign in
Make it possible to build tests in-place.
71a62d9Bryan O'Sullivan
tests/Makefile+19−15
@@ -1,16 +1,24 @@
1−all: Properties bin/Bench
1+version := $(shell awk '/^version:/{print $$2}' ../text.cabal)
2+ghc := ghc
3+ghcflags := -O -Wall -package bytestring -package QuickCheck \
4+ -hide-package text -i../dist/build -package-name text-$(version)
5+lib := ../dist/build/libHStext-$(version).a
6+lib-srcs := $(shell grep '^ *Data' ../text.cabal | \
7+ sed -e 's,\.,/,g' -e 's,$$,.hs,')
2
8
3−.PHONY: Properties
9+all: qc
4−Properties: Properties.hs QuickCheckUtils.hs
5− ghc --make -fforce-recomp Properties
6
10
7−bin/Bench: dist/setup-config *.hs
11+lib: $(lib)
8− ./Setup build
9− ./Setup install
10
12
11−Setup: Setup.lhs
13+$(lib): $(lib-srcs:%=../%)
12− ghc -O --make $@
14+ cd .. && runghc Setup configure --user --prefix=$(HOME)
13− -rm -f $@.o $@.hi
15+ cd .. && runghc Setup build
16+
17+qc: QuickCheckUtils.o Properties.o $(lib)
18+ $(ghc) $(ghcflags) -o $@ $^
19+
20+%.o: %.hs
21+ $(ghc) $(ghcflags) -c -o $@ $<
14
22
15.PHONY: testdata
23.PHONY: testdata
16testdata: text-testdata.tar.bz2
24testdata: text-testdata.tar.bz2
@@ -18,9 +26,5 @@ testdata: text-testdata.tar.bz2
18text-testdata.tar.bz2:
26text-testdata.tar.bz2:
19 curl -O http://projects.haskell.org/text/text-testdata.tar.bz2
27 curl -O http://projects.haskell.org/text/text-testdata.tar.bz2
20
28
21−dist/setup-config: text-tests.cabal Setup
22− ./Setup configure --user --prefix=`pwd`
23−
24clean:
29clean:
25− -rm -f *.o *.hi Setup
30+ -rm -f *.o *.hi qc
26− -rm -rf dist bin