git.iko.soy/typeable/pandoc
on master help sign in
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

commit52f07a04b579e7c3a35d8cf9d27593d38f83d182 authorroktas <roktas@788f1e2b-df1e-0410-8736-df70ead52e1b> dateMon 30 Oct 2006, 06:41 (20 years ago) parentfe92360
1 file changed+30−2
Makefile+30−2
Makefile+30−2
@@ -44,6 +44,7 @@ PKGPATH := $(DATAPATH)/$(THIS)
4444INSTALL := install -c
4545INSTALL_PROGRAM := $(INSTALL) -m 755
4646INSTALL_DATA := $(INSTALL) -m 644
47+STRIP := strip
4748GHC := ghc
4849GHC_PKG := ghc-pkg
4950
@@ -59,6 +60,16 @@ templates: $(SRCDIR)/templates
5960$(SRCDIR)/templates:
6061 $(MAKE) -C $(SRCDIR)/templates
6162
63+# Document process rules.
64+%.html: %
65+ ./$(THIS) -s $^ >$@ || rm -f $@
66+%.tex: %
67+ $(THIS) -s -w latex $^ >$@ || rm -f $@
68+%.rtf: %
69+ $(THIS) -s -w rtf $^ >$@ || rm -f $@
70+%.pdf: %
71+ sh ./markdown2pdf $^ || rm -f $@
72+
6273cleanup_files+=$(CABAL)
6374$(CABAL): cabalize $(CABAL).in
6475 ./cabalize <$(CABAL).in >$(CABAL)
@@ -153,13 +164,30 @@ uninstall-all: uninstall-exec uninstall-doc uninstall-lib-doc
153164install: install-program
154165uninstall: uninstall-program
155166
167+.PHONY: osx-pkg
168+osx_dest:=osx-pkg
169+doc_more:=README.rtf LICENSE.rtf
170+cleanup_files+=$(osx_dest) $(doc_more)
171+osx-pkg: $(doc_more)
172+ -rm -rf $(osx_dest)
173+ $(INSTALL) -d $(osx_dest)
174+ DESTDIR=$(osx_dest) $(MAKE) install-program
175+ find $(osx_dest) -type f -regex ".*bin/.*" | xargs chmod +x
176+ find $(osx_dest) -type f -regex ".*bin/$(THIS)" | xargs $(STRIP)
177+ $(INSTALL) -d $(osx_dest)/Resources
178+ mv README.rtf $(osx_dest)/Resources/ReadMe.rtf
179+ mv LICENSE.rtf $(osx_dest)/Resources/License.rtf
180+ @echo
181+ @echo "You may now run PackageMaker.app. For Root, specify"
182+ @echo "osx-pkg/Package_Root. The ReadMe.rtf and License.rtf files"
183+ @echo "can be found in osx-pkg/Resources."
184+ @echo
185+
156186.PHONY: test test-markdown
157187test: $(BINS)
158188 @cd tests && perl runtests.pl -s $(PWD)/$(THIS)
159189test-markdown: $(BINS)
160190 @cd tests/MarkdownTest_1.0.3 && perl MarkdownTest.pl -s $(PWD)/$(THIS) -tidy
161−%.html: %
162− ./$(THIS) -s $^ >$@ || rm -f $@
163191
164192# Stolen and slightly improved from a GPLed Makefile. Credits to John Meacham.
165193src_all:=$(shell find $(SRCDIR) -type f -name '*hs' | egrep -v '^\./(_darcs|lib|test)/')