From fa645eed392881ae024dc15d1f638def5006f409 Mon Sep 17 00:00:00 2001 From: roktas Date: Sat, 11 Nov 2006 10:35:10 +0000 Subject: Use compiled executables directly from their build directory, without copying them to the top directory. git-svn-id: https://pandoc.googlecode.com/svn/trunk@89 788f1e2b-df1e-0410-8736-df70ead52e1b --- Makefile | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/Makefile b/Makefile index 1d175aa20..650fbc2d1 100644 --- a/Makefile +++ b/Makefile @@ -1,34 +1,33 @@ # 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 -- cgit v1.2.3