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 # On Solaris, the builtin test doesn't support -nt, you have to use
55 # /usr/bin/test. On MSYS, however, /usr/bin/test does not exist. How
57 TEST=$(if $(wildcard /usr/bin/test),/usr/bin/test,test)
59 # configure touches certain files even if they haven't changed. This
60 # can mean a lot of unnecessary recompilation after a re-configure, so
61 # here we cache the old versions of these files so we can restore the
64 @set -x && [ -f $@ ] && cmp -s $< $@ || cp -p $< $@
68 # NB. not the same as saying '%: ...', which doesn't do the right thing:
69 # it does nothing if we specify a target that already exists.
71 $(REALGOALS) all: mk/config.mk.old mk/project.mk.old compiler/ghc.cabal.old
72 @echo "===--- updating makefiles phase 0"
73 $(MAKE) -r --no-print-directory -f ghc.mk phase=0 just-makefiles
74 ifneq "$(OMIT_PHASE_1)" "YES"
75 @echo "===--- updating makefiles phase 1"
76 $(MAKE) -r --no-print-directory -f ghc.mk phase=1 just-makefiles
78 ifneq "$(OMIT_PHASE_2)" "YES"
79 @echo "===--- updating makefiles phase 2"
80 $(MAKE) -r --no-print-directory -f ghc.mk phase=2 just-makefiles
82 ifneq "$(OMIT_PHASE_3)" "YES"
83 @echo "===--- updating makefiles phase 3"
84 $(MAKE) -r --no-print-directory -f ghc.mk phase=3 just-makefiles
86 @echo "===--- finished updating makefiles"
87 $(MAKE) -r --no-print-directory -f ghc.mk $@
90 ifeq "$(mingw32_TARGET_OS)" "1"
91 $(MAKE) -r --no-print-directory -f ghc.mk windows-binary-dist
92 $(MAKE) -r --no-print-directory -f ghc.mk windows-installer
95 $(MAKE) -r --no-print-directory -f ghc.mk bindist BINDIST=YES
96 $(MAKE) -r --no-print-directory -f ghc.mk binary-dist
99 clean distclean maintainer-clean:
100 $(MAKE) -r --no-print-directory -f ghc.mk $@ CLEANING=YES
101 test ! -d testsuite || $(MAKE) -C testsuite $@
103 $(filter clean_%, $(MAKECMDGOALS)) : clean_% :
104 $(MAKE) -r --no-print-directory -f ghc.mk $@ CLEANING=YES
106 bootstrapping-files show:
107 $(MAKE) -r --no-print-directory -f ghc.mk $@
109 ifeq "$(darwin_TARGET_OS)" "1"
111 $(MAKE) -C distrib/MacOS $@
114 # If the user says 'make A B', then we don't want to invoke two
115 # instances of the rule above in parallel: