add $(CrossCompilePrefix) to 'runghc' and 'ghci'
[ghc.git] / utils / runghc / ghc.mk
1 # -----------------------------------------------------------------------------
2 #
3 # (c) 2009 The University of Glasgow
4 #
5 # This file is part of the GHC build system.
6 #
7 # To understand how the build system works and how to modify it, see
8 # http://ghc.haskell.org/trac/ghc/wiki/Building/Architecture
9 # http://ghc.haskell.org/trac/ghc/wiki/Building/Modifying
10 #
11 # -----------------------------------------------------------------------------
12
13 utils/runghc_PACKAGE = runghc
14 utils/runghc_dist-install_USES_CABAL = YES
15 utils/runghc_dist-install_PROGNAME = runghc
16 utils/runghc_dist-install_SHELL_WRAPPER = YES
17 utils/runghc_dist-install_INSTALL = YES
18 utils/runghc_dist-install_INSTALL_INPLACE = YES
19 utils/runghc_dist-install_INSTALL_SHELL_WRAPPER_NAME = runghc-$(ProjectVersion)
20 utils/runghc_dist-install_EXTRA_HC_OPTS = -cpp -DVERSION="\"$(ProjectVersion)\""
21
22 # Be explicit about which version of ghc to call (#9054).
23 define utils/runghc_dist-install_INPLACE_SHELL_WRAPPER_EXTRA
24 echo 'ghcprog="$(ghc_stage2_INPLACE_SHELL_WRAPPER_NAME)"' >> "$(WRAPPER)"
25 endef
26 define utils/runghc_dist-install_INSTALL_SHELL_WRAPPER_EXTRA
27 echo 'ghcprog="$(ghc_stage$(INSTALL_GHC_STAGE)_INSTALL_SHELL_WRAPPER_NAME)"' >> "$(WRAPPER)"
28 endef
29
30 $(eval $(call build-prog,utils/runghc,dist-install,1))
31
32 install: install_runhaskell
33
34 .PHONY: install_runhaskell
35 ifeq "$(Windows_Host)" "YES"
36 install_runhaskell: install_bins
37 "$(CP)" $(DESTDIR)$(bindir)/$(CrossCompilePrefix)runghc$(exeext1) $(DESTDIR)$(bindir)/$(CrossCompilePrefix)runhaskell$(exeext1)
38 else
39 install_runhaskell:
40 $(call removeFiles,"$(DESTDIR)$(bindir)/$(CrossCompilePrefix)runhaskell")
41 $(LN_S) $(CrossCompilePrefix)runghc "$(DESTDIR)$(bindir)/$(CrossCompilePrefix)runhaskell"
42 $(call removeFiles,"$(DESTDIR)$(bindir)/$(CrossCompilePrefix)runghc")
43 $(LN_S) $(CrossCompilePrefix)runghc-$(ProjectVersion) "$(DESTDIR)$(bindir)/$(CrossCompilePrefix)runghc"
44 endif