git.iko.soy/typeable/pandoc
on 2.2.2 help sign in
typeable/pandoc/Makefile
122 lines 4.8 kB history raw
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 find pandoc.hs src test -name '*.hs')
4BRANCH?=master
5RESOLVER=lts-12
6GHCOPTS=-fdiagnostics-color=always -Wall -fno-warn-unused-do-bind -Wincomplete-record-updates -Wnoncanonical-monad-instances -Wnoncanonical-monadfail-instances
7WEBSITE=../../web/pandoc.org
9quick:
10 stack install --resolver=$(RESOLVER) --ghc-options='$(GHCOPTS)' --install-ghc --flag 'pandoc:embed_data_files' --fast --test --test-arguments='-j4 --hide-successes $(TESTARGS)'
12full:
13 stack install --resolver=$(RESOLVER) --flag 'pandoc:embed_data_files' --flag 'pandoc:weigh-pandoc' --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)'
15haddock:
16 stack haddock --resolver=$(RESOLVER)
18# Note: to accept current results of golden tests,
19# make test TESTARGS='--accept'
20test:
21 stack test --resolver=$(RESOLVER) --flag 'pandoc:embed_data_files' --fast --test-arguments='-j4 --hide-successes $(TESTARGS)' --ghc-options '$(GHCOPTS)'
23bench:
24 stack bench --benchmark-arguments='$(BENCHARGS)' --resolver=$(RESOLVER) --ghc-options '$(GHCOPTS)'
26weigh:
27 stack build --resolver=$(RESOLVER) --ghc-options '$(GHCOPTS)' --flag 'pandoc:weigh-pandoc' && stack exec weigh-pandoc
29reformat:
30 for f in $(SOURCEFILES); do echo $$f; stylish-haskell -i $$f ; done
32lint:
33 for f in $(SOURCEFILES); do echo $$f; hlint --verbose --refactor --refactor-options='-i -s' $$f; done
35changes_github:
36 pandoc --filter tools/extract-changes.hs changelog -t gfm --wrap=none | sed -e 's/\\#/#/g' | pbcopy
38dist: man/pandoc.1
39 cabal sdist
40 rm -rf "pandoc-${version}"
41 tar xvzf dist/pandoc-${version}.tar.gz
42 cd pandoc-${version}
43 stack setup && stack test && cd .. && rm -rf "pandoc-${version}"
45packages: checkdocs winpkg debpkg macospkg
47checkdocs: README.md
48 ! grep -n -e "\t" MANUAL.txt changelog
50debpkg: man/pandoc.1
51 make -C linux && \
52 cp linux/artifacts/pandoc-$(version)-*.* .
54macospkg: man/pandoc.1
55 ./macos/make_macos_package.sh
57winpkg: pandoc-$(version)-windows-i386.msi pandoc-$(version)-windows-i386.zip pandoc-$(version)-windows-x86_64.msi pandoc-$(version)-windows-x86_64.zip
59pandoc-$(version)-windows-%.zip: pandoc-$(version)-windows-%.msi
60 -rm -rf wintmp && \
61 msiextract -C wintmp $< && \
62 cd wintmp/"Program Files" && \
63 mv Pandoc pandoc-$(version) && \
64 zip -r $@ pandoc-$(version) && \
65 mv $@ ../../ && \
66 cd ../.. && \
67 rm -rf wintmp
69pandoc-$(version)-windows-%.msi: pandoc-windows-%.msi
70 osslsigncode sign -pkcs12 ~/Private/ComodoCodeSigning.exp2019.p12 -in $< -i http://johnmacfarlane.net/ -t http://timestamp.comodoca.com/ -out $@ -askpass
71 rm $<
73pandoc-windows-i386.msi:
74 JOBID=$(shell curl 'https://ci.appveyor.com/api/projects/jgm/pandoc' | jq -r '.build.jobs[0].jobId') && \
75 wget "https://ci.appveyor.com/api/buildjobs/$$JOBID/artifacts/windows%2F$@" -O $@
77pandoc-windows-x86_64.msi:
78 JOBID=$(shell curl 'https://ci.appveyor.com/api/projects/jgm/pandoc' | jq -r '.build.jobs[1].jobId') && \
79 wget "https://ci.appveyor.com/api/buildjobs/$$JOBID/artifacts/windows%2F$@" -O $@
81man/pandoc.1: MANUAL.txt man/pandoc.1.template
82 pandoc $< -f markdown-smart -t man -s --template man/pandoc.1.template \
83 --lua-filter man/manfilter.lua \
84 --variable version="pandoc $(version)" \
85 -o $@
87doc/lua-filters.md: tools/ldoc.ltp data/pandoc.lua tools/update-lua-docs.lua
88 cp $@ $@.tmp
89 pandoc -t markdown --columns=64 --atx-headers \
90 -f markdown -t markdown --standalone\
91 --lua-filter tools/update-lua-docs.lua \
92 -o $@ $@.tmp
93 rm $@.tmp
95README.md: README.template MANUAL.txt tools/update-readme.lua
96 pandoc --lua-filter tools/update-readme.lua --reference-links \
97 --reference-location=section -t gfm $< -o $@
99download_stats:
100 curl https://api.github.com/repos/jgm/pandoc/releases | \
101 jq -r '.[] | .assets | .[] | "\(.download_count)\t\(.name)"'
103pandoc-templates:
104 rm ../pandoc-templates/default.* ; \
105 cp data/templates/default.* ../pandoc-templates/ ; \
106 pushd ../pandoc-templates/ && \
107 git add default.* && \
108 git commit -m "Updated templates for pandoc $(version)" && \
109 popd
111trypandoc:
112 ssh -t macfarlane 'cd src/pandoc && git pull && ~/.local/bin/stack install --flag pandoc:trypandoc --flag pandoc:embed_data_files && cd trypandoc && sudo make install'
114update-website:
115 make -C $(WEBSITE) update
116 make -C $(WEBSITE)
117 make -C $(WEBSITE) upload
119clean:
120 stack clean
122.PHONY: deps quick full haddock install clean test bench changes_github macospkg dist prof download_stats reformat lint weigh doc/lua-filters.md packages pandoc-templates trypandoc update-website debpkg macospkg winpkg checkdocs