Fix isDroppableCt (Trac #14763)
[ghc.git] / iserv / ghc.mk
1 # -----------------------------------------------------------------------------
2 #
3 # (c) 2009-2012 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 iserv_USES_CABAL = YES
14 iserv_PACKAGE = iserv-bin
15 iserv_EXECUTABLE = iserv
16
17 ifeq "$(GhcDebugged)" "YES"
18 iserv_stage2_MORE_HC_OPTS += -debug
19 iserv_stage2_p_MORE_HC_OPTS += -debug
20 iserv_stage2_dyn_MORE_HC_OPTS += -debug
21 endif
22
23 ifeq "$(GhcThreaded)" "YES"
24 iserv_stage2_MORE_HC_OPTS += -threaded
25 iserv_stage2_p_MORE_HC_OPTS += -threaded
26 iserv_stage2_dyn_MORE_HC_OPTS += -threaded
27 endif
28
29 # Add -Wl,--export-dynamic enables GHCi to load dynamic objects that
30 # refer to the RTS. This is harmless if you don't use it (adds a bit
31 # of overhead to startup and increases the binary sizes) but if you
32 # need it there's no alternative.
33 ifeq "$(TargetElf)" "YES"
34 ifneq "$(TargetOS_CPP)" "solaris2"
35 # The Solaris linker does not support --export-dynamic option. It also
36 # does not need it since it exports all dynamic symbols by default
37 iserv_stage2_MORE_HC_OPTS += -optl-Wl,--export-dynamic
38 iserv_stage2_p_MORE_HC_OPTS += -optl-Wl,--export-dynamic
39 iserv_stage2_dyn_MORE_HC_OPTS += -optl-Wl,--export-dynamic
40 endif
41 endif
42
43 # Override the default way, because we want a specific version of this
44 # program for each way. Note that it's important to do this even for
45 # the vanilla version, otherwise we get a dynamic executable when
46 # DYNAMIC_GHC_PROGRAMS=YES.
47 iserv_stage2_PROGRAM_WAY = v
48 iserv_stage2_p_PROGRAM_WAY = p
49 iserv_stage2_dyn_PROGRAM_WAY = dyn
50
51 iserv_stage2_PROGNAME = ghc-iserv
52 iserv_stage2_p_PROGNAME = ghc-iserv-prof
53 iserv_stage2_dyn_PROGNAME = ghc-iserv-dyn
54
55 iserv_stage2_MORE_HC_OPTS += -no-hs-main
56 iserv_stage2_p_MORE_HC_OPTS += -no-hs-main
57 iserv_stage2_dyn_MORE_HC_OPTS += -no-hs-main
58
59 iserv_stage2_INSTALL = YES
60 iserv_stage2_p_INSTALL = YES
61 iserv_stage2_dyn_INSTALL = YES
62
63 # Install in $(libexec), not in $(bindir)
64 iserv_stage2_TOPDIR = YES
65 iserv_stage2_p_TOPDIR = YES
66 iserv_stage2_dyn_TOPDIR = YES
67
68 iserv_stage2_INSTALL_INPLACE = YES
69 iserv_stage2_p_INSTALL_INPLACE = YES
70 iserv_stage2_dyn_INSTALL_INPLACE = YES
71
72 ifeq "$(CLEANING)" "YES"
73
74 NEED_iserv = YES
75 NEED_iserv_p = YES
76 NEED_iserv_dyn = YES
77
78 else
79
80 ifneq "$(findstring v, $(GhcLibWays))" ""
81 NEED_iserv = YES
82 else
83 NEED_iserv = NO
84 endif
85
86 ifneq "$(findstring p, $(GhcLibWays))" ""
87 NEED_iserv_p = YES
88 else
89 NEED_iserv_p = NO
90 endif
91
92 ifneq "$(findstring dyn, $(GhcLibWays))" ""
93 NEED_iserv_dyn = YES
94 else
95 NEED_iserv_dyn = NO
96 endif
97 endif
98
99 ifeq "$(NEED_iserv)" "YES"
100 $(eval $(call build-prog,iserv,stage2,1))
101 endif
102
103 ifeq "$(NEED_iserv_p)" "YES"
104 $(eval $(call build-prog,iserv,stage2_p,1))
105 endif
106
107 ifeq "$(NEED_iserv_dyn)" "YES"
108 $(eval $(call build-prog,iserv,stage2_dyn,1))
109 endif
110
111 all_ghc_stage2 : $(iserv-stage2_INPLACE)
112 all_ghc_stage2 : $(iserv-stage2_p_INPLACE)
113 all_ghc_stage2 : $(iserv-stage2_dyn_INPLACE)