summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2009-07-03 07:45:27 +0000
committerSimon Marlow <marlowsd@gmail.com>2009-07-03 07:45:27 +0000
commitab1d5052de53479377c961d1e966f0cf0b82c592 (patch)
treef36d0353c7789ac10900e3466bfb7fb30eacbe74
parent8b87f1916a010bf35163bae5925cb1e1fa37a94d (diff)
downloadhaskell-ab1d5052de53479377c961d1e966f0cf0b82c592.tar.gz
Improved infrastructure for fast-rebuilding of parts of the tree
e.g. cd compiler make FAST=YES stage1/build/HscTypes.o builds just the specified .o file, without rebuilding dependencies, and omitting some of the makefile phases. FAST=YES works anywhere, to omit depenencies and phases. 'make fast' is shorthand for 'make all FAST=YES'.
-rw-r--r--compiler/Makefile8
-rw-r--r--ghc/Makefile8
-rw-r--r--mk/sub-makefile.mk22
3 files changed, 27 insertions, 11 deletions
diff --git a/compiler/Makefile b/compiler/Makefile
index 7618f680a1..cde254ae78 100644
--- a/compiler/Makefile
+++ b/compiler/Makefile
@@ -15,16 +15,18 @@ TOP = ..
SPEC_TARGETS = 1 2 3
include $(TOP)/mk/sub-makefile.mk
+FAST_MAKE_OPTS += compiler_stage1_NO_BUILD_DEPS=YES compiler_stage2_NO_BUILD_DEPS=YES compiler_stage3_NO_BUILD_DEPS=YES
+
.PHONY: 1 2 3
1:
- +$(TOPMAKE) stage=1 all_ghc_stage1 compiler_stage1_NO_BUILD_DEPS=YES OMIT_PHASE_1=YES OMIT_PHASE_2=YES OMIT_PHASE_3=YES
+ +$(TOPMAKE) stage=1 all_ghc_stage1 $(FAST_MAKE_OPTS)
2:
- +$(TOPMAKE) stage=2 all_ghc_stage2 compiler_stage2_NO_BUILD_DEPS=YES OMIT_PHASE_1=YES OMIT_PHASE_2=YES OMIT_PHASE_3=YES
+ +$(TOPMAKE) stage=2 all_ghc_stage2 $(FAST_MAKE_OPTS)
3:
- +$(TOPMAKE) stage=3 all_ghc_stage3 compiler_stage3_NO_BUILD_DEPS=YES OMIT_PHASE_1=YES OMIT_PHASE_2=YES OMIT_PHASE_3=YES
+ +$(TOPMAKE) stage=3 all_ghc_stage3 $(FAST_MAKE_OPTS)
.PHONY: extra-help
help : extra-help
diff --git a/ghc/Makefile b/ghc/Makefile
index 7e6b416cf3..669c938dd7 100644
--- a/ghc/Makefile
+++ b/ghc/Makefile
@@ -15,16 +15,18 @@ TOP = ..
SPEC_TARGETS = 1 2 3
include $(TOP)/mk/sub-makefile.mk
+FAST_MAKE_OPTS += compiler_stage1_NO_BUILD_DEPS=YES compiler_stage2_NO_BUILD_DEPS=YES compiler_stage3_NO_BUILD_DEPS=YES
+
.PHONY: 1 2 3
1:
- +$(TOPMAKE) stage=1 all_ghc_stage1 compiler_stage1_NO_BUILD_DEPS=YES
+ +$(TOPMAKE) stage=1 all_ghc_stage1 $(FAST_MAKE_OPTS)
2:
- +$(TOPMAKE) stage=2 all_ghc_stage2 compiler_stage2_NO_BUILD_DEPS=YES
+ +$(TOPMAKE) stage=2 all_ghc_stage2 $(FAST_MAKE_OPTS)
3:
- +$(TOPMAKE) stage=3 all_ghc_stage3 compiler_stage3_NO_BUILD_DEPS=YES
+ +$(TOPMAKE) stage=3 all_ghc_stage3 $(FAST_MAKE_OPTS)
.PHONY: extra-help
help : extra-help
diff --git a/mk/sub-makefile.mk b/mk/sub-makefile.mk
index 989c0c91b9..caeefa6c4a 100644
--- a/mk/sub-makefile.mk
+++ b/mk/sub-makefile.mk
@@ -16,9 +16,21 @@ TOPMAKE = $(MAKE) -C $(TOP)
default: all
-fast :
- +$(TOPMAKE) all_$(dir) $(dir)_dist-install_NO_BUILD_DEPS=YES \
- OMIT_PHASE_1=YES OMIT_PHASE_2=YES OMIT_PHASE_3=YES
+fast: all
+
+FAST_MAKE_OPTS =\
+ $(dir)_dist_NO_BUILD_DEPS=YES \
+ $(dir)_dist-boot_NO_BUILD_DEPS=YES \
+ $(dir)_dist-install_NO_BUILD_DEPS=YES \
+ OMIT_PHASE_1=YES OMIT_PHASE_2=YES OMIT_PHASE_3=YES
+
+ifneq "$(filter fast,$(MAKECMDGOALS))" ""
+EXTRA_MAKE_OPTS += $(FAST_MAKE_OPTS)
+else
+ifeq "$(FAST)" "YES"
+EXTRA_MAKE_OPTS += $(FAST_MAKE_OPTS)
+endif
+endif
# We must not execute multiple recursive invocations of make in parallel.
.NOTPARALLEL:
@@ -28,12 +40,12 @@ STD_TARGETS = all clean distclean maintainer_clean install html ps pdf
# The + tells make that we're recursively invoking make, otherwise 'make -j2'
# goes wrong.
$(STD_TARGETS):
- +$(TOPMAKE) $@_$(dir)
+ +$(TOPMAKE) $@_$(dir) $(EXTRA_MAKE_OPTS)
OTHERTARGETS=$(filter-out fast help $(STD_TARGETS) $(SPEC_TARGETS),$(MAKECMDGOALS))
.PHONY: $(OTHERTARGETS)
$(OTHERTARGETS):
- +$(TOPMAKE) $(dir)/$@
+ +$(TOPMAKE) $(dir)/$@ $(EXTRA_MAKE_OPTS)
.PHONY: help
help : sub-help