708c1b289ad5029fc303539bdad6416647df45a0
[ghc-hetmet.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) $$($1_$2_HC_DEP)
26         "$$(MKDIRHIER)" $$(dir $$@)
27         "$$($1_$2_HC)" $$($1_$2_$3_MOST_HC_OPTS) -c $$< -o $$@
28
29 $1/$2/build/%.$$($3_way_)o : $1/$2/build/%.cmm $$(rts_H_FILES) $$($1_$2_HC_DEP)
30         "$$(MKDIRHIER)" $$(dir $$@)
31         "$$($1_$2_HC)" $$($1_$2_$3_MOST_HC_OPTS) -c $$< -o $$@
32
33 $1/$2/build/%.$$($3_way_)hc : $1/%.cmm $$(rts_H_FILES) $$($1_$2_HC_DEP)
34         "$$(MKDIRHIER)" $$(dir $$@)
35         "$$($1_$2_HC)" $$($1_$2_$3_MOST_HC_OPTS) -c $$< -o $$@
36
37 $1/$2/build/%.$$($3_way_)hc : $1/$2/build/%.cmm $$(rts_H_FILES) $$($1_$2_HC_DEP)
38         "$$(MKDIRHIER)" $$(dir $$@)
39         "$$($1_$2_HC)" $$($1_$2_$3_MOST_HC_OPTS) -c $$< -o $$@
40
41 $1/$2/build/%.$$($3_way_)s : $1/%.cmm $$(rts_H_FILES) $$($1_$2_HC_DEP)
42         "$$(MKDIRHIER)" $$(dir $$@)
43         "$$($1_$2_HC)" $$($1_$2_$3_MOST_HC_OPTS) -c $$< -o $$@
44
45 $1/$2/build/%.$$($3_way_)s : $1/$2/build/%.cmm $$(rts_H_FILES) $$($1_$2_HC_DEP)
46         "$$(MKDIRHIER)" $$(dir $$@)
47         "$$($1_$2_HC)" $$($1_$2_$3_MOST_HC_OPTS) -c $$< -o $$@
48
49 endif
50
51 endif
52
53 endef
54