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 install BINDIST=YES NO_INCLUDE_DEPS=YES
28 $(MAKE) -r --no-print-directory -f ghc.mk $@
35 # For help, type 'make help'
40 ifneq "$(findstring clean,$(MAKECMDGOALS))" ""
44 ifeq "$(ProjectVersion)" ""
45 $(error Please run ./configure first)
49 include mk/custom-settings.mk
51 # No need to update makefiles for these targets:
52 REALGOALS=$(filter-out bootstrapping-files framework-pkg clean clean_% distclean maintainer-clean show help,$(MAKECMDGOALS))
54 # configure touches certain files even if they haven't changed. This
55 # can mean a lot of unnecessary recompilation after a re-configure, so
56 # here we cache the old versions of these files so we can restore the
59 @set -x && test -f $@ && cmp -s $< $@ || cp -p $< $@
63 # NB. not the same as saying '%: ...', which doesn't do the right thing:
64 # it does nothing if we specify a target that already exists.
66 $(REALGOALS) all: mk/config.mk.old mk/project.mk.old compiler/ghc.cabal.old
67 @echo "===--- updating makefiles phase 0"
68 $(MAKE) -r --no-print-directory -f ghc.mk phase=0 just-makefiles
69 ifneq "$(OMIT_PHASE_1)" "YES"
70 @echo "===--- updating makefiles phase 1"
71 $(MAKE) -r --no-print-directory -f ghc.mk phase=1 just-makefiles
73 ifneq "$(OMIT_PHASE_2)" "YES"
74 @echo "===--- updating makefiles phase 2"
75 $(MAKE) -r --no-print-directory -f ghc.mk phase=2 just-makefiles
77 ifneq "$(OMIT_PHASE_3)" "YES"
78 @echo "===--- updating makefiles phase 3"
79 $(MAKE) -r --no-print-directory -f ghc.mk phase=3 just-makefiles
81 @echo "===--- finished updating makefiles"
82 $(MAKE) -r --no-print-directory -f ghc.mk $@
85 ifeq "$(mingw32_TARGET_OS)" "1"
86 $(MAKE) -r --no-print-directory -f ghc.mk windows-binary-dist
87 $(MAKE) -r --no-print-directory -f ghc.mk windows-installer
90 $(MAKE) -r --no-print-directory -f ghc.mk bindist BINDIST=YES
91 $(MAKE) -r --no-print-directory -f ghc.mk binary-dist
94 clean distclean maintainer-clean:
95 $(MAKE) -r --no-print-directory -f ghc.mk $@ CLEANING=YES
96 test ! -d testsuite || $(MAKE) -C testsuite $@
98 $(filter clean_%, $(MAKECMDGOALS)) : clean_% :
99 $(MAKE) -r --no-print-directory -f ghc.mk $@ CLEANING=YES
101 bootstrapping-files show:
102 $(MAKE) -r --no-print-directory -f ghc.mk $@
104 ifeq "$(darwin_TARGET_OS)" "1"
106 $(MAKE) -C distrib/MacOS $@
109 # If the user says 'make A B', then we don't want to invoke two
110 # instances of the rule above in parallel: