Merge remote branch 'origin/master' into ghc-new-co
[ghc.git] / rules / cmm-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 cmm-suffix-rules
15 # $1 = dir
16 # $2 = distdir
17 # $3 = way
18
19 # .cmm files depend on all the .h files, to a first approximation.
20
21 ifneq "$$(CLEANING)" "YES"
22
23 ifneq "$$(BootingFromHc)" "YES"
24
25 $1/$2/build/%.$$($3_way_)o : $1/%.cmm $$(rts_H_FILES) $$(includes_H_FILES) $$($1_$2_HC_DEP) | $$$$(dir $$$$@)/.
26 "$$($1_$2_HC)" $$($1_$2_$3_MOST_HC_OPTS) -c $$< -o $$@
27
28 $1/$2/build/%.$$($3_way_)o : $1/$2/build/%.cmm $$(rts_H_FILES) $$(includes_H_FILES) $$($1_$2_HC_DEP) | $$$$(dir $$$$@)/.
29 "$$($1_$2_HC)" $$($1_$2_$3_MOST_HC_OPTS) -c $$< -o $$@
30
31 $1/$2/build/%.$$($3_way_)hc : $1/%.cmm $$(rts_H_FILES) $$(includes_H_FILES) $$($1_$2_HC_DEP) | $$$$(dir $$$$@)/.
32 "$$($1_$2_HC)" $$($1_$2_$3_MOST_HC_OPTS) -C $$< -o $$@
33
34 $1/$2/build/%.$$($3_way_)hc : $1/$2/build/%.cmm $$(rts_H_FILES) $$(includes_H_FILES) $$($1_$2_HC_DEP) | $$$$(dir $$$$@)/.
35 "$$($1_$2_HC)" $$($1_$2_$3_MOST_HC_OPTS) -C $$< -o $$@
36
37 # XXX
38 # When we started using "| $$$$(dir $$$$@)/." for directory deps, these
39 # rules started getting used when object splitting is enabled for some
40 # reason. But they fail with
41 # **splitmangle**: openBinaryFile: does not exist (No such file or directory)
42 # so for now they're commented out. They aren't needed, as we can always
43 # go directly to .o files.
44 #
45 # $1/$2/build/%.$$($3_way_)s : $1/%.cmm $$(rts_H_FILES) $$(includes_H_FILES) $$($1_$2_HC_DEP) | $$$$(dir $$$$@)/.
46 # "$$($1_$2_HC)" $$($1_$2_$3_MOST_HC_OPTS) -S $$< -o $$@
47 #
48 # $1/$2/build/%.$$($3_way_)s : $1/$2/build/%.cmm $$(rts_H_FILES) $$(includes_H_FILES) $$($1_$2_HC_DEP) | $$$$(dir $$$$@)/.
49 # "$$($1_$2_HC)" $$($1_$2_$3_MOST_HC_OPTS) -S $$< -o $$@
50
51 endif
52
53 endif
54
55 endef
56