summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2007-11-25 01:51:36 +0000
committerfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2007-11-25 01:51:36 +0000
commit99d8d45b744c98f08e12296667efebef52bfc8b6 (patch)
treecce59f311e629ce0b823e95f09a3e46d7f409dee /Makefile
parent3703f625be18201be1e6bb87235ada1b39029290 (diff)
+ Makefile now checks GHC version. If GHC is 6.6, pandoc.cabal.ghc66
is copied to pandoc.cabal, and the old pandoc.cabal is copied to pandoc.cabal.orig. Otherwise, pandoc.cabal is copied to pandoc.cabal.orig but otherwise unmodified. This way, the Makefile will work properly with either GHC 6.6 or 6.8. + The changes in debian/rules from r1066 have been reverted, since they are no longer needed. Also, debian/rules has been converted to UTF-8. + INSTALL instructions have been updated accordingly. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1095 788f1e2b-df1e-0410-8736-df70ead52e1b
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile13
1 files changed, 11 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index dd3a47339..eb132eade 100644
--- a/Makefile
+++ b/Makefile
@@ -68,6 +68,7 @@ INSTALL_DATA := $(INSTALL) -m 644
STRIP := strip
GHC ?= ghc
GHC_PKG ?= ghc-pkg
+GHC_VERSION := $(shell $(GHC) --version | sed -e 's/[^0-9]*//')
#-------------------------------------------------------------------------------
# Recipes
@@ -116,12 +117,20 @@ cleanup_files+=$(WRAPPERS)
$(WRAPPERS): %: $(SRCDIR)/wrappers/%.in $(SRCDIR)/wrappers/*.sh
@$(generate-shell-script)
+CABAL_BACKUP=$(CABAL).orig
+cleanup_files+=$(CABAL_BACKUP)
+$(CABAL_BACKUP):
+ cp $(CABAL) $(CABAL_BACKUP) ; \
+ if echo $(GHC_VERSION) | grep -q '^6.6'; then \
+ cp $(CABAL).ghc66 $(CABAL); \
+ fi
+
.PHONY: configure
cleanup_files+=Setup.hi Setup.o $(BUILDCMD) $(BUILDVARS)
configure: $(BUILDCONF) templates
-$(BUILDCONF): $(CABAL)
+$(BUILDCONF): $(CABAL) $(CABAL_BACKUP)
$(GHC) -package Cabal Setup.hs -o $(BUILDCMD)
- $(BUILDCMD) configure --prefix=$(PREFIX)
+ $(BUILDCMD) configure --prefix=$(PREFIX) --with-compiler=$(GHC) --with-hc-pkg=$(GHC_PKG)
# Make configuration time settings persistent (definitely a hack).
@echo "PREFIX?=$(PREFIX)" >$(BUILDVARS)
@echo "DESTDIR?=$(DESTDIR)" >>$(BUILDVARS)