diff options
author | roktas <roktas@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2006-11-16 02:37:25 +0000 |
---|---|---|
committer | roktas <roktas@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2006-11-16 02:37:25 +0000 |
commit | 83077346a1464686e6439d81fee391a60a7225b8 (patch) | |
tree | c57c23b4744139b2f0749a10e54edf97758cdcda | |
parent | d5d81b0b53174143fa19e17bf77c0d55b9a90d7a (diff) | |
download | pandoc-83077346a1464686e6439d81fee391a60a7225b8.tar.gz |
Using hardcoded executable paths in Makefile doesn't work. While GHC
6.6 Cabal builds executables in dist/build/$executable, older Cabal
versions use dist/build/src. To cope with this situation:
+ Revert to old code which determines executable paths dynamically.
+ Create symlinks to the compiled executables in top directory. Make sure
to not touch symlinks once they've been created.
+ As PROGS variable can now contain symlinks, determine the actual file
during installation.
+ Replace EXECNAMES with EXECS, as the former became a redundant name due
to these changes.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@104 788f1e2b-df1e-0410-8736-df70ead52e1b
-rw-r--r-- | Makefile | 20 |
1 files changed, 15 insertions, 5 deletions
@@ -17,14 +17,13 @@ CONFIGURE := configure #------------------------------------------------------------------------------- NAME := $(shell sed -ne 's/^[Nn]ame:[[:space:]]*//p' $(CABAL).in) VERSION := $(shell sed -ne 's/^[Vv]ersion:[[:space:]]*//p' $(CABAL).in) -EXECNAMES := $(shell sed -ne 's/^[Ee]xecutable:[[: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 := $(firstword $(EXECS)) #------------------------------------------------------------------------------- # 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 @@ -108,6 +107,12 @@ build: templates configure build-exec: $(EXECS) cleanup_files+=$(EXECS) $(EXECS): build + for f in $@; do \ + [ -f $$f ] || { \ + find $(BUILDDIR) -type f -name "$$f" \ + -perm +a=x -exec ln -s {} . \; ; \ + } \ + done .PHONY: build-doc cleanup_files+=README.html @@ -153,7 +158,12 @@ uninstall-lib-doc: .PHONY: install-exec uninstall-exec install-exec: build-exec $(INSTALL) -d $(BINPATH); \ - for f in $(PROGS); do $(INSTALL_PROGRAM) $$f $(BINPATH)/; done + for f in $(PROGS); do \ + if [ -L $$f ]; then \ + f=$$(readlink $$f); \ + fi; \ + $(INSTALL_PROGRAM) $$f $(BINPATH)/; \ + done uninstall-exec: -for f in $(notdir $(PROGS)); do rm -f $(BINPATH)/$$f; done |