Testsuite: mark T8089 expect_broken(#7325) on Windows
[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 # Eliminate use of the built-in implicit rules, and clear out the default list
14 # of suffixes for suffix rules. Speeds up make quite a bit. Both are needed
15 # for the shortest `make -d` output.
16 # Don't set --no-builtin-variables; some rules might stop working if you do
17 # (e.g. 'make clean' in testsuite/ currently relies on an implicit $RM).
18 MAKEFLAGS += --no-builtin-rules
19 .SUFFIXES:
20
21 ifeq "$(wildcard distrib/)" ""
22
23 # We're in a bindist
24
25 .PHONY: default
26 default:
27 @echo 'Run "make install" to install'
28 @false
29
30 .PHONY: install show
31 install show:
32 $(MAKE) --no-print-directory -f ghc.mk $@ BINDIST=YES NO_INCLUDE_DEPS=YES
33
34 else
35
36 .PHONY: default
37 default : all
38 @:
39
40 # For help, type 'make help'
41 .PHONY: help
42 help:
43 @cat MAKEHELP.md
44
45 ifneq "$(filter maintainer-clean distclean clean clean_% help,$(MAKECMDGOALS))" ""
46 -include mk/config.mk
47 else
48 include mk/config.mk
49 ifeq "$(ProjectVersion)" ""
50 $(error Please run ./configure first)
51 endif
52 endif
53
54 include mk/custom-settings.mk
55
56 # Verify that stage 0 LLVM backend isn't affected by Bug #9439 if needed
57 ifeq "$(GHC_LLVM_AFFECTED_BY_9439)" "1"
58 ifneq "$(findstring -fllvm,$(GhcHcOpts) $(GhcStage1HcOpts))" ""
59 $(error Stage 0 compiler is affected by Bug #9439. Refusing to bootstrap with -fllvm)
60 endif
61 endif
62
63 # No need to update makefiles for these targets:
64 # (the ones we're filtering out)
65 REALGOALS=$(filter-out \
66 binary-dist \
67 binary-dist-prep \
68 sdist sdist-ghc \
69 sdist-ghc-prep \
70 sdist-windows-tarballs \
71 sdist-windows-tarballs-prep \
72 sdist-testsuite \
73 sdist-testsuite-prep \
74 bootstrapping-files \
75 framework-pkg \
76 clean \
77 clean_% \
78 distclean \
79 maintainer-clean \
80 show \
81 show! \
82 echo \
83 help \
84 test \
85 fulltest \
86 fasttest \
87 ,$(MAKECMDGOALS))
88
89 # configure touches certain files even if they haven't changed. This
90 # can mean a lot of unnecessary recompilation after a re-configure, so
91 # here we cache the old versions of these files so we can restore the
92 # timestamps.
93 %.old: %
94 @set -x && test -f $@ && cmp -s $< $@ || cp -p $< $@
95 touch -r $@ $<
96
97
98 # NB. not the same as saying '%: ...', which doesn't do the right thing:
99 # it does nothing if we specify a target that already exists.
100 .PHONY: $(REALGOALS) all
101 $(REALGOALS) all: mk/config.mk.old mk/project.mk.old compiler/ghc.cabal.old
102 ifneq "$(OMIT_PHASE_0)" "YES"
103 @echo "===--- building phase 0"
104 $(MAKE) --no-print-directory -f ghc.mk phase=0 phase_0_builds
105 endif
106 ifneq "$(OMIT_PHASE_1)" "YES"
107 @echo "===--- building phase 1"
108 $(MAKE) --no-print-directory -f ghc.mk phase=1 phase_1_builds
109 endif
110 @echo "===--- building final phase"
111 $(MAKE) --no-print-directory -f ghc.mk phase=final $@
112
113 .PHONY: binary-dist
114 binary-dist: binary-dist-prep
115 mv bindistprep/*.tar.$(TAR_COMP_EXT) .
116
117 .PHONY: binary-dist-prep
118 binary-dist-prep:
119 ifeq "$(mingw32_TARGET_OS)" "1"
120 $(MAKE) --no-print-directory -f ghc.mk windows-binary-dist-prep
121 else
122 rm -f bindist-list
123 $(MAKE) --no-print-directory -f ghc.mk bindist-list BINDIST=YES
124 $(MAKE) --no-print-directory -f ghc.mk unix-binary-dist-prep
125 endif
126
127 .PHONY: sdist sdist-ghc sdist-ghc-prep sdist-windows-tarballs sdist-windows-tarballs-prep sdist-testsuite sdist-testsuite-prep
128 # Just running `./boot && ./configure && make sdist` should work, so skip
129 # phase 0 and 1 and don't build any dependency files.
130 sdist sdist-ghc sdist-ghc-prep sdist-windows-tarballs sdist-windows-tarballs-prep sdist-testsuite sdist-testsuite-prep :
131 $(MAKE) --no-print-directory -f ghc.mk $@ NO_INCLUDE_DEPS=YES NO_INCLUDE_PKGDATA=YES
132
133 .PHONY: clean distclean maintainer-clean
134 clean distclean maintainer-clean:
135 $(MAKE) --no-print-directory -f ghc.mk $@ CLEANING=YES
136 test ! -d testsuite || $(MAKE) -C testsuite $@
137
138 .PHONY: $(filter clean_%,$(MAKECMDGOALS))
139 $(filter clean_%, $(MAKECMDGOALS)) : clean_% :
140 $(MAKE) --no-print-directory -f ghc.mk $@ CLEANING=YES
141
142 .PHONY: bootstrapping-files show echo
143 bootstrapping-files show echo:
144 $(MAKE) --no-print-directory -f ghc.mk $@
145
146 .PHONY: show!
147 show!:
148 $(MAKE) --no-print-directory -f ghc.mk show NO_INCLUDE_PKGDATA=YES
149
150 ifeq "$(darwin_TARGET_OS)" "1"
151 .PHONY: framework-pkg
152 framework-pkg:
153 $(MAKE) -C distrib/MacOS $@
154 endif
155
156 # If the user says 'make A B', then we don't want to invoke two
157 # instances of the rule above in parallel:
158 .NOTPARALLEL:
159
160 endif
161
162 .PHONY: fasttest
163 fasttest:
164 $(MAKE) -C testsuite/tests CLEANUP=1 SUMMARY_FILE=../../testsuite_summary.txt fast
165
166 .PHONY: fulltest test
167 fulltest test:
168 $(MAKE) -C testsuite/tests CLEANUP=1 SUMMARY_FILE=../../testsuite_summary.txt