diff --git a/Makefile b/Makefile index 4cc330ae20..f0eeec20a6 100644 --- a/Makefile +++ b/Makefile @@ -16,9 +16,26 @@ FW_TARGET_DIR=$(FW_DIR)/firmwares/$(MAINTARGET)-$(SUBTARGET) VERSION_FILE=$(FW_TARGET_DIR)/VERSION.txt UMASK=umask 022 +define newline + + +endef + + +define listtargets +$(error $(1) TARGET defined ! $(newline) \ + $(addprefix $(newline) * ,$(VALID_TARGETS)) \ + $(newline)Please specify one from the list above via 'TARGET' environment or in config.mk) +endef + # test for existing $TARGET-config or abort +VALID_TARGETS=$(sort $(notdir $(basename $(wildcard $(FW_DIR)/profiles/*.profiles)))) +ifdef TARGET ifeq ($(wildcard $(FW_DIR)/configs/$(TARGET).config),) -$(error config for $(TARGET) not defined) +$(call listtargets,Invalid) +endif +else +$(call listtargets,No) endif # if any of the following files have been changed: clean up openwrt dir diff --git a/config.mk b/config.mk index a5e114ee8d..4b40b1b727 100644 --- a/config.mk +++ b/config.mk @@ -1,5 +1,5 @@ # default parameters for Makefile SHELL:=$(shell which bash) -TARGET=ar71xx-generic +#TARGET=ar71xx-generic PACKAGES_LIST_DEFAULT=notunnel tunnel-berlin-tunneldigger manual MAKE_ARGS=