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 # -----------------------------------------------------------------------------
14 define cmm-suffix-rules
19 # .cmm files depend on all the .h files, to a first approximation.
21 ifneq "$$(CLEANING)" "YES"
23 ifneq "$$(BootingFromHc)" "YES"
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
$$@
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
$$@
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
$$@
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
$$@
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.
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 $$@
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 $$@