summaryrefslogtreecommitdiff
path: root/utils/runghc/ghc.mk
diff options
context:
space:
mode:
Diffstat (limited to 'utils/runghc/ghc.mk')
-rw-r--r--utils/runghc/ghc.mk29
1 files changed, 29 insertions, 0 deletions
diff --git a/utils/runghc/ghc.mk b/utils/runghc/ghc.mk
new file mode 100644
index 0000000000..1eb2d87c47
--- /dev/null
+++ b/utils/runghc/ghc.mk
@@ -0,0 +1,29 @@
+utils/runghc_dist_MODULES = Main
+utils/runghc_dist_HC_OPTS = -cpp -DVERSION="\"$(ProjectVersion)\""
+utils/runghc_dist_PROG = runghc$(exeext)
+utils/runghc_dist_SHELL_WRAPPER = YES
+utils/runghc_dist_INSTALL_SHELL_WRAPPER = YES
+
+ifneq "$(BINDIST)" "YES"
+
+# hack: the build system has trouble with Main modules not called Main.hs
+utils/runghc/dist/build/Main.hs : utils/runghc/runghc.hs $(MKDIRHIER)
+ $(MKDIRHIER) $(dir $@)
+ $(CP) $< $@
+
+$(eval $(call build-prog,utils/runghc,dist,1))
+
+endif
+
+install: install_runhaskell
+
+.PHONY: install_runhaskell
+ifeq "$(Windows)" "YES"
+install_runhaskell: install_bins
+ $(CP) $(DESTDIR)$(bindir)/runghc$(exeext) $(DESTDIR)$(bindir)/runhaskell$(exeext)
+else
+install_runhaskell:
+ $(RM) $(DESTDIR)$(bindir)/runhaskell
+ $(LN_S) runghc $(DESTDIR)$(bindir)/runhaskell
+endif
+