2015-08-15 15:17:12 +02:00
|
|
|
|
|
|
|
# quick makefile to document how to do the various tasks
|
|
|
|
|
|
|
|
# there is no real reason to actually use the makefile except for a
|
2020-04-24 19:35:38 +02:00
|
|
|
# very small amount of convenience, apart from the website build
|
2015-08-15 15:17:12 +02:00
|
|
|
|
|
|
|
.PHONY : build
|
|
|
|
build :
|
2024-01-26 16:28:15 +01:00
|
|
|
cabal build
|
2015-08-15 15:17:12 +02:00
|
|
|
|
|
|
|
.PHONY : test
|
2019-07-07 12:33:02 +02:00
|
|
|
test :
|
2020-04-24 19:35:38 +02:00
|
|
|
cabal run test:Tests -- --hide-successes --ansi-tricks=false
|
2015-08-15 15:17:12 +02:00
|
|
|
|
2020-04-24 19:35:38 +02:00
|
|
|
.PHONY : test-coverage
|
|
|
|
test-coverage :
|
|
|
|
cabal test --enable-coverage
|
2015-08-15 15:17:12 +02:00
|
|
|
|
|
|
|
.PHONY : clean
|
|
|
|
clean :
|
2020-04-24 19:35:38 +02:00
|
|
|
cabal clean
|
2015-08-15 15:17:12 +02:00
|
|
|
rm -Rf build/
|
|
|
|
|
2020-04-24 19:35:38 +02:00
|
|
|
.PHONY : parserexe
|
2019-07-07 12:33:02 +02:00
|
|
|
parserexe :
|
2024-01-26 16:28:15 +01:00
|
|
|
cabal build -fparserexe SimpleSQLParserTool
|
2020-04-24 19:35:38 +02:00
|
|
|
|
2024-01-26 16:28:15 +01:00
|
|
|
.PHONY : all
|
|
|
|
all : build test parserexe
|
2020-04-24 19:35:38 +02:00
|
|
|
|
|
|
|
###############################################
|
|
|
|
|
|
|
|
# website
|
|
|
|
|
|
|
|
# it's a bit crap, run cabal test or make test or something at least once
|
|
|
|
# to get the website build to work
|
|
|
|
|
|
|
|
.PHONY : website
|
|
|
|
website : website-non-haddock build-haddock
|
|
|
|
|
|
|
|
.PHONY : website-non-haddock
|
|
|
|
website-non-haddock : build/main.css build/ocean.css build/index.html build/supported_sql.html \
|
2024-01-12 20:25:13 +01:00
|
|
|
build/test_cases.html build/contributing.html
|
2020-04-24 19:35:38 +02:00
|
|
|
|
|
|
|
|
|
|
|
build/main.css : website/main.css
|
|
|
|
mkdir -p build
|
|
|
|
cp website/main.css build
|
|
|
|
|
|
|
|
build/ocean.css : website/ocean.css
|
|
|
|
mkdir -p build
|
|
|
|
cp website/ocean.css build
|
|
|
|
|
2024-01-09 01:07:47 +01:00
|
|
|
build/index.html : website/index.asciidoc website/AddLinks.hs
|
|
|
|
asciidoctor website/index.asciidoc -o - | cabal -v0 exec runhaskell website/AddLinks.hs > build/index.html
|
2020-04-24 19:35:38 +02:00
|
|
|
|
2024-01-09 01:07:47 +01:00
|
|
|
build/supported_sql.html : website/supported_sql.asciidoc website/AddLinks.hs
|
|
|
|
asciidoctor website/supported_sql.asciidoc -o - | cabal -v0 exec runhaskell website/AddLinks.hs > build/supported_sql.html
|
2020-04-24 19:35:38 +02:00
|
|
|
|
2024-01-10 17:18:05 +01:00
|
|
|
build/contributing.html : website/contributing.asciidoc website/AddLinks.hs
|
|
|
|
asciidoctor website/contributing.asciidoc -o - | cabal -v0 exec runhaskell website/AddLinks.hs > build/contributing.html
|
|
|
|
|
2024-01-09 01:07:47 +01:00
|
|
|
build/test_cases.html : website/RenderTestCases.hs
|
|
|
|
cabal -v0 exec runhaskell -- --ghc-arg=-package=pretty-show -itools website/RenderTestCases.hs > build/test_cases.asciidoc
|
2020-04-24 19:35:38 +02:00
|
|
|
asciidoctor build/test_cases.asciidoc -o - | \
|
|
|
|
sed -e "s/max-width:62\.5em//g" > build/test_cases.html
|
|
|
|
# TODO: reduce the text size on the test cases page
|
|
|
|
# TODO: use scrollbars inside the tables
|
|
|
|
# TODO: make the tables autowidth
|
|
|
|
# -e "s/(code.*)font-size:1em/\1font-size:0.8em/g"
|
|
|
|
rm build/test_cases.asciidoc
|
2024-01-10 17:18:05 +01:00
|
|
|
# the tests don't render right if the TestCases aren't all at the same level
|
|
|
|
# of group nesting, which should be fixed - if this isn't the case, it
|
|
|
|
# will silently not render some of the tests
|
2020-04-24 19:35:38 +02:00
|
|
|
|
|
|
|
# works here, but not in a recipe. amazing
|
|
|
|
# GHC_VER="$(shell ghc --numeric-version)"
|
|
|
|
|
|
|
|
.PHONY : build-haddock
|
|
|
|
build-haddock :
|
|
|
|
cabal haddock --haddock-option="--hyperlinked-source"
|
|
|
|
# todo: handle the deps properly
|
|
|
|
rm -Rf build/haddock
|
|
|
|
mkdir build/haddock/
|
|
|
|
$(eval GHC_VER="$(shell ghc --numeric-version)")
|
2024-01-08 13:26:44 +01:00
|
|
|
$(eval SSP_VER="$(shell cat simple-sql-parser.cabal |grep -P '^version:' | awk '{print $$2}')")
|
|
|
|
cp -R dist-newstyle/build/x86_64-linux/ghc-${GHC_VER}/simple-sql-parser-${SSP_VER}/doc/html/simple-sql-parser/* build/haddock/
|