diff options
-rw-r--r-- | Makefile | 34 |
1 files changed, 15 insertions, 19 deletions
@@ -1,35 +1,34 @@ # Makefile for Pandoc. +#------------------------------------------------------------------------------- +# Constant names and commands in source tree +#------------------------------------------------------------------------------- CABAL := Pandoc.cabal +SRCDIR := src +MANDIR := man +BUILDDIR := dist +BUILDCONF := .setup-config +BUILDCMD := runhaskell Setup.hs +BUILDVARS := vars +CONFIGURE := configure #------------------------------------------------------------------------------- # Cabal constants #------------------------------------------------------------------------------- NAME := $(shell sed -ne 's/^[Nn]ame:[[:space:]]*//p' $(CABAL).in) VERSION := $(shell sed -ne 's/^[Vv]ersion:[[:space:]]*//p' $(CABAL).in) -EXECS := $(shell sed -ne 's/^[Ee]xecutable:[[:space:]]*//p' $(CABAL).in) - -# First entry in Cabal's executable stanza is the main executable. -MAIN := $(word 1, $(EXECS)) +EXECNAMES := $(shell sed -ne 's/^[Ee]xecutable:[[:space:]]*//p' $(CABAL).in) #------------------------------------------------------------------------------- # Install targets #------------------------------------------------------------------------------- +EXECS :=$(join $(patsubst %,$(BUILDDIR)/build/%/,$(EXECNAMES)),$(EXECNAMES)) +# First entry in Cabal's executable stanza is the main executable. +MAIN := $(firstword $(EXECS)) PROGS := $(EXECS) html2markdown markdown2html latex2markdown markdown2latex markdown2pdf DOCS := README.html README BUGS TODO #------------------------------------------------------------------------------- -# Constant names and commands in source tree -#------------------------------------------------------------------------------- -SRCDIR := src -MANDIR := man -BUILDDIR := dist -BUILDCONF := .setup-config -BUILDCMD := runhaskell Setup.hs -BUILDVARS := vars -CONFIGURE := configure - -#------------------------------------------------------------------------------- # Variables to setup through environment #------------------------------------------------------------------------------- @@ -109,9 +108,6 @@ build: templates configure build-exec: $(EXECS) cleanup_files+=$(EXECS) $(EXECS): build - for f in $@; do \ - find $(BUILDDIR) -type f -name "$$f" -perm +a=x -exec cp -p {} . \; ; \ - done .PHONY: build-doc cleanup_files+=README.html @@ -207,7 +203,7 @@ $(osx_dest)/: $(doc_more) DESTDIR=$(osx_dest)/Package_root $(MAKE) install-program cp $(osx_src)/uninstall-pandoc $(osx_dest)/Package_root/usr/local/bin/ find $(osx_dest) -type f -regex ".*bin/.*" | xargs chmod +x - find $(osx_dest) -type f -regex ".*bin/$(MAIN)" | xargs $(STRIP) + find $(osx_dest) -type f -regex ".*bin/$(notdir $(MAIN))" | xargs $(STRIP) $(INSTALL) -d $(osx_dest)/Resources cp README.rtf $(osx_dest)/Resources/ReadMe.rtf cp LICENSE.rtf $(osx_dest)/Resources/License.rtf |