From 658f01f072ae9e8a24a514f9fa64226ca6fe3a59 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 16 Dec 2014 13:58:34 -0800 Subject: [PATCH] Added bindist target to Makefile. This creates a binary package with a standalone executable and man pages. --- Makefile | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 589130b72..c86ab8eac 100644 --- a/Makefile +++ b/Makefile @@ -5,6 +5,8 @@ ifeq "${makemanpages}" "" endif setup=dist/setup/setup MANPAGES=man/man1/pandoc.1 man/man5/pandoc_markdown.5 +PREFIX ?= /usr/local +BINDIST ?= pandoc-$(version)-$(shell uname -m) quick: cabal configure --enable-tests --disable-optimization @@ -39,7 +41,19 @@ dist: man cd pandoc-${version} cabal configure ${CABALARGS} && cabal build && cabal test && cd .. && rm -rf "pandoc-${version}" -man: ${MANPAGES} +bindist: $(MANPAGES) + cabal install --only-dependencies -fembed_data_files + cabal configure --prefix=/usr/local --datadir=share/data --enable-tests -fembed_data_files + cabal build + cabal test + cabal copy --destdir=$(BINDIST) + mkdir -p $(BINDIST)$(PREFIX)/share/man/man1 $(BINDIST)$(PREFIX)/share/man/man5 + for x in $(MANPAGES); do cp $$x $(BINDIST)$(PREFIX)/share/$$x; done + mkdir -p $(BINDIST)$(PREFIX)/share/doc/pandoc + cp COPYING $(BINDIST)$(PREFIX)/share/doc/pandoc/ + tar cvzf $(BINDIST).tar.gz $(BINDIST)$(PREFIX)/bin $(BINDIST)$(PREFIX)/share + +man: $(MANPAGES) osxpkg: ./make_osx_package.sh @@ -52,6 +66,7 @@ osxpkg: clean: cabal clean - -rm ${MANPAGES} + -rm $(MANPAGES) + -rm -rf $(BINDIST) $(BINDIST).tar.gz -.PHONY: deps quick full install man clean test bench haddock osxpkg dist prof +.PHONY: deps quick full install man clean test bench haddock osxpkg dist bindist prof