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