Clean up building of libffi for dynamic lib way
[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 # No need to update makefiles for these targets:
36 REALGOALS=$(filter-out clean clean_% distclean maintainer-clean show,$(MAKECMDGOALS))
37
38 # NB. not the same as saying '%: ...', which doesn't do the right thing:
39 # it does nothing if we specify a target that already exists.
40 .PHONY: $(REALGOALS)
41 $(REALGOALS) all:
42         @echo "===--- updating makefiles phase 0"
43         $(MAKE) -r --no-print-directory -f ghc.mk phase=0 just-makefiles
44         @echo "===--- updating makefiles phase 1"
45         $(MAKE) -r --no-print-directory -f ghc.mk phase=1 just-makefiles
46         @echo "===--- updating makefiles phase 2"
47         $(MAKE) -r --no-print-directory -f ghc.mk phase=2 just-makefiles
48         @echo "===--- updating makefiles phase 3"
49         $(MAKE) -r --no-print-directory -f ghc.mk phase=3 just-makefiles
50         @echo "===--- finished updating makefiles"
51         $(MAKE) -r --no-print-directory -f ghc.mk $@
52
53 binary-dist:
54         rm -f bindist-list
55         $(MAKE) -r --no-print-directory -f ghc.mk bindist BINDIST=YES
56         $(MAKE) -r --no-print-directory -f ghc.mk binary-dist
57
58 clean distclean maintainer-clean:
59         $(MAKE) -r --no-print-directory -f ghc.mk $@
60         test ! -d testsuite || $(MAKE) -C testsuite $@
61
62 $(filter clean_%, $(MAKECMDGOALS)) : clean_% :
63         $(MAKE) -r --no-print-directory -f ghc.mk $@
64
65 show:
66         $(MAKE) -r --no-print-directory -f ghc.mk $@
67
68 # If the user says 'make A B', then we don't want to invoke two
69 # instances of the rule above in parallel:
70 .NOTPARALLEL:
71
72 endif
73