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 # UseGhcForCc is only relevant when not booting from HC files.
21 ifeq "$4 $$(BootingFromHc)" "YES NO"
23 $1/$2/build/%.$$($3_osuf) : $1/%.c $$(MKDIRHIER) $$($1_$2_HC_DEP)
25 $$(MKDIRHIER) $$(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)
30 $$($1_$2_HC) $$($1_$2_$3_GHC_CC_OPTS) -c $$< -o $$@
32 $1/$2/build/%.$$($3_osuf) : $1/$2/build/%.$$($3_way_)s $$($1_$2_HC_DEP)
34 $$($1_$2_HC) $$($1_$2_$3_GHC_CC_OPTS) -c $$< -o $$@
36 $1/$2/build/%.$$($3_osuf) : $1/%.S $$(MKDIRHIER) $$($1_$2_HC_DEP)
38 $$(MKDIRHIER) $$(dir $$@)
39 $$($1_$2_HC) $$($1_$2_$3_GHC_CC_OPTS) -c $$< -o $$@
41 $1/$2/build/%.$$($3_way_)s : $1/$2/build/%.c $$($1_$2_HC_DEP)
43 $$($1_$2_HC) $$($1_$2_$3_GHC_CC_OPTS) -S $$< -o $$@
45 $1/$2/build/%.$$($3_way_)s : $1/%.c $$($1_$2_HC_DEP)
47 $$($1_$2_HC) $$($1_$2_$3_GHC_CC_OPTS) -S $$< -o $$@
51 $1/$2/build/%.$$($3_osuf) : $1/%.c $$(MKDIRHIER)
53 $$(MKDIRHIER) $$(dir $$@)
54 $$(CC) $$($1_$2_$3_ALL_CC_OPTS) -c $$< -o $$@
56 $1/$2/build/%.$$($3_osuf) : $1/$2/build/%.c
58 $$(CC) $$($1_$2_$3_ALL_CC_OPTS) -c $$< -o $$@
60 $1/$2/build/%.$$($3_osuf) : $1/$2/build/%.$$($3_way_)s
62 $$(AS) $$($1_$2_$3_ALL_AS_OPTS) -o $$@ $$<
64 $1/$2/build/%.$$($3_osuf) : $1/%.S $$(MKDIRHIER)
66 $$(MKDIRHIER) $$(dir $$@)
67 $$(CC) $$($1_$2_$3_ALL_CC_OPTS) -c $$< -o $$@
69 $1/$2/build/%.$$($3_way_)s : $1/$2/build/%.c
71 $$(CC) $$($1_$2_$3_ALL_CC_OPTS) -S $$< -o $$@