summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorroktas <roktas@788f1e2b-df1e-0410-8736-df70ead52e1b>2006-10-30 06:41:26 +0000
committerroktas <roktas@788f1e2b-df1e-0410-8736-df70ead52e1b>2006-10-30 06:41:26 +0000
commit52f07a04b579e7c3a35d8cf9d27593d38f83d182 (patch)
tree6120d22b4900f03b8edae894d55588d0c872452b /Makefile
parentfe92360ea2dc3863d3c1bed816037f921706d343 (diff)
Add a 'osx-pkg' target for the creation of a Mac OSX® package (using
PackageMaker.App). This target recursively uses 'install-program' target to populate OSX package directory tree. git-svn-id: https://pandoc.googlecode.com/svn/trunk@40 788f1e2b-df1e-0410-8736-df70ead52e1b
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile32
1 files changed, 30 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index b3b68bc45..58fef824c 100644
--- a/Makefile
+++ b/Makefile
@@ -44,6 +44,7 @@ PKGPATH := $(DATAPATH)/$(THIS)
INSTALL := install -c
INSTALL_PROGRAM := $(INSTALL) -m 755
INSTALL_DATA := $(INSTALL) -m 644
+STRIP := strip
GHC := ghc
GHC_PKG := ghc-pkg
@@ -59,6 +60,16 @@ templates: $(SRCDIR)/templates
$(SRCDIR)/templates:
$(MAKE) -C $(SRCDIR)/templates
+# Document process rules.
+%.html: %
+ ./$(THIS) -s $^ >$@ || rm -f $@
+%.tex: %
+ $(THIS) -s -w latex $^ >$@ || rm -f $@
+%.rtf: %
+ $(THIS) -s -w rtf $^ >$@ || rm -f $@
+%.pdf: %
+ sh ./markdown2pdf $^ || rm -f $@
+
cleanup_files+=$(CABAL)
$(CABAL): cabalize $(CABAL).in
./cabalize <$(CABAL).in >$(CABAL)
@@ -153,13 +164,30 @@ uninstall-all: uninstall-exec uninstall-doc uninstall-lib-doc
install: install-program
uninstall: uninstall-program
+.PHONY: osx-pkg
+osx_dest:=osx-pkg
+doc_more:=README.rtf LICENSE.rtf
+cleanup_files+=$(osx_dest) $(doc_more)
+osx-pkg: $(doc_more)
+ -rm -rf $(osx_dest)
+ $(INSTALL) -d $(osx_dest)
+ DESTDIR=$(osx_dest) $(MAKE) install-program
+ find $(osx_dest) -type f -regex ".*bin/.*" | xargs chmod +x
+ find $(osx_dest) -type f -regex ".*bin/$(THIS)" | xargs $(STRIP)
+ $(INSTALL) -d $(osx_dest)/Resources
+ mv README.rtf $(osx_dest)/Resources/ReadMe.rtf
+ mv LICENSE.rtf $(osx_dest)/Resources/License.rtf
+ @echo
+ @echo "You may now run PackageMaker.app. For Root, specify"
+ @echo "osx-pkg/Package_Root. The ReadMe.rtf and License.rtf files"
+ @echo "can be found in osx-pkg/Resources."
+ @echo
+
.PHONY: test test-markdown
test: $(BINS)
@cd tests && perl runtests.pl -s $(PWD)/$(THIS)
test-markdown: $(BINS)
@cd tests/MarkdownTest_1.0.3 && perl MarkdownTest.pl -s $(PWD)/$(THIS) -tidy
-%.html: %
- ./$(THIS) -s $^ >$@ || rm -f $@
# Stolen and slightly improved from a GPLed Makefile. Credits to John Meacham.
src_all:=$(shell find $(SRCDIR) -type f -name '*hs' | egrep -v '^\./(_darcs|lib|test)/')