forked from jaspervdj/blaze-html
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
87 lines (67 loc) · 2.69 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
################################################################################
# Configuration
################################################################################
GHC = ghc
GHCI = ghci
GHC_FLAGS = -O2 -fforce-recomp -idoc/examples -ibenchmarks -isrc -itests
BENCHMARK_FLAGS = --resamples 10000
################################################################################
# Code generation
################################################################################
# Generate the actual HTML combinators
combinators:
runghc -isrc src/Util/GenerateHtmlCombinators.hs
# Copy the docs the website directory
website-docs:
cabal haddock
rm -rf website/docs
cp -r dist/doc/html/blaze-html website/docs
################################################################################
# Tests
################################################################################
# Run the tests
test:
$(GHC) $(GHC_FLAGS) -fhpc --make tests/TestSuite.hs
rm -f TestSuite.tix
./tests/TestSuite
# HPC
test-hpc:
hpc markup --destdir=hpc TestSuite
################################################################################
# Benchmarks
################################################################################
benchmark:
$(GHC) $(GHC_FLAGS) --make -main-is RunHtmlBenchmarks benchmarks/RunHtmlBenchmarks.hs
./benchmarks/RunHtmlBenchmarks $(BENCHMARK_FLAGS) -u results.csv
benchmark-server:
$(GHC) $(GHC_FLAGS) --make -threaded -main-is BenchmarkServer doc/examples/BenchmarkServer.lhs
snap-benchmark-server:
$(GHC) $(GHC_FLAGS) --make -threaded -main-is SnapBenchmarkServer doc/examples/SnapBenchmarkServer.lhs
benchmark-bigtable-non-haskell:
ruby benchmarks/bigtable/erb.rb
ruby benchmarks/bigtable/erubis.rb
php -n benchmarks/bigtable/php.php
################################################################################
# Switching cabal files
################################################################################
# The current target used
CURRENT=$(shell ls *.cabal | sed 's/\.cabal//')
# Auxiliary
hide-cabal-files:
cabal clean
mv ${CURRENT}.cabal ${CURRENT}.cabal.${CURRENT}
mv Setup.hs Setup.hs.${CURRENT}
blaze-html: hide-cabal-files
mv blaze-html.cabal.blaze-html blaze-html.cabal
mv Setup.hs.blaze-html Setup.hs
blaze-from-html: hide-cabal-files
mv blaze-from-html.cabal.blaze-from-html blaze-from-html.cabal
mv Setup.hs.blaze-from-html Setup.hs
################################################################################
# Switching cabal files
################################################################################
# Cleanup
clean:
rm -rf doc/examples/BenchmarkServer
rm -rf benchmarks/HtmlBenchmarks
find . -name '*.o' -o -name '*.hi' | xargs rm