Merge remote branch 'origin/patch-4404'
[ghc.git] / rules / hs-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 hs-suffix-rules # args: $1 = dir, $2 = distdir, $3 = way
15
16 ifneq "$$(BINDIST)" "YES"
17 ifneq "$$(BootingFromHc)" "YES"
18
19 $1/$2/build/%.$$($3_hcsuf) : $1/$2/build/%.hs $$($1_$2_HC_DEP)
20 "$$($1_$2_HC)" $$($1_$2_$3_ALL_HC_OPTS) -C $$< -o $$@
21
22 $1/$2/build/%.$$($3_osuf) : $1/$2/build/%.hs $$($1_$2_HC_DEP)
23 "$$($1_$2_HC)" $$($1_$2_$3_ALL_HC_OPTS) -c $$< -o $$@
24
25 $1/$2/build/%.$$($3_hcsuf) : $1/$2/build/autogen/%.hs $$($1_$2_HC_DEP)
26 "$$($1_$2_HC)" $$($1_$2_$3_ALL_HC_OPTS) -C $$< -o $$@
27
28 $1/$2/build/%.$$($3_osuf) : $1/$2/build/autogen/%.hs $$($1_$2_HC_DEP)
29 "$$($1_$2_HC)" $$($1_$2_$3_ALL_HC_OPTS) -c $$< -o $$@
30
31 endif
32 endif
33
34 endef # hs-suffix-rules
35