File: ghc.mk

package info (click to toggle)
ghc 8.0.1-17
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 55,080 kB
  • ctags: 9,332
  • sloc: haskell: 363,120; ansic: 54,900; sh: 4,782; makefile: 974; perl: 542; asm: 315; python: 306; xml: 154; lisp: 7
file content (67 lines) | stat: -rw-r--r-- 2,551 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# -----------------------------------------------------------------------------
#
# (c) 2009 The University of Glasgow
#
# This file is part of the GHC build system.
#
# To understand how the build system works and how to modify it, see
#      http://ghc.haskell.org/trac/ghc/wiki/Building/Architecture
#      http://ghc.haskell.org/trac/ghc/wiki/Building/Modifying
#
# -----------------------------------------------------------------------------

ifeq "$(GhcWithInterpreter)" "YES"
ifneq "$(Windows_Host)" "YES"

install: install_driver_ghci

.PHONY: install_driver_ghci
install_driver_ghci: WRAPPER=$(DESTDIR)$(bindir)/ghci-$(ProjectVersion)
install_driver_ghci:
	$(INSTALL_DIR) "$(DESTDIR)$(bindir)"
	$(call removeFiles,                                "$(WRAPPER)")
	$(CREATE_SCRIPT)                                   "$(WRAPPER)"
	echo '#!/bin/sh'                                >> "$(WRAPPER)"
	echo 'exec "$(bindir)/ghc-$(ProjectVersion)" --interactive "$$@"' >> "$(WRAPPER)"
	$(EXECUTABLE_FILE)                                 "$(WRAPPER)"
	$(call removeFiles,"$(DESTDIR)$(bindir)/ghci")
	$(LN_S) ghci-$(ProjectVersion) "$(DESTDIR)$(bindir)/ghci"

else # Windows_Host...

driver/ghci_dist_C_SRCS  = ghci.c ../utils/cwrapper.c ../utils/getLocation.c
driver/ghci_dist_CC_OPTS += -I driver/utils
driver/ghci_dist_PROGNAME = ghci
driver/ghci_dist_INSTALL = YES
driver/ghci_dist_INSTALL_INPLACE = YES
driver/ghci_dist_OTHER_OBJS = driver/ghci/ghci.res

$(eval $(call build-prog,driver/ghci,dist,1))

driver/ghci_dist_PROG_VER = ghci-$(ProjectVersion)$(exeext1)

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:
	$(INSTALL_DIR) "$(DESTDIR)$(bindir)"
	$(call removeFiles,"$(GHCII_SCRIPT)")
	echo "#!/bin/sh"                                        >> $(GHCII_SCRIPT)
	echo 'exec "$$(dirname "$$0")"/ghc --interactive "$$@"' >> $(GHCII_SCRIPT)
	$(EXECUTABLE_FILE) $(GHCII_SCRIPT)
	cp $(GHCII_SCRIPT) $(GHCII_SCRIPT_VERSIONED)
	$(EXECUTABLE_FILE) $(GHCII_SCRIPT_VERSIONED)

endif
endif