Commit 4de8028d authored by thomie's avatar thomie

Build system: check $CLEANING instead of $MAKECMDGOALS

To check if we're cleaning, always check the $CLEANING variable, instead
of sometimes $CLEANING, sometimes $MAKECMDGOALS.

[skip ci]
parent 51aacde6
......@@ -140,7 +140,7 @@ echo:
include mk/tree.mk
ifeq "$(findstring clean,$(MAKECMDGOALS))" ""
ifneq "$(CLEANING)" "YES"
include mk/config.mk
ifeq "$(ProjectVersion)" ""
$(error Please run ./configure first)
......@@ -155,7 +155,7 @@ include mk/custom-settings.mk
SRC_CC_OPTS += $(WERROR)
SRC_HC_OPTS += $(WERROR)
ifeq "$(findstring clean,$(MAKECMDGOALS))" ""
ifneq "$(CLEANING)" "YES"
ifeq "$(DYNAMIC_GHC_PROGRAMS)" "YES"
ifeq "$(findstring dyn,$(GhcLibWays))" ""
$(error dyn is not in $$(GhcLibWays), but $$(DYNAMIC_GHC_PROGRAMS) is YES)
......@@ -203,7 +203,7 @@ $(eval $(call clean-target,root,inplace,inplace/bin inplace/lib))
# When we're just doing 'make clean' or 'make show', then we don't need
# to build dependencies.
ifneq "$(findstring clean,$(MAKECMDGOALS))" ""
ifeq "$(CLEANING)" "YES"
NO_INCLUDE_DEPS = YES
NO_INCLUDE_PKGDATA = YES
endif
......@@ -650,7 +650,7 @@ endif
ifeq "$(INTEGER_LIBRARY)" "integer-gmp"
BUILD_DIRS += libraries/integer-gmp/gmp
else ifneq "$(findstring clean,$(MAKECMDGOALS))" ""
else ifeq "$(CLEANING)" "YES"
BUILD_DIRS += libraries/integer-gmp/gmp
endif
......
......@@ -46,7 +46,7 @@ endif
ifeq "$(phase)" "final"
ifeq "$(findstring clean,$(MAKECMDGOALS))" ""
ifneq "$(CLEANING)" "YES"
include libraries/integer-gmp/gmp/config.mk
endif
......
......@@ -52,7 +52,7 @@ $(call clean-target,$1,$2,$1/$2 $$($1_$2_INPLACE))
clean_$1 : clean_$1_$2
# INPLACE_BIN etc. might be empty if we're cleaning
ifeq "$(findstring clean,$(MAKECMDGOALS))" ""
ifneq "$$(CLEANING)" "YES"
ifneq "$$(BINDIST)" "YES"
$1/$2/$$($1_$2_PROG).prl: $1/$$($1_PERL_SRC) $$$$(unlit_INPLACE) | $$$$(dir $$$$@)/.
"$$(unlit_INPLACE)" $$(UNLIT_OPTS) $$< $$@
......
......@@ -81,13 +81,13 @@ endif
$1_$2_depfile_base = $1/$2/build/.depend
ifeq "$$($1_$2_INSTALL_INPLACE)" "NO"
ifeq "$(findstring clean,$(MAKECMDGOALS))" ""
ifneq "$$(CLEANING)" "YES"
$1_$2_INPLACE = $$(error $1_$2 should not be installed inplace, but INPLACE var evaluated)
else
$1_$2_INPLACE =
endif
else
ifeq "$(findstring clean,$(MAKECMDGOALS))" ""
ifneq "$$(CLEANING)" "YES"
ifneq "$$($$($1_$2_PROGNAME)_INPLACE)" ""
$$(error $$($1_$2_PROGNAME)_INPLACE defined twice)
endif
......@@ -279,7 +279,7 @@ endif
endif
# INPLACE_BIN might be empty if we're distcleaning
ifeq "$(findstring clean,$(MAKECMDGOALS))" ""
ifneq "$$(CLEANING)" "YES"
ifeq "$$($1_$2_INSTALL_INPLACE)" "YES"
$$($1_$2_INPLACE) : $1/$2/build/tmp/$$($1_$2_PROG_INPLACE) | $$$$(dir $$$$@)/.
$$(INSTALL) -m 755 $$< $$@
......
......@@ -187,6 +187,7 @@ $(ghc-config-mk) : $(TOP)/mk/ghc-config
$(TOP)/mk/ghc-config "$(TEST_HC)" >"$@"; if [ $$? != 0 ]; then $(RM) "$@"; exit 1; fi
# If the ghc-config fails, remove $@, and fail
# Note: $(CLEANING) is not defined in the testsuite.
ifeq "$(findstring clean,$(MAKECMDGOALS))" ""
include $(ghc-config-mk)
endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment