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 ifneq "$(findstring clean,$(MAKECMDGOALS))" ""
39 ifeq "$(ProjectVersion)" ""
40 $(error Please run ./configure first)
44 include mk/custom-settings.mk
46 PACKAGE_MK=libraries/base/ghc.mk
50 # No need to update makefiles for these targets:
51 REALGOALS=$(filter-out bootstrapping-files framework-pkg clean clean_% distclean maintainer-clean show,$(MAKECMDGOALS))
53 # NB. not the same as saying '%: ...', which doesn't do the right thing:
54 # it does nothing if we specify a target that already exists.
56 $(REALGOALS) all: $(PACKAGE_MK)
57 @echo "===--- updating makefiles phase 0"
58 $(MAKE) -r --no-print-directory -f ghc.mk phase=0 just-makefiles
59 ifneq "$(OMIT_PHASE_1)" "YES"
60 @echo "===--- updating makefiles phase 1"
61 $(MAKE) -r --no-print-directory -f ghc.mk phase=1 just-makefiles
63 ifneq "$(OMIT_PHASE_2)" "YES"
64 @echo "===--- updating makefiles phase 2"
65 $(MAKE) -r --no-print-directory -f ghc.mk phase=2 just-makefiles
67 ifneq "$(OMIT_PHASE_3)" "YES"
68 @echo "===--- updating makefiles phase 3"
69 $(MAKE) -r --no-print-directory -f ghc.mk phase=3 just-makefiles
71 @echo "===--- finished updating makefiles"
72 $(MAKE) -r --no-print-directory -f ghc.mk $@
76 $(MAKE) -r --no-print-directory -f ghc.mk bindist BINDIST=YES
77 $(MAKE) -r --no-print-directory -f ghc.mk binary-dist
79 clean distclean maintainer-clean:
80 $(MAKE) -r --no-print-directory -f ghc.mk $@ CLEANING=YES
81 test ! -d testsuite || $(MAKE) -C testsuite $@
83 $(filter clean_%, $(MAKECMDGOALS)) : clean_% :
84 $(MAKE) -r --no-print-directory -f ghc.mk $@ CLEANING=YES
86 bootstrapping-files show: $(PACKAGE_MK)
87 $(MAKE) -r --no-print-directory -f ghc.mk $@
89 ifeq "$(darwin_TARGET_OS)" "1"
91 $(MAKE) -C distrib/MacOS $@
94 # If the user says 'make A B', then we don't want to invoke two
95 # instances of the rule above in parallel: