refactor Makefile.config_if_required for easier reuse of variables

master
Gabriel Scherer 2020-05-05 14:08:43 +02:00
parent e34e62253f
commit 3489e002c6
1 changed files with 7 additions and 5 deletions

View File

@ -13,15 +13,17 @@
#* *
#**************************************************************************
ifeq "$(MAKECMDGOALS)" ""
MAKECMDGOALS += defaultentry
endif
CLEAN_TARGET_NAMES=clean partialclean distclean
# Some special targets ('*clean' and 'configure') do not require configuration.
# REQUIRES_CONFIGURATION is empty if only those targets are requested,
# and non-empty if configuration is required.
REQUIRES_CONFIGURATION := $(strip \
$(filter-out partialclean clean distclean configure, \
$(if $(MAKECMDGOALS),$(MAKECMDGOALS),defaultentry)))
# If no goals were specified (i.e. `make`), we add defaultentry
# (since it requires ./configure to be run) so that
# REQUIRES_CONFIGURATION is non-empty.
$(filter-out $(CLEAN_TARGET_NAMES) configure, $(MAKECMDGOALS)))
ifneq "$(REQUIRES_CONFIGURATION)" ""
include $(ROOTDIR)/Makefile.build_config