Permalink
Browse files

Fix "make 1" etc following the build system changes

The logic is now in mk/compiler-ghc.mk rather than being duplicated in
ghc/Makefile and compiler/Makefile.
  • Loading branch information...
1 parent ff3bfae commit c1e824a275339da8fae6614f5a0db751874d0a36 @igfoo igfoo committed Jan 27, 2011
Showing with 81 additions and 73 deletions.
  1. +2 −0 Makefile
  2. +2 −25 compiler/Makefile
  3. +1 −44 ghc/Makefile
  4. +59 −0 mk/compiler-ghc.mk
  5. +2 −1 mk/sub-makefile.mk
  6. +2 −2 rules/build-dependencies.mk
  7. +2 −0 rules/build-package-data.mk
  8. +11 −1 rules/include-dependencies.mk
View
@@ -60,8 +60,10 @@ REALGOALS=$(filter-out binary-dist binary-dist-prep bootstrapping-files framewor
# it does nothing if we specify a target that already exists.
.PHONY: $(REALGOALS)
$(REALGOALS) all: mk/config.mk.old mk/project.mk.old compiler/ghc.cabal.old
+ifneq "$(OMIT_PHASE_0)" "YES"
@echo "===--- building phase 0"
$(MAKE) -r --no-print-directory -f ghc.mk phase=0 phase_0_builds
+endif
ifneq "$(OMIT_PHASE_1)" "YES"
@echo "===--- building phase 1"
$(MAKE) -r --no-print-directory -f ghc.mk phase=1 phase_1_builds
View
@@ -16,32 +16,9 @@
default_to_ghc : all_ghc
dir = compiler
-TOP = ..
-SPEC_TARGETS = 1 2 3
-include $(TOP)/mk/sub-makefile.mk
+
+include ../mk/compiler-ghc.mk
all_ghc :
+$(TOPMAKE) all_ghc $(EXTRA_MAKE_OPTS)
-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 $(FAST_MAKE_OPTS) NO_STAGE1_DEPS=YES NO_STAGE2_DEPS=YES
-
-2:
- +$(TOPMAKE) stage=2 all_ghc_stage2 $(FAST_MAKE_OPTS) NO_STAGE2_DEPS=YES
-
-3:
- +$(TOPMAKE) stage=3 all_ghc_stage3 $(FAST_MAKE_OPTS) NO_STAGE3_DEPS=YES
-
-.PHONY: extra-help
-help : extra-help
-extra-help :
- @echo " make 1"
- @echo " make 2"
- @echo " make 3"
- @echo
- @echo " Build the stage 1, 2 or 3 GHC respectively, omitting dependencies"
- @echo " and initial phases for speed."
View
@@ -11,49 +11,6 @@
# -----------------------------------------------------------------------------
dir = ghc
-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 \
- ghc_stage1_NO_BUILD_DEPS=YES \
- ghc_stage2_NO_BUILD_DEPS=YES \
- ghc_stage3_NO_BUILD_DEPS=YES
+include ../mk/compiler-ghc.mk
-.PHONY: 1 2 3
-
-1:
- +$(TOPMAKE) stage=1 all_ghc_stage1 $(FAST_MAKE_OPTS) NO_STAGE1_DEPS=YES NO_STAGE2_DEPS=YES
-
-2:
- +$(TOPMAKE) stage=2 all_ghc_stage2 $(FAST_MAKE_OPTS) NO_STAGE2_DEPS=YES
-
-3:
- +$(TOPMAKE) stage=3 all_ghc_stage3 $(FAST_MAKE_OPTS) NO_STAGE3_DEPS=YES
-
-
-# 'make re2' rebuilds stage2, removing the old executable first. Useful for
-# something like 'make re2 GhcDebugged=YES'.
-
-.PHONY: re1 re2 re3
-re1:
- $(RM) stage1/build/tmp/ghc-stage1
- $(MAKE) 1
-re2:
- $(RM) stage2/build/tmp/ghc-stage2
- $(MAKE) 2
-re3:
- $(RM) stage3/build/tmp/ghc-stage3
- $(MAKE) 3
-
-.PHONY: extra-help
-help : extra-help
-extra-help :
- @echo " make 1"
- @echo " make 2"
- @echo " make 3"
- @echo
- @echo " Build the stage 1, 2 or 3 GHC respectively, omitting dependencies"
- @echo " and initial phases for speed."
View
@@ -0,0 +1,59 @@
+# -----------------------------------------------------------------------------
+#
+# (c) 2009 The University of Glasgow
+#
+# This file is part of the GHC build system.
+#
+# To understand how the build system works and how to modify it, see
+# http://hackage.haskell.org/trac/ghc/wiki/Building/Architecture
+# http://hackage.haskell.org/trac/ghc/wiki/Building/Modifying
+#
+# -----------------------------------------------------------------------------
+
+dir = ghc
+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 \
+ ghc_stage1_NO_BUILD_DEPS=YES \
+ ghc_stage2_NO_BUILD_DEPS=YES \
+ ghc_stage3_NO_BUILD_DEPS=YES
+
+.PHONY: 1 2 3
+
+1:
+ +$(TOPMAKE) stage=1 all_ghc_stage1 $(FAST_MAKE_OPTS) ONLY_DEPS_FOR="compiler_stage1 ghc_stage1"
+
+2:
+ +$(TOPMAKE) stage=2 all_ghc_stage2 $(FAST_MAKE_OPTS) ONLY_DEPS_FOR="compiler_stage2 ghc_stage2" NO_STAGE2_DEPS=YES
+
+3:
+ +$(TOPMAKE) stage=3 all_ghc_stage3 $(FAST_MAKE_OPTS) ONLY_DEPS_FOR="compiler_stage3 ghc_stage3" NO_STAGE3_DEPS=YES
+
+
+# 'make re2' rebuilds stage2, removing the old executable first. Useful for
+# something like 'make re2 GhcDebugged=YES'.
+
+.PHONY: re1 re2 re3
+re1:
+ $(RM) $(TOP)/ghc/stage1/build/tmp/ghc-stage1
+ $(MAKE) 1
+re2:
+ $(RM) $(TOP)/ghc/stage2/build/tmp/ghc-stage2
+ $(MAKE) 2
+re3:
+ $(RM) $(TOP)/ghc/stage3/build/tmp/ghc-stage3
+ $(MAKE) 3
+
+.PHONY: extra-help
+help : extra-help
+extra-help :
+ @echo " make 1"
+ @echo " make 2"
+ @echo " make 3"
+ @echo
+ @echo " Build the stage 1, 2 or 3 GHC respectively, omitting dependencies"
+ @echo " and initial phases for speed."
View
@@ -22,7 +22,8 @@ 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
+ NO_GENERATED_MAKEFILE_RULES=YES \
+ OMIT_PHASE_0=YES OMIT_PHASE_1=YES
ifneq "$(filter fast,$(MAKECMDGOALS))" ""
EXTRA_MAKE_OPTS += $(FAST_MAKE_OPTS)
@@ -25,7 +25,7 @@ $1_$2_C_FILES_DEPS = $$(filter-out $$($1_$2_C_FILES_NODEPS),$$($1_$2_C_FILES))
$1_$2_MKDEPENDHS_FLAGS = -dep-makefile $$($1_$2_depfile_haskell).tmp $$(foreach way,$$(filter-out v,$$($1_$2_WAYS)),-dep-suffix $$(way))
$1_$2_MKDEPENDHS_FLAGS += -include-pkg-deps
-ifneq "$$($1_$2_NO_BUILD_DEPS)" "YES"
+ifneq "$$(NO_GENERATED_MAKEFILE_RULES)" "YES"
# Some of the Haskell files (e.g. utils/hsc2hs/Main.hs) (directly or
# indirectly) include the generated includes files.
@@ -69,7 +69,7 @@ endif
echo "$1_$2_depfile_c_asm_EXISTS = YES" >> $$@.tmp
mv $$@.tmp $$@
-endif # $1_$2_NO_BUILD_DEPS
+endif # NO_GENERATED_MAKEFILE_RULES
# Note sed magic above: mkdependC can't do -odir stuff, so we have to
# munge the dependencies it generates to refer to the correct targets.
@@ -64,6 +64,7 @@ $1_$2_CONFIGURE_OPTS += $$(BOOT_PKG_CONSTRAINTS)
endif
ifneq "$$(BINDIST)" "YES"
+ifneq "$$(NO_GENERATED_MAKEFILE_RULES)" "YES"
$1/$2/inplace-pkg-config : $1/$2/package-data.mk
$1/$2/build/autogen/cabal_macros.h : $1/$2/package-data.mk
@@ -78,6 +79,7 @@ ifneq "$$($1_$2_REGISTER_PACKAGE)" "NO"
endif
endif
endif
+endif
PACKAGE_DATA_MKS += $1/$2/package-data.mk
@@ -17,7 +17,17 @@ $(call profStart, include-dependencies($1,$2,$3))
# $2 = distdir
# $3 = GHC stage to use (0 == bootstrapping compiler)
-ifneq "$$(NO_INCLUDE_DEPS)" "YES"
+$1_$2_INCLUDE_DEPFILES = YES
+ifeq "$$(NO_INCLUDE_DEPS)" "YES"
+$1_$2_INCLUDE_DEPFILES = NO
+endif
+ifneq "$$(ONLY_DEPS_FOR)" ""
+ifeq "$$(filter $1_$2,$$(ONLY_DEPS_FOR))" ""
+$1_$2_INCLUDE_DEPFILES = NO
+endif
+endif
+
+ifeq "$$($1_$2_INCLUDE_DEPFILES)" "YES"
ifneq "$$(strip $$($1_$2_HS_SRCS) $$($1_$2_HS_BOOT_SRCS))" ""
ifneq "$$(NO_STAGE$3_DEPS)" "YES"
include $$($1_$2_depfile_haskell)

0 comments on commit c1e824a

Please sign in to comment.