Rename hs-suffix-rules to hs-suffix-way-rules
[ghc.git] / rules / hs-suffix-way-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 hs-suffix-way-rules # args: $1 = dir, $2 = distdir, $3 = way
15
16 ifneq "$$(BINDIST)" "YES"
17
18 $1/$2/build/%.$$($3_hcsuf) : $1/$2/build/%.hs $$(LAX_DEPS_FOLLOW) $$($1_$2_HC_DEP)
19 $$(call cmd,$1_$2_HC) $$($1_$2_$3_ALL_HC_OPTS) -C $$< -o $$@
20
21 $1/$2/build/%.$$($3_osuf) : $1/$2/build/%.hs $$(LAX_DEPS_FOLLOW) $$($1_$2_HC_DEP)
22 $$(call cmd,$1_$2_HC) $$($1_$2_$3_ALL_HC_OPTS) -c $$< -o $$@
23
24 $1/$2/build/%.$$($3_hcsuf) : $1/$2/build/autogen/%.hs $$(LAX_DEPS_FOLLOW) $$($1_$2_HC_DEP)
25 $$(call cmd,$1_$2_HC) $$($1_$2_$3_ALL_HC_OPTS) -C $$< -o $$@
26
27 $1/$2/build/%.$$($3_osuf) : $1/$2/build/autogen/%.hs $$(LAX_DEPS_FOLLOW) $$($1_$2_HC_DEP)
28 $$(call cmd,$1_$2_HC) $$($1_$2_$3_ALL_HC_OPTS) -c $$< -o $$@
29
30 endif
31
32 $$(foreach dir,$$($1_$2_HS_SRC_DIRS),\
33 $$(eval $$(call hs-suffix-rules-srcdir,$1,$2,$3,$$(dir))))
34
35 $(call hi-rule,$1/$2/build,$1/$2/build,$3)
36 $(call hi-rule,$1/$2/build/autogen,$1/$2/build,$3)
37 $$(foreach dir,$$($1_$2_HS_SRC_DIRS),\
38 $$(eval $$(call hi-rule,$1/$$(dir),$1/$2/build,$3)))
39
40 endef # hs-suffix-way-rules
41