@@ -1,34 +1,33 @@
1# Makefile for Pandoc.
1# Makefile for Pandoc.
3+#-------------------------------------------------------------------------------
4+# Constant names and commands in source tree
5+#-------------------------------------------------------------------------------
3CABAL := Pandoc.cabal
6CABAL := Pandoc.cabal
10+BUILDCONF := .setup-config
11+BUILDCMD := runhaskell Setup.hs
13+CONFIGURE := configure
5#-------------------------------------------------------------------------------
15#-------------------------------------------------------------------------------
6# Cabal constants
16# Cabal constants
7#-------------------------------------------------------------------------------
17#-------------------------------------------------------------------------------
8NAME := $(shell sed -ne 's/^[Nn]ame:[[:space:]]*//p' $(CABAL).in)
18NAME := $(shell sed -ne 's/^[Nn]ame:[[:space:]]*//p' $(CABAL).in)
9VERSION := $(shell sed -ne 's/^[Vv]ersion:[[:space:]]*//p' $(CABAL).in)
19VERSION := $(shell sed -ne 's/^[Vv]ersion:[[:space:]]*//p' $(CABAL).in)
10−EXECS := $(shell sed -ne 's/^[Ee]xecutable:[[:space:]]*//p' $(CABAL).in)
20+EXECNAMES := $(shell sed -ne 's/^[Ee]xecutable:[[:space:]]*//p' $(CABAL).in)
12−# First entry in Cabal's executable stanza is the main executable.
13−MAIN := $(word 1, $(EXECS))
15#-------------------------------------------------------------------------------
22#-------------------------------------------------------------------------------
16# Install targets
23# Install targets
17#-------------------------------------------------------------------------------
24#-------------------------------------------------------------------------------
25+EXECS :=$(join $(patsubst %,$(BUILDDIR)/build/%/,$(EXECNAMES)),$(EXECNAMES))
26+# First entry in Cabal's executable stanza is the main executable.
27+MAIN := $(firstword $(EXECS))
18PROGS := $(EXECS) html2markdown markdown2html latex2markdown markdown2latex markdown2pdf
28PROGS := $(EXECS) html2markdown markdown2html latex2markdown markdown2latex markdown2pdf
19DOCS := README.html README BUGS TODO
29DOCS := README.html README BUGS TODO
21−#-------------------------------------------------------------------------------
22−# Constant names and commands in source tree
23−#-------------------------------------------------------------------------------
27−BUILDCONF := .setup-config
28−BUILDCMD := runhaskell Setup.hs
30−CONFIGURE := configure
32#-------------------------------------------------------------------------------
31#-------------------------------------------------------------------------------
33# Variables to setup through environment
32# Variables to setup through environment
34#-------------------------------------------------------------------------------
33#-------------------------------------------------------------------------------
@@ -109,9 +108,6 @@ build: templates configure
109build-exec: $(EXECS)
108build-exec: $(EXECS)
110cleanup_files+=$(EXECS)
109cleanup_files+=$(EXECS)
111$(EXECS): build
110$(EXECS): build
113− find $(BUILDDIR) -type f -name "$$f" -perm +a=x -exec cp -p {} . \; ; \
116.PHONY: build-doc
112.PHONY: build-doc
117cleanup_files+=README.html
113cleanup_files+=README.html
@@ -207,7 +203,7 @@ $(osx_dest)/: $(doc_more)
207 DESTDIR=$(osx_dest)/Package_root $(MAKE) install-program
203 DESTDIR=$(osx_dest)/Package_root $(MAKE) install-program
208 cp $(osx_src)/uninstall-pandoc $(osx_dest)/Package_root/usr/local/bin/
204 cp $(osx_src)/uninstall-pandoc $(osx_dest)/Package_root/usr/local/bin/
209 find $(osx_dest) -type f -regex ".*bin/.*" | xargs chmod +x
205 find $(osx_dest) -type f -regex ".*bin/.*" | xargs chmod +x
210− find $(osx_dest) -type f -regex ".*bin/$(MAIN)" | xargs $(STRIP)
206+ find $(osx_dest) -type f -regex ".*bin/$(notdir $(MAIN))" | xargs $(STRIP)
211 $(INSTALL) -d $(osx_dest)/Resources
207 $(INSTALL) -d $(osx_dest)/Resources
212 cp README.rtf $(osx_dest)/Resources/ReadMe.rtf
208 cp README.rtf $(osx_dest)/Resources/ReadMe.rtf
213 cp LICENSE.rtf $(osx_dest)/Resources/License.rtf
209 cp LICENSE.rtf $(osx_dest)/Resources/License.rtf