base: drop redundant Typeable derivings
[ghc.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://ghc.haskell.org/trac/ghc/wiki/Building/Architecture
9 # http://ghc.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 show
23 install show:
24 $(MAKE) -r --no-print-directory -f ghc.mk $@ BINDIST=YES NO_INCLUDE_DEPS=YES
25
26 else
27
28 .PHONY: default
29 default : all
30 @:
31
32 # For help, type 'make help'
33 .PHONY: help
34 help:
35 @cat MAKEHELP.md
36
37 ifneq "$(filter maintainer-clean distclean clean help,$(MAKECMDGOALS))" ""
38 -include mk/config.mk
39 else
40 include mk/config.mk
41 ifeq "$(ProjectVersion)" ""
42 $(error Please run ./configure first)
43 endif
44 endif
45
46 include mk/custom-settings.mk
47
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)
52 endif
53 endif
54
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))
57
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
61 # timestamps.
62 %.old: %
63 @set -x && test -f $@ && cmp -s $< $@ || cp -p $< $@
64 touch -r $@ $<
65
66
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
74 endif
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
78 endif
79 @echo "===--- building final phase"
80 $(MAKE) -r --no-print-directory -f ghc.mk phase=final $@
81
82 binary-dist: binary-dist-prep
83 mv bindistprep/*.tar.$(TAR_COMP_EXT) .
84
85 binary-dist-prep:
86 ifeq "$(mingw32_TARGET_OS)" "1"
87 $(MAKE) -r --no-print-directory -f ghc.mk windows-binary-dist-prep
88 else
89 rm -f bindist-list
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
92 endif
93
94 clean distclean maintainer-clean:
95 $(MAKE) -r --no-print-directory -f ghc.mk $@ CLEANING=YES
96 test ! -d testsuite || $(MAKE) -C testsuite $@
97
98 $(filter clean_%, $(MAKECMDGOALS)) : clean_% :
99 $(MAKE) -r --no-print-directory -f ghc.mk $@ CLEANING=YES
100
101 bootstrapping-files show echo:
102 $(MAKE) -r --no-print-directory -f ghc.mk $@
103
104 ifeq "$(darwin_TARGET_OS)" "1"
105 framework-pkg:
106 $(MAKE) -C distrib/MacOS $@
107 endif
108
109 # If the user says 'make A B', then we don't want to invoke two
110 # instances of the rule above in parallel:
111 .NOTPARALLEL:
112
113 endif
114
115 .PHONY: fasttest fast
116 fasttest fast:
117 $(MAKE) -C testsuite/tests CLEANUP=1 OUTPUT_SUMMARY=../../testsuite_summary.txt fast
118
119 .PHONY: fulltest test
120 fulltest test:
121 $(MAKE) -C testsuite/tests CLEANUP=1 OUTPUT_SUMMARY=../../testsuite_summary.txt