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$$")
6DOCKERIMAGE=registry.gitlab.b-data.ch/ghc/ghc4pandoc:8.10.4
7COMMIT=$(shell git rev-parse --short HEAD)
8TIMESTAMP=$(shell date "+%Y%m%d_%H%M")
9LATESTBENCH=$(word 1,$(shell ls -t bench_*.csv 2>/dev/null))
13BASELINE=--baseline $(LATESTBENCH)
15GHCOPTS=-fdiagnostics-color=always
16WEBSITE=../../web/pandoc.org
18BENCHARGS?=--timeout=6 +RTS -T -RTS $(if $(PATTERN),--pattern "$(PATTERN)",)
21 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)'
24 cabal new-configure . --ghc-options '$(GHCOPTS)' --disable-optimization --enable-tests
25 cabal new-build . --disable-optimization
26 cabal new-run test-pandoc --disable-optimization -- --hide-successes $(TESTARGS)
29 cabal new-configure . --ghc-options '$(GHCOPTS)' --flags '+embed_data_files +trypandoc' --enable-tests --enable-benchmarks
30 cabal new-build . --disable-optimization
31 cabal new-run test-pandoc --disable-optimization -- --hide-successes $(TESTARGS)
34 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)'
37 stack ghci --ghc-options=-XNoImplicitPrelude --flag 'pandoc:embed_data_files'
42# Note: to accept current results of golden tests,
43# make test TESTARGS='--accept'
45 stack test --flag 'pandoc:embed_data_files' --fast --test-arguments='-j4 --hide-successes $(TESTARGS)' --ghc-options '$(GHCOPTS)'
48 ghcid -c "stack repl --ghc-options=-XNoImplicitPrelude --flag 'pandoc:embed_data_files'"
51 ghcid -c "stack repl --ghc-options=-XNoImplicitPrelude --flag 'pandoc:embed_data_files' --ghci-options=-fobject-code pandoc:lib pandoc:test-pandoc"
54 stack bench --benchmark-arguments='$(BENCHARGS) $(BASELINE) --csv bench_$(TIMESTAMP).csv' --ghc-options '$(GHCOPTS)'
57 stack build --ghc-options '$(GHCOPTS)' pandoc:weigh-pandoc && stack exec weigh-pandoc
60 for f in $(SOURCEFILES); do echo $$f; stylish-haskell -i $$f ; done
62lint: hlint fix_spacing
65 for f in $(SOURCEFILES); do echo $$f; hlint --verbose --refactor --refactor-options='-s -o -' $$f; done
68 # Fix trailing newlines and spaces at ends of lines
69 for f in $(SOURCEFILES); do printf '%s\n' "`cat $$f`" | sed -e 's/ *$$//' > $$f.tmp; mv $$f.tmp $$f; done
72 pandoc --filter tools/extract-changes.hs changelog.md -t gfm --wrap=none --template tools/changes_template.html | sed -e 's/\\#/#/g' | pbcopy
76 rm -rf "pandoc-${version}"
77 tar xvzf dist/pandoc-${version}.tar.gz
79 stack setup && stack test && cd .. && rm -rf "pandoc-${version}"
81check: checkdocs check-cabal
84 ! grep -q -n -e "\t" MANUAL.txt changelog.md
87 docker run -v `pwd`:/mnt \
88 -v `pwd`/linux/artifacts:/artifacts \
89 --user $(id -u):$(id -g) \
90 -e REVISION=$(REVISION) \
96 /mnt/linux/make_artifacts.sh 2>&1 > docker.log
98man/pandoc.1: MANUAL.txt man/pandoc.1.before man/pandoc.1.after
99 pandoc $< -f markdown -t man -s \
100 --lua-filter man/manfilter.lua \
101 --include-before-body man/pandoc.1.before \
102 --include-after-body man/pandoc.1.after \
103 --metadata author="" \
104 --variable footer="pandoc $(version)" \
107README.md: README.template MANUAL.txt tools/update-readme.lua
108 pandoc --lua-filter tools/update-readme.lua \
109 --reference-location=section -t gfm $< -o $@
112 curl https://api.github.com/repos/jgm/pandoc/releases | \
113 jq -r '.[] | .assets | .[] | "\(.download_count)\t\(.name)"'
116 rm ../pandoc-templates/default.* ; \
117 cp data/templates/* ../pandoc-templates/ ; \
118 pushd ../pandoc-templates/ && \
120 git commit -m "Updated templates for pandoc $(version)" && \
124 ssh -t macfarlane 'cd src/pandoc && git pull && stack install --flag pandoc:trypandoc --flag pandoc:embed_data_files && cd trypandoc && sudo make install'
127 make -C $(WEBSITE) update
129 make -C $(WEBSITE) upload
134check-cabal: git-files.txt sdist-files.txt
135 echo "Checking to see if all committed test/data files are in sdist."
138sdist-files.txt: .FORCE
139 cabal sdist --list-only | sed 's/\.\///' | grep '^\(test\|data\)\/' | sort > $@
142 git ls-tree -r --name-only HEAD | grep '^\(test\|data\)\/' | sort > $@
144.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