@@ -1,12 +1,15 @@
11version := $(shell awk '/^version:/{print $$2}' ../text.cabal)
22ghc := ghc
3−ghcflags := -O -Wall -package bytestring -package QuickCheck \
4− -hide-package text -i../dist/build -package-name text-$(version)
3+ghc-base-flags := -O0 -package bytestring -package QuickCheck \
4+ -ignore-package text
5+ghc-flags := $(ghc-base-flags) -i../dist/build -package-name text-$(version)
6+ghc-hpc-flags := $(ghc-base-flags) -fhpc -fno-ignore-asserts -odir hpcdir \
7+ -hidir hpcdir -i..
58lib := ../dist/build/libHStext-$(version).a
69lib-srcs := $(shell grep '^ *Data' ../text.cabal | \
710 sed -e 's,\.,/,g' -e 's,$$,.hs,')
811
9−all: qc
12+all: qc qc-hpc
1013
1114lib: $(lib)
1215
@@ -14,11 +17,18 @@ $(lib): $(lib-srcs:%=../%)
1417 cd .. && runghc Setup configure --user --prefix=$(HOME)
1518 cd .. && runghc Setup build
1619
17−qc: QuickCheckUtils.o Properties.o $(lib)
18− $(ghc) $(ghcflags) -o $@ $^
20+qc: $(lib) QuickCheckUtils.o Properties.o
21+ $(ghc) $(ghc-flags) -o $@ $^
22+
23+qc-hpc: Properties.hs QuickCheckUtils.hs $(lib-srcs:%=../%)
24+ -mkdir -p hpcdir
25+ $(ghc) $(ghc-hpc-flags) -ihpcdir --make -o $@ $<
1926
2027%.o: %.hs
21− $(ghc) $(ghcflags) -c -o $@ $<
28+ $(ghc) $(ghc-flags) -c -o $@ $<
29+
30+hpcdir/%.o: %.hs
31+ $(ghc) $(ghc-hpc-flags) --make -c -o $@ $<
2232
2333.PHONY: testdata
2434testdata: text-testdata.tar.bz2
@@ -27,4 +37,4 @@ text-testdata.tar.bz2:
2737 curl -O http://projects.haskell.org/text/text-testdata.tar.bz2
2838
2939clean:
30− -rm -f *.o *.hi qc
40+ -rm -rf *.o *.hi qc qc-hpc hpcdir .hpc