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 bootstrapping-files framework-pkg clean clean_% distclean maintainer-clean show help,$(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 "===--- updating makefiles phase 0"
64 $(MAKE) -r --no-print-directory -f ghc.mk phase=0 just-makefiles
65 ifneq "$(OMIT_PHASE_1)" "YES"
66 @echo "===--- updating makefiles phase 1"
67 $(MAKE) -r --no-print-directory -f ghc.mk phase=1 just-makefiles
69 ifneq "$(OMIT_PHASE_2)" "YES"
70 @echo "===--- updating makefiles phase 2"
71 $(MAKE) -r --no-print-directory -f ghc.mk phase=2 just-makefiles
73 ifneq "$(OMIT_PHASE_3)" "YES"
74 @echo "===--- updating makefiles phase 3"
75 $(MAKE) -r --no-print-directory -f ghc.mk phase=3 just-makefiles
77 @echo "===--- finished updating makefiles"
78 $(MAKE) -r --no-print-directory -f ghc.mk $@
81 ifeq "$(mingw32_TARGET_OS)" "1"
82 $(MAKE) -r --no-print-directory -f ghc.mk windows-binary-dist
83 $(MAKE) -r --no-print-directory -f ghc.mk windows-installer
86 $(MAKE) -r --no-print-directory -f ghc.mk bindist BINDIST=YES
87 $(MAKE) -r --no-print-directory -f ghc.mk binary-dist
90 clean distclean maintainer-clean:
91 $(MAKE) -r --no-print-directory -f ghc.mk $@ CLEANING=YES
92 test ! -d testsuite || $(MAKE) -C testsuite $@
94 $(filter clean_%, $(MAKECMDGOALS)) : clean_% :
95 $(MAKE) -r --no-print-directory -f ghc.mk $@ CLEANING=YES
97 bootstrapping-files show:
98 $(MAKE) -r --no-print-directory -f ghc.mk $@
100 ifeq "$(darwin_TARGET_OS)" "1"
102 $(MAKE) -C distrib/MacOS $@
105 # If the user says 'make A B', then we don't want to invoke two
106 # instances of the rule above in parallel: