1version?=$(shell grep '^[Vv]ersion:' pandoc.cabal | awk '{print $$2;}')
2pandoc=$(shell find dist -name pandoc -type f -exec ls -t {} \; | head -1)
3SOURCEFILES?=$(shell git ls-tree -r master --name-only | grep "\.hs$$")
5COMMIT=$(shell git rev-parse --short HEAD)
6TIMESTAMP=$(shell date "+%Y%m%d_%H%M")
7LATESTBENCH=$(word 1,$(shell ls -t bench_*.csv))
11BASELINE=--baseline $(LATESTBENCH)
13GHCOPTS=-fdiagnostics-color=always
14WEBSITE=../../web/pandoc.org
16BENCHARGS?=--timeout=6 +RTS -T -RTS $(if $(PATTERN),--pattern "$(PATTERN)",)
19 stack install --ghc-options='$(GHCOPTS)' --install-ghc --flag 'pandoc:embed_data_files' --fast --test --ghc-options='-j +RTS -A64m -RTS' --test-arguments='-j4 --hide-successes $(TESTARGS)'
22 cabal new-configure . --ghc-options '$(GHCOPTS)' --disable-optimization --enable-tests
23 cabal new-build . --disable-optimization
24 cabal new-run test-pandoc --disable-optimization -- --hide-successes $(TESTARGS)
27 cabal new-configure . --ghc-options '$(GHCOPTS)' --flags '+embed_data_files +trypandoc' --enable-tests --enable-benchmarks
28 cabal new-build . --disable-optimization
29 cabal new-run test-pandoc --disable-optimization -- --hide-successes $(TESTARGS)
32 stack install --flag 'pandoc:embed_data_files' --flag 'pandoc:trypandoc' --bench --no-run-benchmarks --test --test-arguments='-j4 --hide-successes' --ghc-options '-Wall -Werror -fno-warn-unused-do-bind -O0 -j4 $(GHCOPTS)'
35 stack ghci --flag 'pandoc:embed_data_files'
40# Note: to accept current results of golden tests,
41# make test TESTARGS='--accept'
43 stack test --flag 'pandoc:embed_data_files' --fast --test-arguments='-j4 --hide-successes $(TESTARGS)' --ghc-options '$(GHCOPTS)'
46 ghcid -c "stack repl --flag 'pandoc:embed_data_files'"
49 stack bench --benchmark-arguments='$(BENCHARGS) $(BASELINE) --csv bench_$(TIMESTAMP).csv' --ghc-options '$(GHCOPTS)'
52 stack build --ghc-options '$(GHCOPTS)' pandoc:weigh-pandoc && stack exec weigh-pandoc
55 for f in $(SOURCEFILES); do echo $$f; stylish-haskell -i $$f ; done
57lint: hlint fix_spacing
60 for f in $(SOURCEFILES); do echo $$f; hlint --verbose --refactor --refactor-options='-s -o -' $$f; done
63 # Fix trailing newlines and spaces at ends of lines
64 for f in $(SOURCEFILES); do printf '%s\n' "`cat $$f`" | sed -e 's/ *$$//' > $$f.tmp; mv $$f.tmp $$f; done
67 pandoc --filter tools/extract-changes.hs changelog.md -t gfm --wrap=none --template tools/changes_template.html | sed -e 's/\\#/#/g' | pbcopy
71 rm -rf "pandoc-${version}"
72 tar xvzf dist/pandoc-${version}.tar.gz
74 stack setup && stack test && cd .. && rm -rf "pandoc-${version}"
76check: checkdocs check-cabal
79 ! grep -q -n -e "\t" MANUAL.txt changelog.md
82 docker run -v `pwd`:/mnt \
83 -v `pwd`/linux/artifacts:/artifacts \
84 -e REVISION=$(REVISION) \
86 utdemir/ghc-musl:v12-libgmp-ghc8101 bash \
87 /mnt/linux/make_artifacts.sh
89man/pandoc.1: MANUAL.txt man/pandoc.1.before man/pandoc.1.after
90 pandoc $< -f markdown -t man -s \
91 --lua-filter man/manfilter.lua \
92 --include-before-body man/pandoc.1.before \
93 --include-after-body man/pandoc.1.after \
94 --metadata author="" \
95 --variable footer="pandoc $(version)" \
98README.md: README.template MANUAL.txt tools/update-readme.lua
99 pandoc --lua-filter tools/update-readme.lua \
100 --reference-location=section -t gfm $< -o $@
103 curl https://api.github.com/repos/jgm/pandoc/releases | \
104 jq -r '.[] | .assets | .[] | "\(.download_count)\t\(.name)"'
107 rm ../pandoc-templates/default.* ; \
108 cp data/templates/* ../pandoc-templates/ ; \
109 pushd ../pandoc-templates/ && \
111 git commit -m "Updated templates for pandoc $(version)" && \
115 ssh -t macfarlane 'cd src/pandoc && git pull && stack install --flag pandoc:trypandoc --flag pandoc:embed_data_files && cd trypandoc && sudo make install'
118 make -C $(WEBSITE) update
120 make -C $(WEBSITE) upload
125check-cabal: git-files.txt sdist-files.txt
126 echo "Checking to see if all committed test/data files are in sdist."
129sdist-files.txt: .FORCE
130 cabal sdist --list-only | sed 's/\.\///' | grep '^\(test\|data\)\/' | sort > $@
133 git ls-tree -r --name-only HEAD | grep '^\(test\|data\)\/' | sort > $@
135.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
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list