1 # -----------------------------------------------------------------------------
3 # (c) 2009 The University of Glasgow
5 # This file is part of the GHC build system.
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
11 # -----------------------------------------------------------------------------
13 ifeq "$(wildcard distrib/)" ""
19 @echo 'Run "make install" to install'
24 $(MAKE) -r --no-print-directory -f ghc.mk $@ BINDIST=YES NO_INCLUDE_DEPS=YES
31 # For help, type 'make help'
36 ifneq "$(findstring clean,$(MAKECMDGOALS))" ""
40 ifeq "$(ProjectVersion)" ""
41 $(error Please run ./configure first)
45 include mk/custom-settings.mk
47 # No need to update makefiles for these targets:
48 REALGOALS=$(filter-out binary-dist binary-dist-prep bootstrapping-files framework-pkg clean clean_% distclean maintainer-clean show help install-docs test fulltest,$(MAKECMDGOALS))
50 # configure touches certain files even if they haven't changed. This
51 # can mean a lot of unnecessary recompilation after a re-configure, so
52 # here we cache the old versions of these files so we can restore the
55 @set -x && test -f $@ && cmp -s $< $@ || cp -p $< $@
59 # NB. not the same as saying '%: ...', which doesn't do the right thing:
60 # it does nothing if we specify a target that already exists.
62 $(REALGOALS) all: mk/config.mk.old mk/project.mk.old compiler/ghc.cabal.old
63 @echo "===--- building phase 0"
64 $(MAKE) -r --no-print-directory -f ghc.mk phase=0 phase_0_builds
65 ifneq "$(OMIT_PHASE_1)" "YES"
66 @echo "===--- building phase 1"
67 $(MAKE) -r --no-print-directory -f ghc.mk phase=1 phase_1_builds
69 @echo "===--- building final phase"
70 $(MAKE) -r --no-print-directory -f ghc.mk $@
72 binary-dist: binary-dist-prep
73 ifeq "$(mingw32_TARGET_OS)" "1"
74 mv bindistprep/*.exe .
76 mv bindistprep/*.tar.bz2 .
79 ifeq "$(mingw32_TARGET_OS)" "1"
80 $(MAKE) -r --no-print-directory -f ghc.mk windows-binary-dist-prep
81 $(MAKE) -r --no-print-directory -f ghc.mk windows-installer
84 $(MAKE) -r --no-print-directory -f ghc.mk bindist BINDIST=YES
85 $(MAKE) -r --no-print-directory -f ghc.mk unix-binary-dist-prep
88 clean distclean maintainer-clean:
89 $(MAKE) -r --no-print-directory -f ghc.mk $@ CLEANING=YES
90 test ! -d testsuite || $(MAKE) -C testsuite $@
92 $(filter clean_%, $(MAKECMDGOALS)) : clean_% :
93 $(MAKE) -r --no-print-directory -f ghc.mk $@ CLEANING=YES
95 bootstrapping-files show:
96 $(MAKE) -r --no-print-directory -f ghc.mk $@
98 ifeq "$(darwin_TARGET_OS)" "1"
100 $(MAKE) -C distrib/MacOS $@
103 # install-docs is a historical target that isn't supported in GHC 6.12. See #3662.
105 @echo "The install-docs target is not supported in GHC 6.12.1 and later."
106 @echo "'make install' now installs everything, including documentation."
109 # If the user says 'make A B', then we don't want to invoke two
110 # instances of the rule above in parallel:
117 $(MAKE) -C testsuite/tests/ghc-regress CLEANUP=1 OUTPUT_SUMMARY=../../../testsuite_summary.txt fast
121 $(MAKE) -C testsuite/tests/ghc-regress CLEANUP=1 OUTPUT_SUMMARY=../../../testsuite_summary.txt