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 # -----------------------------------------------------------------------------
18 # $4 = use GHC (YES/NO)
20 ifneq "$$(BINDIST)" "YES"
22 # UseGhcForCc is only relevant when not booting from HC files.
23 ifeq "$4 $$(BootingFromHc)" "YES NO"
25 $1/$2/build/%.$$($3_osuf) : $1/%.c $$($1_$2_HC_DEP) | $$$$(dir $$$$@)/.
26 "$$($1_$2_HC)" $$($1_$2_$3_GHC_CC_OPTS) -c $$< -o $$@
28 $1/$2/build/%.$$($3_osuf) : $1/$2/build/%.c $$($1_$2_HC_DEP)
29 "$$($1_$2_HC)" $$($1_$2_$3_GHC_CC_OPTS) -c $$< -o $$@
31 $1/$2/build/%.$$($3_osuf) : $1/$2/build/%.$$($3_way_)s $$($1_$2_HC_DEP)
32 "$$($1_$2_HC)" $$($1_$2_$3_GHC_CC_OPTS) -c $$< -o $$@
34 $1/$2/build/%.$$($3_osuf) : $1/%.S $$($1_$2_HC_DEP) | $$$$(dir $$$$@)/.
35 "$$($1_$2_HC)" $$($1_$2_$3_GHC_CC_OPTS) -c $$< -o $$@
37 $1/$2/build/%.$$($3_way_)s : $1/$2/build/%.c $$($1_$2_HC_DEP)
38 "$$($1_$2_HC)" $$($1_$2_$3_GHC_CC_OPTS) -S $$< -o $$@
40 $1/$2/build/%.$$($3_way_)s : $1/%.c $$($1_$2_HC_DEP)
41 "$$($1_$2_HC)" $$($1_$2_$3_GHC_CC_OPTS) -S $$< -o $$@
45 $1/$2/build/%.$$($3_osuf) : $1/%.c | $$$$(dir $$$$@)/.
46 "$$($1_$2_CC)" $$($1_$2_$3_ALL_CC_OPTS) -c $$< -o $$@
48 $1/$2/build/%.$$($3_osuf) : $1/$2/build/%.c
49 "$$($1_$2_CC)" $$($1_$2_$3_ALL_CC_OPTS) -c $$< -o $$@
51 $1/$2/build/%.$$($3_osuf) : $1/$2/build/%.$$($3_way_)s
52 "$$(AS)" $$($1_$2_$3_ALL_AS_OPTS) -o $$@ $$<
54 $1/$2/build/%.$$($3_osuf) : $1/%.S | $$$$(dir $$$$@)/.
55 "$$($1_$2_CC)" $$($1_$2_$3_ALL_CC_OPTS) -c $$< -o $$@
57 $1/$2/build/%.$$($3_way_)s : $1/$2/build/%.c
58 "$$($1_$2_CC)" $$($1_$2_$3_ALL_CC_OPTS) -S $$< -o $$@