White space only
[ghc-hetmet.git] / rules / c-suffix-rules.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
14 define c-suffix-rules 
15 # $1 = dir
16 # $2 = distdir
17 # $3 = way
18 # $4 = use GHC (YES/NO)
19
20 # UseGhcForCc is only relevant when not booting from HC files.
21 ifeq "$4 $$(BootingFromHc)" "YES NO"
22
23 $1/$2/build/%.$$($3_osuf) : $1/%.c $$(MKDIRHIER) $$($1_$2_HC_DEP)
24         "$$(MKDIRHIER)" $$(dir $$@)
25         "$$($1_$2_HC)" $$($1_$2_$3_GHC_CC_OPTS) -c $$< -o $$@
26
27 $1/$2/build/%.$$($3_osuf) : $1/$2/build/%.c $$($1_$2_HC_DEP)
28         "$$($1_$2_HC)" $$($1_$2_$3_GHC_CC_OPTS) -c $$< -o $$@
29
30 $1/$2/build/%.$$($3_osuf) : $1/$2/build/%.$$($3_way_)s $$($1_$2_HC_DEP)
31         "$$($1_$2_HC)" $$($1_$2_$3_GHC_CC_OPTS) -c $$< -o $$@
32
33 $1/$2/build/%.$$($3_osuf) : $1/%.S $$(MKDIRHIER) $$($1_$2_HC_DEP)
34         "$$(MKDIRHIER)" $$(dir $$@)
35         "$$($1_$2_HC)" $$($1_$2_$3_GHC_CC_OPTS) -c $$< -o $$@
36
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 $$@
39
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 $$@
42
43 else
44
45 $1/$2/build/%.$$($3_osuf) : $1/%.c $$(MKDIRHIER)
46         "$$(MKDIRHIER)" $$(dir $$@)
47         "$$(CC)" $$($1_$2_$3_ALL_CC_OPTS) -c $$< -o $$@
48
49 $1/$2/build/%.$$($3_osuf) : $1/$2/build/%.c
50         "$$(CC)" $$($1_$2_$3_ALL_CC_OPTS) -c $$< -o $$@
51
52 $1/$2/build/%.$$($3_osuf) : $1/$2/build/%.$$($3_way_)s
53         "$$(AS)" $$($1_$2_$3_ALL_AS_OPTS) -o $$@ $$<
54
55 $1/$2/build/%.$$($3_osuf) : $1/%.S $$(MKDIRHIER)
56         "$$(MKDIRHIER)" $$(dir $$@)
57         "$$(CC)" $$($1_$2_$3_ALL_CC_OPTS) -c $$< -o $$@
58
59 $1/$2/build/%.$$($3_way_)s : $1/$2/build/%.c
60         "$$(CC)" $$($1_$2_$3_ALL_CC_OPTS) -S $$< -o $$@
61
62 endif
63
64 endef
65