Hadrian: generate JUnit testsuite report in Linux CI job
[ghc.git] / Makefile
index 348375f..d788599 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -5,8 +5,8 @@
 # This file is part of the GHC build system.
 #
 # To understand how the build system works and how to modify it, see
-#      http://ghc.haskell.org/trac/ghc/wiki/Building/Architecture
-#      http://ghc.haskell.org/trac/ghc/wiki/Building/Modifying
+#      https://gitlab.haskell.org/ghc/ghc/wikis/building/architecture
+#      https://gitlab.haskell.org/ghc/ghc/wikis/building/modifying
 #
 # -----------------------------------------------------------------------------
 
 MAKEFLAGS += --no-builtin-rules
 .SUFFIXES:
 
+
+# -----------------------------------------------------------------------------
+# Sanitize environment
+
+# See #11530
+export GREP_OPTIONS :=
+
+ifneq "$(filter maintainer-clean distclean clean clean_% help,$(MAKECMDGOALS))" ""
+-include mk/config.mk
+else
+include mk/config.mk
+ifeq "$(ProjectVersion)" ""
+$(error Please run ./configure first)
+endif
+endif
+
+include mk/custom-settings.mk
+
+
 ifeq "$(wildcard distrib/)" ""
 
 # We're in a bindist
@@ -45,7 +64,7 @@ install show:
 .PHONY: install-strip
 install-strip:
        # See Note [install-strip].
-       $(MAKE) --no-print-directory -f ghc.mk INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' install
+       $(MAKE) --no-print-directory -f ghc.mk INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' install BINDIST=YES NO_INCLUDE_DEPS=YES
 
 else
 
@@ -58,24 +77,6 @@ default : all
 help:
        @cat MAKEHELP.md
 
-ifneq "$(filter maintainer-clean distclean clean clean_% help,$(MAKECMDGOALS))" ""
--include mk/config.mk
-else
-include mk/config.mk
-ifeq "$(ProjectVersion)" ""
-$(error Please run ./configure first)
-endif
-endif
-
-include mk/custom-settings.mk
-
-# Verify that stage 0 LLVM backend isn't affected by Bug #9439 if needed
-ifeq "$(GHC_LLVM_AFFECTED_BY_9439)" "1"
-ifneq "$(findstring -fllvm,$(SRC_HC_OPTS) $(GhcHcOpts) $(GhcStage1HcOpts))" ""
-$(error Stage 0 compiler is affected by Bug #9439. Refusing to bootstrap with -fllvm)
-endif
-endif
-
 # No need to update makefiles for these targets:
 # (the ones we're filtering out)
 REALGOALS=$(filter-out \
@@ -102,6 +103,7 @@ REALGOALS=$(filter-out \
     fulltest \
     slowtest \
     fasttest \
+    fast \
   ,$(MAKECMDGOALS))
 
 # configure touches certain files even if they haven't changed.  This
@@ -128,9 +130,15 @@ endif
        @echo "===--- building final phase"
        $(MAKE) --no-print-directory -f ghc.mk phase=final $@
 
+# if BINARY_DIST_DIR is not set, assume we want the old
+# behaviour of placing the binary dist into the current
+# directory. Provide BINARY_DIST_DIR to put the final
+# binary distribution elsewhere.
+BINARY_DIST_DIR ?= .
+
 .PHONY: binary-dist
 binary-dist: binary-dist-prep
-       mv bindistprep/*.tar.$(TAR_COMP_EXT) .
+       mv bindistprep/*.tar.$(TAR_COMP_EXT) "$(BINARY_DIST_DIR)"
 
 .PHONY: binary-dist-prep
 binary-dist-prep:
@@ -218,3 +226,8 @@ test:
 .PHONY: slowtest fulltest
 slowtest fulltest:
        $(MAKE) -C testsuite/tests CLEANUP=1 SUMMARY_FILE=../../testsuite_summary.txt slow
+
+.PHONY: fast
+fast:
+       @echo "You can use 'make fast' only from inside a sub-component directory."
+       @exit 1