move the "meat" into the wiki, this file just contains pointers now
[ghc.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 # GHC_TOP is the *relative* path to the fptools toplevel directory from the
18 # location where a project Makefile was invoked. It is set by looking at the
19 # current value of TOP.
20 #
21 GHC_TOP := $(TOP)
22
23 # $(FPTOOLS_TOP) is the old name for $(GHC_TOP), kept for backwards compat
24 FPTOOLS_TOP := $(TOP)
25
26
27 # This rule makes sure that "all" is the default target, regardless of where it appears
28 # THIS RULE MUST REMAIN FIRST!
29 default: all
30
31 # -----------------------------------------------------------------------------
32 # Misc bits
33
34 # If $(way) is set then we define $(way_) and $(_way) from it in the
35 # obvious fashion. This must be done before suffix.mk is included,
36 # because the pattern rules in that file depend on these variables.
37
38 ifneq "$(way)" ""
39 way_ := $(way)_
40 _way := _$(way)
41 endif
42
43
44 # When using $(patsubst ...) and friends, you can't use a literal comma
45 # freely - so we use ${comma} instead. (See PACKAGE_CPP_OPTS in package.mk
46 # for an example usage.)
47 comma=,
48
49 # -----------------------------------------------------------------------------
50 # Now follow the pieces of boilerplate
51 # The "-" signs tell make not to complain if they don't exist
52
53 include $(TOP)/mk/config.mk
54 # All configuration information
55 # (generated by "configure" from config.mk.in)
56 #
57
58
59 include $(TOP)/mk/paths.mk
60 # Variables that say where things belong (e.g install directories)
61 # and where we are right now
62 # Also defines variables for standard files (SRCS, LIBS etc)
63
64
65 include $(TOP)/mk/opts.mk
66 # Variables that control the option flags for all the
67 # language processors
68
69 ifeq "$(BootingFromHc)" "YES"
70 include $(TOP)/mk/bootstrap.mk
71 endif
72
73 -include $(TOP)/mk/build.mk
74 # (Optional) build-specific configuration
75 #
76
77 ifndef FAST
78 -include .depend
79 endif
80 # The dependencies file from the current directory