@@ -1,12 +1,15 @@
1version := $(shell awk '/^version:/{print $$2}' ../text.cabal)
1version := $(shell awk '/^version:/{print $$2}' ../text.cabal)
3−ghcflags := -O -Wall -package bytestring -package QuickCheck \
3+ghc-base-flags := -O0 -package bytestring -package QuickCheck \
4− -hide-package text -i../dist/build -package-name text-$(version)
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 \
5lib := ../dist/build/libHStext-$(version).a
8lib := ../dist/build/libHStext-$(version).a
6lib-srcs := $(shell grep '^ *Data' ../text.cabal | \
9lib-srcs := $(shell grep '^ *Data' ../text.cabal | \
7 sed -e 's,\.,/,g' -e 's,$$,.hs,')
10 sed -e 's,\.,/,g' -e 's,$$,.hs,')
9−all: qc
12+all: qc qc-hpc
11lib: $(lib)
14lib: $(lib)
@@ -14,11 +17,18 @@ $(lib): $(lib-srcs:%=../%)
14 cd .. && runghc Setup configure --user --prefix=$(HOME)
17 cd .. && runghc Setup configure --user --prefix=$(HOME)
15 cd .. && runghc Setup build
18 cd .. && runghc Setup build
17−qc: QuickCheckUtils.o Properties.o $(lib)
20+qc: $(lib) QuickCheckUtils.o Properties.o
18− $(ghc) $(ghcflags) -o $@ $^
21+ $(ghc) $(ghc-flags) -o $@ $^
23+qc-hpc: Properties.hs QuickCheckUtils.hs $(lib-srcs:%=../%)
25+ $(ghc) $(ghc-hpc-flags) -ihpcdir --make -o $@ $<
21− $(ghc) $(ghcflags) -c -o $@ $<
28+ $(ghc) $(ghc-flags) -c -o $@ $<
31+ $(ghc) $(ghc-hpc-flags) --make -c -o $@ $<
23.PHONY: testdata
33.PHONY: testdata
24testdata: text-testdata.tar.bz2
34testdata: text-testdata.tar.bz2
@@ -27,4 +37,4 @@ text-testdata.tar.bz2:
27 curl -O http://projects.haskell.org/text/text-testdata.tar.bz2
37 curl -O http://projects.haskell.org/text/text-testdata.tar.bz2
30− -rm -f *.o *.hi qc
40+ -rm -rf *.o *.hi qc qc-hpc hpcdir .hpc