on master help sign in
Make it possible to build tests in-place.

--HG-- extra : convert_revision : c7a67e6f94fd89285a3ff2ba1a6cf05f6e6cedd4

commit71a62d9d364c2df64775f101b413558e4fc9be04 authorBryan O'Sullivan <bos@serpentine.com> dateFri 14 Aug 2009, 20:46 (17 years ago) parentec865ba
1 file changed+19−15
tests/Makefile+19−15
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,')
28
3−.PHONY: Properties
4−Properties: Properties.hs QuickCheckUtils.hs
5− ghc --make -fforce-recomp Properties
9+all: qc
610
7−bin/Bench: dist/setup-config *.hs
8− ./Setup build
9− ./Setup install
11+lib: $(lib)
1012
11−Setup: Setup.lhs
12− ghc -O --make $@
13− -rm -f $@.o $@.hi
13+$(lib): $(lib-srcs:%=../%)
14+ cd .. && runghc Setup configure --user --prefix=$(HOME)
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 $@ $<
1422
1523.PHONY: testdata
1624testdata: text-testdata.tar.bz2
@@ -18,9 +26,5 @@ testdata: text-testdata.tar.bz2
1826text-testdata.tar.bz2:
1927 curl -O http://projects.haskell.org/text/text-testdata.tar.bz2
2028
21−dist/setup-config: text-tests.cabal Setup
22− ./Setup configure --user --prefix=`pwd`
23−
2429clean:
25− -rm -f *.o *.hi Setup
26− -rm -rf dist bin
30+ -rm -f *.o *.hi qc