Only enable for required targets

master
David Allsopp 2019-10-15 12:04:19 +01:00
parent f568f858f4
commit a2ddf5571b
1 changed files with 16 additions and 0 deletions

View File

@ -17,8 +17,21 @@
ROOTDIR = .
# The configure and *clean targets can all be run without running ./configure
# first.
# If no goals were specified (i.e. `make`), add defaultentry (since it requires
# ./configure to be run)
CAN_BE_UNCONFIGURED := $(strip \
$(filter-out partialclean clean distclean configure, \
$(if $(MAKECMDGOALS),$(MAKECMDGOALS),defaultentry)))
ifeq "$(CAN_BE_UNCONFIGURED)" ""
-include Makefile.config
-include Makefile.common
else
include Makefile.config
include Makefile.common
endif
.PHONY: defaultentry
ifeq "$(NATIVE_COMPILER)" "true"
@ -1079,6 +1092,8 @@ distclean: clean
include .depend
ifneq "$(strip $(CAN_BE_UNCONFIGURED))" ""
Makefile.config Makefile.common: config.status
config.status:
@ -1092,3 +1107,4 @@ config.status:
@echo " make install"
@echo "should work."
@false
endif