@@ -21,29 +21,26 @@ REVISION?=1
21
21
# For tasty-bench:
22
22
BENCHARGS? =--csv bench_$(TIMESTAMP ) .csv $(BASELINECMD ) --timeout=6 +RTS -T --nonmoving-gc -RTS $(if $(PATTERN ) ,--pattern "$(PATTERN ) ",)
23
23
24
- quick :
24
+ # Note: to accept current results of golden tests,
25
+ # make test TESTARGS='--accept'
26
+ quick : # # build & test with stack, no optimizations
25
27
stack install --ghc-options=' $(GHCOPTS)' --system-ghc --flag ' pandoc:embed_data_files' --fast --test --test-arguments=' -j4 --hide-successes --ansi-tricks=false $(TESTARGS)'
26
28
27
- quick-cabal :
29
+ quick-cabal : # # build & test with stack, no optimizations
28
30
cabal v2-build -j8 --ghc-options ' $(GHCOPTS)' --disable-optimization --enable-tests
29
31
cabal v2-test --disable-optimization --test-options=" --hide-successes --ansi-tricks=false $( TESTARGS) "
30
32
echo " Path to built executable:" && cabal exec -- sh -c ' command -v pandoc' | sed -e ' s!x/pandoc/build!x/pandoc/noopt/build!'
31
33
32
- full-cabal :
33
- cabal v2-configure . --ghc-options ' $(GHCOPTS)' --flags ' +embed_data_files +trypandoc' --enable-tests --enable-benchmarks
34
- cabal v2-build . --disable-optimization
35
- cabal v2-run test-pandoc --disable-optimization -- --hide-successes --ansi-tricks=false $(TESTARGS )
36
-
37
- full :
34
+ full : # # build with stack, including benchmarks, trypandoc
38
35
stack install --flag ' pandoc:embed_data_files' --flag ' pandoc:trypandoc' --bench --no-run-benchmarks --test --test-arguments=' -j4 --hide-successes--ansi-tricks-false' --ghc-options ' -Wall -Werror -fno-warn-unused-do-bind -O0 $(GHCOPTS)'
39
36
40
- ghci :
37
+ ghci : # # start ghci session
41
38
stack ghci --flag ' pandoc:embed_data_files'
42
39
43
- haddock :
40
+ haddock : # # build haddocks
44
41
stack haddock
45
42
46
- check : check-cabal checkdocs
43
+ check : check-cabal checkdocs # # prerelease checks
47
44
cabal check # check cabal file
48
45
cabal outdated # check cabal dependencies
49
46
stack-lint-extra-deps # check that stack.yaml dependencies are up to date
@@ -58,47 +55,34 @@ checkdocs:
58
55
@echo " Checking for tabs in manual."
59
56
! grep -q -n -e " \t" MANUAL.txt changelog.md
60
57
61
- # Note: to accept current results of golden tests,
62
- # make test TESTARGS='--accept'
63
- test :
64
- stack test --flag ' pandoc:embed_data_files' --fast --test-arguments=' -j4 --hide-successes --ansi-tricks=false $(TESTARGS)' --ghc-options ' $(GHCOPTS)'
65
-
66
- ghcid :
58
+ ghcid : # # run ghcid/stack
67
59
ghcid -c " stack repl --flag 'pandoc:embed_data_files'"
68
60
69
- ghcid-test :
61
+ ghcid-test : # # run ghcid/stack with tests
70
62
ghcid -c " stack repl --ghc-options=-XNoImplicitPrelude --flag 'pandoc:embed_data_files' --ghci-options=-fobject-code pandoc:lib pandoc:test-pandoc"
71
63
72
- bench :
64
+ bench : # # build and run benchmarks
73
65
stack bench \
74
66
--ghc-options ' $(GHCOPTS)' \
75
67
--benchmark-arguments=' $(BENCHARGS)' 2>&1 | \
76
68
tee " bench_latest.txt"
77
69
78
- reformat :
70
+ reformat : # # reformat with stylish-haskell
79
71
for f in $( SOURCEFILES) ; do echo $$ f; stylish-haskell -i $$ f ; done
80
72
81
- lint : hlint fix_spacing
73
+ lint : hlint fix_spacing # # run linters
82
74
83
- hlint :
75
+ hlint : # # run hlint
84
76
for f in $( SOURCEFILES) ; do echo $$ f; hlint --verbose --refactor --refactor-options=' -s -o -' $$ f; done
85
77
86
- fix_spacing :
87
- # Fix trailing newlines and spaces at ends of lines
78
+ fix_spacing : # # Fix trailing newlines and spaces
88
79
for f in $( SOURCEFILES) ; do printf ' %s\n' " ` cat $$ f` " | sed -e ' s/ *$$//' > $$ f.tmp; mv $$ f.tmp $$ f; done
89
80
90
- changes_github :
81
+ changes_github : # # copy this release's changes in gfm
91
82
pandoc --filter tools/extract-changes.hs changelog.md -t gfm --wrap=none --template tools/changes_template.html | sed -e ' s/\\#/#/g' | pbcopy
92
83
93
- dist : man/pandoc.1
94
- cabal sdist
95
- rm -rf " pandoc-${version} "
96
- tar xvzf dist/pandoc-${version} .tar.gz
97
- cd pandoc-${version}
98
- stack setup && stack test && cd .. && rm -rf " pandoc-${version} "
99
84
100
-
101
- debpkg :
85
+ debpkg : # # create linux package
102
86
docker run -v ` pwd` :/mnt \
103
87
-v `pwd`/linux/artifacts :/artifacts \
104
88
--user $(id -u ) :$(id -g ) \
@@ -123,27 +107,27 @@ README.md: README.template MANUAL.txt tools/update-readme.lua
123
107
pandoc --lua-filter tools/update-readme.lua \
124
108
--reference-location=section -t gfm $< -o $@
125
109
126
- download_stats :
110
+ download_stats : # # print download stats from GitHub releases
127
111
curl https://api.github.com/repos/jgm/pandoc/releases | \
128
112
jq -r ' .[] | .assets | .[] | "\(.download_count)\t\(.name)"'
129
113
130
- pandoc-templates :
114
+ pandoc-templates : # # update pandoc-templates repo
131
115
rm ../pandoc-templates/default.* ; \
132
116
cp data/templates/* ../pandoc-templates/ ; \
133
117
pushd ../pandoc-templates/ && \
134
118
git add * && \
135
119
git commit -m " Updated templates for pandoc $( version) " && \
136
120
popd
137
121
138
- trypandoc :
122
+ trypandoc : # # build trypandoc on server
139
123
ssh -t macfarlane ' cd src/pandoc && git pull && cabal update && cabal install -ftrypandoc -fembed_data_files --install-method=copy --overwrite-policy=always && cd trypandoc && sudo make install'
140
124
141
- update-website :
125
+ update-website : # # update website and upload
142
126
make -C $(WEBSITE ) update
143
127
make -C $(WEBSITE )
144
128
make -C $(WEBSITE ) upload
145
129
146
- clean :
130
+ clean : # # clean up
147
131
stack clean
148
132
149
133
sdist-files.txt : .FORCE
@@ -152,4 +136,8 @@ sdist-files.txt: .FORCE
152
136
git-files.txt : .FORCE
153
137
git ls-tree -r --name-only HEAD | grep ' ^\(test\|data\)\/' | sort > $@
154
138
155
- .PHONY : .FORCE deps quick full haddock install clean test bench changes_github dist prof download_stats reformat lint weigh doc/lua-filters.md pandoc-templates trypandoc update-website debpkg checkdocs ghcid ghci fix_spacing hlint check check-cabal check
139
+ .PHONY : help
140
+ help : # # Display this help
141
+ @grep -E ' ^[ a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST ) | sort | awk ' BEGIN {FS = ":.*?## "}; {printf "%-30s %s\n", $$1, $$2}'
142
+
143
+ .PHONY : .FORCE deps quick haddock install clean test bench changes_github download_stats reformat lint weigh pandoc-templates trypandoc update-website debpkg checkdocs ghcid ghci fix_spacing hlint check check-cabal check
0 commit comments