Rename PACKAGE_KEY and LIB_NAME in build system.
[ghc.git] / mk / compiler-ghc.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 TOP = ..
14 SPEC_TARGETS = 1 2 3 re1 re2 re3
15 include $(TOP)/mk/sub-makefile.mk
16
17 FAST_MAKE_OPTS += compiler_stage1_NO_BUILD_DEPS=YES \
18 compiler_stage2_NO_BUILD_DEPS=YES \
19 compiler_stage3_NO_BUILD_DEPS=YES \
20 ghc_stage1_NO_BUILD_DEPS=YES \
21 ghc_stage2_NO_BUILD_DEPS=YES \
22 ghc_stage3_NO_BUILD_DEPS=YES
23
24 .PHONY: 1 2 3
25
26 1:
27 +$(TOPMAKE) stage=1 all_ghc_stage1 $(FAST_MAKE_OPTS) ONLY_DEPS_FOR="compiler_stage1 ghc_stage1"
28
29 2:
30 +$(TOPMAKE) stage=2 all_ghc_stage2 $(FAST_MAKE_OPTS) ONLY_DEPS_FOR="compiler_stage2 ghc_stage2" NO_STAGE2_DEPS=YES
31
32 3:
33 +$(TOPMAKE) stage=3 all_ghc_stage3 $(FAST_MAKE_OPTS) ONLY_DEPS_FOR="compiler_stage3 ghc_stage3" NO_STAGE3_DEPS=YES
34
35
36 # 'make re2' rebuilds stage2, removing the old executable first. Useful for
37 # something like 'make re2 GhcDebugged=YES'.
38
39 .PHONY: re1 re2 re3
40 re1:
41 $(RM) $(TOP)/ghc/stage1/build/tmp/ghc-stage1
42 $(MAKE) 1
43 re2:
44 $(RM) $(TOP)/ghc/stage2/build/tmp/ghc-stage2
45 $(MAKE) 2
46 re3:
47 $(RM) $(TOP)/ghc/stage3/build/tmp/ghc-stage3
48 $(MAKE) 3
49
50 .PHONY: extra-help
51 help : extra-help
52 extra-help :
53 @echo " make 1"
54 @echo " make 2"
55 @echo " make 3"
56 @echo
57 @echo " Build the stage 1, 2 or 3 GHC respectively, omitting dependencies"
58 @echo " and initial phases for speed."