@@ -44,6 +44,7 @@ PKGPATH := $(DATAPATH)/$(THIS)
44INSTALL := install -c
44INSTALL := install -c
45INSTALL_PROGRAM := $(INSTALL) -m 755
45INSTALL_PROGRAM := $(INSTALL) -m 755
46INSTALL_DATA := $(INSTALL) -m 644
46INSTALL_DATA := $(INSTALL) -m 644
48GHC_PKG := ghc-pkg
49GHC_PKG := ghc-pkg
@@ -59,6 +60,16 @@ templates: $(SRCDIR)/templates
59$(SRCDIR)/templates:
60$(SRCDIR)/templates:
60 $(MAKE) -C $(SRCDIR)/templates
61 $(MAKE) -C $(SRCDIR)/templates
63+# Document process rules.
65+ ./$(THIS) -s $^ >$@ || rm -f $@
67+ $(THIS) -s -w latex $^ >$@ || rm -f $@
69+ $(THIS) -s -w rtf $^ >$@ || rm -f $@
71+ sh ./markdown2pdf $^ || rm -f $@
62cleanup_files+=$(CABAL)
73cleanup_files+=$(CABAL)
63$(CABAL): cabalize $(CABAL).in
74$(CABAL): cabalize $(CABAL).in
64 ./cabalize <$(CABAL).in >$(CABAL)
75 ./cabalize <$(CABAL).in >$(CABAL)
@@ -153,13 +164,30 @@ uninstall-all: uninstall-exec uninstall-doc uninstall-lib-doc
153install: install-program
164install: install-program
154uninstall: uninstall-program
165uninstall: uninstall-program
169+doc_more:=README.rtf LICENSE.rtf
170+cleanup_files+=$(osx_dest) $(doc_more)
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
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."
156.PHONY: test test-markdown
186.PHONY: test test-markdown
157test: $(BINS)
187test: $(BINS)
158 @cd tests && perl runtests.pl -s $(PWD)/$(THIS)
188 @cd tests && perl runtests.pl -s $(PWD)/$(THIS)
159test-markdown: $(BINS)
189test-markdown: $(BINS)
160 @cd tests/MarkdownTest_1.0.3 && perl MarkdownTest.pl -s $(PWD)/$(THIS) -tidy
190 @cd tests/MarkdownTest_1.0.3 && perl MarkdownTest.pl -s $(PWD)/$(THIS) -tidy
162− ./$(THIS) -s $^ >$@ || rm -f $@
164# Stolen and slightly improved from a GPLed Makefile. Credits to John Meacham.
192# Stolen and slightly improved from a GPLed Makefile. Credits to John Meacham.
165src_all:=$(shell find $(SRCDIR) -type f -name '*hs' | egrep -v '^\./(_darcs|lib|test)/')
193src_all:=$(shell find $(SRCDIR) -type f -name '*hs' | egrep -v '^\./(_darcs|lib|test)/')