rules: cleanup: use '$way_*suf' var instead of open-coded '($3_way_)s'
[ghc.git] / rules / way-prelims.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://ghc.haskell.org/trac/ghc/wiki/Building/Architecture
9 # http://ghc.haskell.org/trac/ghc/wiki/Building/Modifying
10 #
11 # -----------------------------------------------------------------------------
12
13 define way-prelims # $1 = way
14 ifeq "$1" "v"
15 $1__way =
16 $1_way_ =
17 else
18 $1__way = _$1
19 $1_way_ = $1_
20 endif
21 $1_osuf = $$($1_way_)o
22 $1_o-bootsuf = $$($1_way_)o-boot
23 $1_hisuf = $$($1_way_)hi
24 $1_hcsuf = $$($1_way_)hc
25 $1_ssuf = $$($1_way_)s
26
27 ifneq "$(findstring dyn,$1)" ""
28 # If the way includes "dyn" then it's a dynamic lib way. We mangle the
29 # way name to remove "dyn" (or "_dyn") and we change the suffix to
30 # include the versioned dynamic lib extension (eg .so or .dynlib).
31 # For example: thr_debug_dyn_libsuf="_thr_debug-ghc6.11.20090426.so"
32 $1_libsuf = $$($(subst dyn,,$(subst _dyn,,$1))__way)-ghc$(ProjectVersion)$(soext)
33 else
34 $1_libsuf = $$($1__way).a
35 endif
36 endef