1 # -----------------------------------------------------------------------------
3 # (c) 2009 The University of Glasgow
5 # This file is part of the GHC build system.
7 # To understand how the build system works and how to modify it, see
8 # http://hackage.haskell.org/trac/ghc/wiki/Building/Architecture
9 # http://hackage.haskell.org/trac/ghc/wiki/Building/Modifying
11 # -----------------------------------------------------------------------------
13 ifneq "$(Windows)" "YES"
15 install: install_driver_ghci
17 .PHONY: install_driver_ghci
18 install_driver_ghci: WRAPPER=$(DESTDIR)$(bindir)/ghci-$(ProjectVersion)
20 $(INSTALL_DIR) "$(DESTDIR)$(bindir)"
21 "$(RM)" $(RM_OPTS) "$(WRAPPER)"
22 $(CREATE_SCRIPT) "$(WRAPPER)"
23 echo '#!$(SHELL)' >> "$(WRAPPER)"
24 echo 'exec "$(bindir)/ghc-$(ProjectVersion)" --interactive $${1+"$$@"}' >> "$(WRAPPER)"
25 $(EXECUTABLE_FILE) "$(WRAPPER)"
26 "$(RM)" $(RM_OPTS) "$(DESTDIR)$(bindir)/ghci"
27 $(LN_S) ghci-$(ProjectVersion) "$(DESTDIR)$(bindir)/ghci"
31 driver/ghci_dist_C_SRCS = ghci.c ../utils/cwrapper.c ../utils/getLocation.c
32 driver/ghci_dist_CC_OPTS += -I driver/utils
33 driver/ghci_dist_PROG = ghci$(exeext)
34 driver/ghci_dist_INSTALL = YES
35 driver/ghci_dist_OTHER_OBJS = driver/ghci/ghci.res
37 $(eval $(call build-prog,driver/ghci,dist,0))
39 driver/ghci_dist_PROG_VER = ghci-$(ProjectVersion)$(exeext)
41 INSTALL_BINS += driver/ghci/dist/build/tmp/$(driver/ghci_dist_PROG_VER)
43 driver/ghci/ghci.res : driver/ghci/ghci.rc driver/ghci/ghci.ico
44 $(INPLACE_MINGW)/bin/windres --preprocessor="$(CPP) -xc -DRC_INVOKED" -o driver/ghci/ghci.res -i driver/ghci/ghci.rc -O coff
46 driver/ghci/dist/build/tmp/$(driver/ghci_dist_PROG_VER) : driver/ghci/dist/build/tmp/$(driver/ghci_dist_PROG)
49 install : install_driver_ghcii
51 .PHONY: install_driver_ghcii
52 install_driver_ghcii: GHCII_SCRIPT=$(DESTDIR)$(bindir)/ghcii.sh
53 install_driver_ghcii: GHCII_SCRIPT_VERSIONED = $(DESTDIR)$(bindir)/ghcii-$(ProjectVersion).sh
55 $(INSTALL_DIR) $(DESTDIR)$(bindir)
56 "$(RM)" $(RM_OPTS) $(GHCII_SCRIPT)
57 echo "#!$(SHELL)" >> $(GHCII_SCRIPT)
58 echo 'exec "$$0"/../ghc --interactive $${1+"$$@"}' >> $(GHCII_SCRIPT)
59 $(EXECUTABLE_FILE) $(GHCII_SCRIPT)
60 cp $(GHCII_SCRIPT) $(GHCII_SCRIPT_VERSIONED)
61 $(EXECUTABLE_FILE) $(GHCII_SCRIPT_VERSIONED)