Add recently added lib dirs to the darcs boring file
[ghc-hetmet.git] / Makefile
1 # -----------------------------------------------------------------------------
2 #
3 # (c) 2009 The University of Glasgow
4 #
5 # This file is part of the GHC build system.
6 #
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
10 #
11 # -----------------------------------------------------------------------------
12
13 ifeq "$(wildcard distrib/)" ""
14
15 # We're in a bindist
16
17 .PHONY: default
18 default:
19         @echo 'Run "make install" to install'
20         @false
21
22 .PHONY: install
23 install:
24         $(MAKE) -r --no-print-directory -f ghc.mk install BINDIST=YES NO_INCLUDE_DEPS=YES
25
26 .PHONY: show
27 show:
28         $(MAKE) -r --no-print-directory -f ghc.mk $@
29
30 else
31
32 default : all
33         @:
34
35 ifneq "$(findstring clean,$(MAKECMDGOALS))" ""
36 -include mk/config.mk
37 else
38 include mk/config.mk
39 ifeq "$(ProjectVersion)" ""
40 $(error Please run ./configure first)
41 endif
42 endif
43
44 include mk/custom-settings.mk
45
46 # No need to update makefiles for these targets:
47 REALGOALS=$(filter-out bootstrapping-files framework-pkg clean clean_% distclean maintainer-clean show,$(MAKECMDGOALS))
48
49 # NB. not the same as saying '%: ...', which doesn't do the right thing:
50 # it does nothing if we specify a target that already exists.
51 .PHONY: $(REALGOALS)
52 $(REALGOALS) all:
53         @echo "===--- updating makefiles phase 0"
54         $(MAKE) -r --no-print-directory -f ghc.mk phase=0 just-makefiles
55 ifneq "$(OMIT_PHASE_1)" "YES"
56         @echo "===--- updating makefiles phase 1"
57         $(MAKE) -r --no-print-directory -f ghc.mk phase=1 just-makefiles
58 endif
59 ifneq "$(OMIT_PHASE_2)" "YES"
60         @echo "===--- updating makefiles phase 2"
61         $(MAKE) -r --no-print-directory -f ghc.mk phase=2 just-makefiles
62 endif
63 ifneq "$(OMIT_PHASE_3)" "YES"
64         @echo "===--- updating makefiles phase 3"
65         $(MAKE) -r --no-print-directory -f ghc.mk phase=3 just-makefiles
66 endif
67         @echo "===--- finished updating makefiles"
68         $(MAKE) -r --no-print-directory -f ghc.mk $@
69
70 binary-dist:
71 ifeq "$(mingw32_TARGET_OS)" "1"
72         $(MAKE) -r --no-print-directory -f ghc.mk windows-binary-dist
73         $(MAKE) -r --no-print-directory -f ghc.mk windows-installer
74 else
75         rm -f bindist-list
76         $(MAKE) -r --no-print-directory -f ghc.mk bindist BINDIST=YES
77         $(MAKE) -r --no-print-directory -f ghc.mk binary-dist
78 endif
79
80 clean distclean maintainer-clean:
81         $(MAKE) -r --no-print-directory -f ghc.mk $@ CLEANING=YES
82         test ! -d testsuite || $(MAKE) -C testsuite $@
83
84 $(filter clean_%, $(MAKECMDGOALS)) : clean_% :
85         $(MAKE) -r --no-print-directory -f ghc.mk $@ CLEANING=YES
86
87 bootstrapping-files show:
88         $(MAKE) -r --no-print-directory -f ghc.mk $@
89
90 ifeq "$(darwin_TARGET_OS)" "1"
91 framework-pkg:
92         $(MAKE) -C distrib/MacOS $@
93 endif
94
95 # If the user says 'make A B', then we don't want to invoke two
96 # instances of the rule above in parallel:
97 .NOTPARALLEL:
98
99 endif