Source

text / tests / Makefile

The default branch has multiple heads

Full commit
Bryan O'Sullivan bb16c7a 

Bryan O'Sullivan f53096d 

Bryan O'Sullivan df9bcce 
Bryan O'Sullivan 046b1a9 

Bryan O'Sullivan df9bcce 
Bryan O'Sullivan 88ccd83 


Bryan O'Sullivan bb16c7a 


Bryan O'Sullivan dbdb512 
Bryan O'Sullivan ac53fa5 

Bryan O'Sullivan 3df62a3 
Bryan O'Sullivan 73321bf 
Bryan O'Sullivan bb16c7a 
Bryan O'Sullivan 73321bf 
Bryan O'Sullivan bb16c7a 
Bryan O'Sullivan ac53fa5 
Bryan O'Sullivan bb16c7a 

Bryan O'Sullivan ac53fa5 



Bryan O'Sullivan bb16c7a 
Bryan O'Sullivan 960b50b 
Bryan O'Sullivan f5a6053 


Bryan O'Sullivan 960b50b 
Bryan O'Sullivan df9bcce 
Bryan O'Sullivan 88ccd83 
Bryan O'Sullivan f53096d 


Bryan O'Sullivan 88ccd83 

Bryan O'Sullivan 359abdc 
Bryan O'Sullivan f53096d 

Bryan O'Sullivan bb16c7a 
Bryan O'Sullivan 3df62a3 


Bryan O'Sullivan 12d56aa 
Bryan O'Sullivan 3df62a3 
Bryan O'Sullivan 1694427 
Bryan O'Sullivan 3df62a3 

Bryan O'Sullivan f53096d 
Bryan O'Sullivan bb16c7a 
Bryan O'Sullivan f53096d 
Bryan O'Sullivan 88ccd83 

Bryan O'Sullivan f53096d 
Bryan O'Sullivan 73321bf 







Bryan O'Sullivan 3df62a3 
version := $(shell awk '/^version:/{print $$2}' ../text.cabal)
ghc := ghc
ghc-opt-flags = -O0
ghc-base-flags := -funbox-strict-fields -package criterion \
	-package bytestring -package QuickCheck -package test-framework \
	-package test-framework-quickcheck -ignore-package text \
	-fno-ignore-asserts
ghc-base-flags += -Wall -fno-warn-orphans -fno-warn-missing-signatures
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,')

cabal := $(shell which cabal 2>/dev/null)

all: qc coverage

lib: $(lib)

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

Properties.o: QuickCheckUtils.o SlowFunctions.o

QuickCheckUtils.o: $(lib)

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

sb: SearchBench.o
	$(ghc) $(ghc-flags) -threaded -o $@ $^ $(lib)

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

coverage: qc-hpc-html/hpc_index.html

qc-hpc-html/hpc_index.html: qc-hpc
	./qc-hpc -a 100 +RTS -N2
	hpc markup qc-hpc --exclude=Main --exclude=Properties \
	  --exclude=Data.Text.Fusion.CaseMapping \
	  --exclude=QuickCheckUtils --srcdir=.. --srcdir=. --destdir=$(dir $@)

SearchBench.o: ghc-opt-flags = -O
%.o: %.hs
	$(ghc) $(ghc-flags) $(ghc-opt-flags) -c -o $@ $<

hpcdir/%.o: %.hs
	$(ghc) $(ghc-hpc-flags) $(ghc-opt-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 *.tix qc qc-hpc hpcdir .hpc qc-hpc-html