Move the "show" target from target.mk to boilerplate.mk
[ghc-hetmet.git] / mk / boilerplate.mk
1 #################################################################################
2 #
3 #                           mk/boilerplate.mk
4 #
5 #               The Glorious GHC Boilerplate Makefile
6 #
7 # This one file should be included (directly or indirectly) by all Makefiles 
8 # in the GHC hierarchy.
9 #
10 #################################################################################
11
12 # We want to disable all the built-in rules that make uses; having them
13 # just slows things down, and we write all the rules ourselves.
14 # Setting .SUFFIXES to empty disables them all.
15 MAKEFLAGS += --no-builtin-rules
16
17 # $(FPTOOLS_TOP) is the old name for $(TOP), kept for backwards compat
18 FPTOOLS_TOP := $(TOP)
19
20
21 # This rule makes sure that "all" is the default target, regardless of where it appears
22 #               THIS RULE MUST REMAIN FIRST!
23 default: all
24
25 #------------------------------------------------------------
26 #                       Makefile debugging
27 # to see the effective value used for a Makefile variable, do
28 #  make show VALUE=MY_VALUE
29 #
30
31 show:
32         @echo '$(VALUE)="$($(VALUE))"'
33
34 # -----------------------------------------------------------------------------
35 # Misc bits
36
37 # If $(way) is set then we define $(way_) and $(_way) from it in the
38 # obvious fashion.  This must be done before suffix.mk is included,
39 # because the pattern rules in that file depend on these variables.
40
41 ifneq "$(way)" ""
42   way_ := $(way)_
43   _way := _$(way)
44 endif
45
46
47 # When using $(patsubst ...) and friends, you can't use a literal comma
48 # freely - so we use ${comma} instead.  (See PACKAGE_CPP_OPTS in package.mk
49 # for an example usage.)
50 comma=,
51
52 # -----------------------------------------------------------------------------
53 #       Now follow the pieces of boilerplate
54 #       The "-" signs tell make not to complain if they don't exist
55
56 include $(TOP)/mk/config.mk
57 # All configuration information
58 #       (generated by "configure" from config.mk.in)
59 #
60
61
62 include $(TOP)/mk/paths.mk
63 # Variables that say where things belong (e.g install directories)
64 # and where we are right now
65 # Also defines variables for standard files (SRCS, LIBS etc)
66
67
68 include $(TOP)/mk/opts.mk
69 # Variables that control the option flags for all the
70 # language processors
71
72 ifeq "$(BootingFromHc)" "YES"
73 include $(TOP)/mk/bootstrap.mk
74 endif
75
76 # (Optional) build-specific configuration
77 include $(TOP)/mk/custom-settings.mk
78
79 ifndef FAST
80 -include .depend
81 endif
82 # The dependencies file from the current directory