aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorroktas <roktas@788f1e2b-df1e-0410-8736-df70ead52e1b>2006-11-11 10:35:10 +0000
committerroktas <roktas@788f1e2b-df1e-0410-8736-df70ead52e1b>2006-11-11 10:35:10 +0000
commitfa645eed392881ae024dc15d1f638def5006f409 (patch)
treecb758da4b81bb43de84c6f980ddea8e9f975b8ee /Makefile
parentcaf7e1ca0fe0681e22fa93364ecfec4ff8637f07 (diff)
downloadpandoc-fa645eed392881ae024dc15d1f638def5006f409.tar.gz
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
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile34
1 files changed, 15 insertions, 19 deletions
diff --git a/Makefile b/Makefile
index 1d175aa20..650fbc2d1 100644
--- a/Makefile
+++ b/Makefile
@@ -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