add 'make re2' for rebuilding stage2 (similarly re1 and re3)
[ghc-hetmet.git] / ghc / Makefile
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://hackage.haskell.org/trac/ghc/wiki/Building/Architecture
9 #      http://hackage.haskell.org/trac/ghc/wiki/Building/Modifying
10 #
11 # -----------------------------------------------------------------------------
12
13 dir = ghc
14 TOP = ..
15 SPEC_TARGETS = 1 2 3
16 include $(TOP)/mk/sub-makefile.mk
17
18 FAST_MAKE_OPTS += compiler_stage1_NO_BUILD_DEPS=YES \
19                   compiler_stage2_NO_BUILD_DEPS=YES \
20                   compiler_stage3_NO_BUILD_DEPS=YES \
21                   ghc_stage1_NO_BUILD_DEPS=YES \
22                   ghc_stage2_NO_BUILD_DEPS=YES \
23                   ghc_stage3_NO_BUILD_DEPS=YES
24
25 .PHONY: 1 2 3
26
27 1:
28         +$(TOPMAKE) stage=1 all_ghc_stage1 $(FAST_MAKE_OPTS) NO_STAGE1_DEPS=YES NO_STAGE2_DEPS=YES
29
30 2:
31         +$(TOPMAKE) stage=2 all_ghc_stage2 $(FAST_MAKE_OPTS) NO_STAGE2_DEPS=YES
32
33 3:
34         +$(TOPMAKE) stage=3 all_ghc_stage3 $(FAST_MAKE_OPTS) NO_STAGE3_DEPS=YES
35
36
37 # 'make re2' rebuilds stage2, removing the old executable first.  Useful for
38 # something like 'make re2 GhcDebugged=YES'.
39
40 .PHONY: re1 re2 re3
41 re1:
42         $(RM) stage1/build/tmp/ghc-stage1
43         $(MAKE) 1
44 re2:
45         $(RM) stage2/build/tmp/ghc-stage2
46         $(MAKE) 2
47 re3:
48         $(RM) stage3/build/tmp/ghc-stage3
49         $(MAKE) 3
50
51 .PHONY: extra-help
52 help : extra-help
53 extra-help :
54         @echo "  make 1"
55         @echo "  make 2"
56         @echo "  make 3"
57         @echo
58         @echo "     Build the stage 1, 2 or 3 GHC respectively, omitting dependencies"
59         @echo "     and initial phases for speed."