summaryrefslogtreecommitdiff
path: root/driver/ghci/ghc.mk
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2009-04-26 11:42:15 +0000
committerIan Lynagh <igloo@earth.li>2009-04-26 11:42:15 +0000
commit34cc75e1a62638f2833815746ebce0a9114dc26b (patch)
treeef21e8fd7af1356beea9cce7d6efb8a65374e24c /driver/ghci/ghc.mk
parent74e1368d4688ee16f6decdf2cd3ebe27506b26ba (diff)
downloadhaskell-34cc75e1a62638f2833815746ebce0a9114dc26b.tar.gz
GHC new build system megapatch
Diffstat (limited to 'driver/ghci/ghc.mk')
-rw-r--r--driver/ghci/ghc.mk50
1 files changed, 50 insertions, 0 deletions
diff --git a/driver/ghci/ghc.mk b/driver/ghci/ghc.mk
new file mode 100644
index 0000000000..14e27123a7
--- /dev/null
+++ b/driver/ghci/ghc.mk
@@ -0,0 +1,50 @@
+ifneq "$(Windows)" "YES"
+
+install: install_driver_ghci
+
+.PHONY: install_driver_ghci
+install_driver_ghci: WRAPPER=$(DESTDIR)$(bindir)/ghci-$(ProjectVersion)
+install_driver_ghci:
+ $(MKDIRHIER) $(DESTDIR)$(bindir)
+ $(RM) -f $(WRAPPER)
+ echo '#!$(SHELL)' >> $(WRAPPER)
+ echo 'exec $(bindir)/ghc-$(ProjectVersion) --interactive ${1+"$@"}' >> $(WRAPPER)
+ $(EXECUTABLE_FILE) $(WRAPPER)
+ $(RM) -f $(DESTDIR)$(bindir)/ghci
+ $(LN_S) ghci-$(ProjectVersion) $(DESTDIR)$(bindir)/ghci
+
+else # Windows...
+
+driver/ghci_dist_C_SRCS = ghci.c
+driver/ghci_dist_PROG = ghci$(exeext)
+driver/ghci_dist_INSTALL = YES
+driver/ghci_dist_OTHER_OBJS = driver/ghci/ghci.res
+
+$(eval $(call build-prog,driver/ghci,dist,0))
+
+driver/ghci_dist_PROG_VER = ghci-$(ProjectVersion)$(exeext)
+
+INSTALL_BINS += driver/ghci/dist/build/tmp/$(driver/ghci_dist_PROG_VER)
+
+driver/ghci/ghci.res : driver/ghci/ghci.rc driver/ghci/ghci.ico
+ windres --preprocessor="$(CPP) -xc -DRC_INVOKED" -o driver/ghci/ghci.res -i driver/ghci/ghci.rc -O coff
+
+driver/ghci/dist/build/tmp/$(driver/ghci_dist_PROG_VER) : driver/ghci/dist/build/tmp/$(driver/ghci_dist_PROG)
+ $(CP) $< $@
+
+install : install_driver_ghcii
+
+.PHONY: install_driver_ghcii
+install_driver_ghcii: GHCII_SCRIPT=$(DESTDIR)$(bindir)/ghcii.sh
+install_driver_ghcii: GHCII_SCRIPT_VERSIONED = $(DESTDIR)$(bindir)/ghcii-$(ProjectVersion).sh
+install_driver_ghcii:
+ $(MKDIRHIER) $(DESTDIR)$(bindir)
+ $(RM) -f $(GHCII_SCRIPT)
+ echo "#!$(SHELL)" >> $(GHCII_SCRIPT)
+ echo 'exec "$$0"/../ghc --interactive $${1+"$$@"}' >> $(GHCII_SCRIPT)
+ $(EXECUTABLE_FILE) $(GHCII_SCRIPT)
+ cp $(GHCII_SCRIPT) $(GHCII_SCRIPT_VERSIONED)
+ $(EXECUTABLE_FILE) $(GHCII_SCRIPT_VERSIONED)
+
+endif
+