[project @ 2004-11-12 14:56:10 by stolz]
[ghc-hetmet.git] / mk / boilerplate.mk
1 #################################################################################
2 #
3 #                           mk/boilerplate.mk
4 #
5 #               The Glorious fptools Boilerplate Makefile
6 #
7 # This one file should be included (directly or indirectly) by all Makefiles 
8 # in the fptools 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 *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 FPTOOLS_TOP := $(TOP)
22
23
24 # This rule makes sure that "all" is the default target, regardless of where it appears
25 #               THIS RULE MUST REMAIN FIRST!
26 default: all
27
28 # -----------------------------------------------------------------------------
29 # Misc bits
30
31 # If $(way) is set then we define $(way_) and $(_way) from it in the
32 # obvious fashion.  This must be done before suffix.mk is included,
33 # because the pattern rules in that file depend on these variables.
34
35 ifneq "$(way)" ""
36   way_ := $(way)_
37   _way := _$(way)
38 endif
39
40
41 # When using $(patsubst ...) and friends, you can't use a literal comma
42 # freely - so we use ${comma} instead.  (See PACKAGE_CPP_OPTS in package.mk
43 # for an example usage.)
44 comma=,
45
46 # -----------------------------------------------------------------------------
47 #       Now follow the pieces of boilerplate
48 #       The "-" signs tell make not to complain if they don't exist
49
50 include $(TOP)/mk/config.mk
51 # All configuration information
52 #       (generated by "configure" from config.mk.in)
53 #
54
55
56 include $(TOP)/mk/paths.mk
57 # Variables that say where things belong (e.g install directories)
58 # and where we are right now
59 # Also defines variables for standard files (SRCS, LIBS etc)
60
61
62 include $(TOP)/mk/opts.mk
63 # Variables that control the option flags for all the
64 # language processors
65
66 ifeq "$(BootingFromHc)" "YES"
67 include $(TOP)/mk/bootstrap.mk
68 endif
69
70 -include $(TOP)/mk/build.mk
71 # (Optional) build-specific configuration
72 #
73
74 ifndef FAST
75 -include .depend
76 endif
77 # The dependencies file from the current directory