Keep separate linker flags, for when we want to link with gcc or ld
[ghc-hetmet.git] / rules / include-dependencies.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://hackage.haskell.org/trac/ghc/wiki/Building/Architecture
9 #      http://hackage.haskell.org/trac/ghc/wiki/Building/Modifying
10 #
11 # -----------------------------------------------------------------------------
12
13 define include-dependencies
14 $(call trace, include-dependencies($1,$2,$3))
15 $(call profStart, include-dependencies($1,$2,$3))
16 # $1 = dir
17 # $2 = distdir
18 # $3 = GHC stage to use (0 == bootstrapping compiler)
19
20 ifneq "$$(NO_INCLUDE_DEPS)" "YES"
21 ifneq "$$(strip $$($1_$2_HS_SRCS) $$($1_$2_HS_BOOT_SRCS))" ""
22 ifneq "$$(NO_STAGE$3_DEPS)" "YES"
23 include $$($1_$2_depfile_haskell)
24 endif
25 endif
26 include $$($1_$2_depfile_c_asm)
27 else
28 ifeq "$$(DEBUG)" "YES"
29 $$(warning not building dependencies in $1)
30 endif
31 endif
32
33 $(call profEnd, include-dependencies($1,$2,$3))
34 endef
35