<commit_before>version := $(shell awk '/^version:/{print $$2}' ../text.cabal)
ghc := ghc
ghcflags := -O -Wall -package bytestring -package QuickCheck \
	-hide-package text -i../dist/build -package-name text-$(version)
lib := ../dist/build/libHStext-$(version).a
lib-srcs := $(shell grep '^  *Data' ../text.cabal | \
                    sed -e 's,\.,/,g' -e 's,$$,.hs,')

all: qc

lib: $(lib)

$(lib): $(lib-srcs:%=../%)
	cd .. && runghc Setup configure --user --prefix=$(HOME)
	cd .. && runghc Setup build

qc: QuickCheckUtils.o Properties.o $(lib)
	$(ghc) $(ghcflags) -o $@ $^

%.o: %.hs
	$(ghc) $(ghcflags) -c -o $@ $<

.PHONY: testdata
testdata: text-testdata.tar.bz2

text-testdata.tar.bz2:
	curl -O http://projects.haskell.org/text/text-testdata.tar.bz2

clean:
	-rm -f *.o *.hi qc
<commit_msg>Get a hpc-enabled test build going.<commit_after>version := $(shell awk '/^version:/{print $$2}' ../text.cabal)
ghc := ghc
ghc-base-flags := -O0 -package bytestring -package QuickCheck \
	-ignore-package text
ghc-flags := $(ghc-base-flags) -i../dist/build -package-name text-$(version)
ghc-hpc-flags := $(ghc-base-flags) -fhpc -fno-ignore-asserts -odir hpcdir \
	-hidir hpcdir -i..
lib := ../dist/build/libHStext-$(version).a
lib-srcs := $(shell grep '^  *Data' ../text.cabal | \
                    sed -e 's,\.,/,g' -e 's,$$,.hs,')

all: qc qc-hpc

lib: $(lib)

$(lib): $(lib-srcs:%=../%)
	cd .. && runghc Setup configure --user --prefix=$(HOME)
	cd .. && runghc Setup build

qc: $(lib) QuickCheckUtils.o Properties.o
	$(ghc) $(ghc-flags) -o $@ $^

qc-hpc: Properties.hs QuickCheckUtils.hs $(lib-srcs:%=../%)
	-mkdir -p hpcdir
	$(ghc) $(ghc-hpc-flags) -ihpcdir --make -o $@ $<

%.o: %.hs
	$(ghc) $(ghc-flags) -c -o $@ $<

hpcdir/%.o: %.hs
	$(ghc) $(ghc-hpc-flags) --make -c -o $@ $<

.PHONY: testdata
testdata: text-testdata.tar.bz2

text-testdata.tar.bz2:
	curl -O http://projects.haskell.org/text/text-testdata.tar.bz2

clean:
	-rm -rf *.o *.hi qc qc-hpc hpcdir .hpc

{'fraction_non_alphanumeric': 0.2365482233502538, 'fraction_numerical': 0.004568527918781726, 'mean_word_length': 2.8123791102514506, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6366971', 'n_tokens_mistral': 869, 'n_tokens_neox': 828, 'n_words': 188}