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://ghc.haskell.org/trac/ghc/wiki/Building/Architecture
9 # http://ghc.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
32 # For help, type 'make help'
37 ifneq "$(filter maintainer-clean distclean clean help,$(MAKECMDGOALS))" ""
41 ifeq "$(ProjectVersion)" ""
42 $(error Please run .
/configure first
)
46 include mk
/custom-settings.mk
48 # Verify that stage 0 LLVM backend isn't affected by Bug #9439 if needed
49 ifeq "$(GHC_LLVM_AFFECTED_BY_9439)" "1"
50 ifneq "$(findstring -fllvm,$(GhcHcOpts) $(GhcStage1HcOpts))" ""
51 $(error Stage
0 compiler is affected by Bug
#9439. Refusing to bootstrap with -fllvm)
55 # No need to update makefiles for these targets:
56 REALGOALS
=$(filter-out binary-dist binary-dist-prep bootstrapping-files framework-pkg
clean clean_
% distclean maintainer-clean show echo help
test fulltest fast fasttest
,$(MAKECMDGOALS
))
58 # configure touches certain files even if they haven't changed. This
59 # can mean a lot of unnecessary recompilation after a re-configure, so
60 # here we cache the old versions of these files so we can restore the
63 @set
-x
&& test -f
$@
&& cmp
-s
$< $@ || cp
-p
$< $@
67 # NB. not the same as saying '%: ...', which doesn't do the right thing:
68 # it does nothing if we specify a target that already exists.
69 .PHONY
: $(REALGOALS
) all
70 $(REALGOALS
) all: mk
/config.mk.old mk
/project.mk.old compiler
/ghc.cabal.old
71 ifneq "$(OMIT_PHASE_0)" "YES"
72 @echo
"===--- building phase 0"
73 $(MAKE
) -r
--no-print-directory
-f ghc.mk phase
=0 phase_0_builds
75 ifneq "$(OMIT_PHASE_1)" "YES"
76 @echo
"===--- building phase 1"
77 $(MAKE
) -r
--no-print-directory
-f ghc.mk phase
=1 phase_1_builds
79 @echo
"===--- building final phase"
80 $(MAKE
) -r
--no-print-directory
-f ghc.mk phase
=final
$@
82 binary-dist
: binary-dist-prep
83 mv bindistprep
/*.
tar.
$(TAR_COMP_EXT
) .
86 ifeq "$(mingw32_TARGET_OS)" "1"
87 $(MAKE
) -r
--no-print-directory
-f ghc.mk windows-binary-dist-prep
90 $(MAKE
) -r
--no-print-directory
-f ghc.mk bindist BINDIST
=YES
91 $(MAKE
) -r
--no-print-directory
-f ghc.mk unix-binary-dist-prep
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 echo
:
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:
115 .PHONY
: fasttest fast
117 $(MAKE
) -C testsuite
/tests CLEANUP
=1 OUTPUT_SUMMARY
=..
/..
/testsuite_summary.txt fast
119 .PHONY
: fulltest
test
121 $(MAKE
) -C testsuite
/tests CLEANUP
=1 OUTPUT_SUMMARY
=..
/..
/testsuite_summary.txt