1
0
Fork 0

Fix slight inconsistency

When running make from either a keyboard folder or a subproject
it runs all keymaps for all subprojects and the selected subproject
respectively. Without this fix, the same doesn't happen if your
run make clean for example. As it would just provide you with an
error message. Now this will work as expected.
This commit is contained in:
Fred Sundvik 2016-08-24 10:29:01 +03:00
parent feebc58d32
commit 7c9fff59d0

View file

@ -262,7 +262,7 @@ define PARSE_KEYBOARD
# If there's no matching subproject, we assume it's the default # If there's no matching subproject, we assume it's the default
# This will allow you to leave the subproject part of the target out # This will allow you to leave the subproject part of the target out
else else
$$(eval $$(call PARSE_SUBPROJECT,defaultsp)) $$(eval $$(call PARSE_SUBPROJECT,))
endif endif
endef endef
@ -278,12 +278,14 @@ endef
define PARSE_SUBPROJECT define PARSE_SUBPROJECT
# If we want to compile the default subproject, then we need to # If we want to compile the default subproject, then we need to
# include the correct makefile to determine the actual name of it # include the correct makefile to determine the actual name of it
ifeq ($1,defaultsp) CURRENT_SP := $1
ifeq ($$(CURRENT_SP),)
CURRENT_SP := defaultsp
endif
ifeq ($$(CURRENT_SP),defaultsp)
SUBPROJECT_DEFAULT= SUBPROJECT_DEFAULT=
$$(eval include $(ROOT_DIR)/keyboards/$$(CURRENT_KB)/Makefile) $$(eval include $(ROOT_DIR)/keyboards/$$(CURRENT_KB)/Makefile)
CURRENT_SP := $$(SUBPROJECT_DEFAULT) CURRENT_SP := $$(SUBPROJECT_DEFAULT)
else
CURRENT_SP := $1
endif endif
# If current subproject is empty (the default was not defined), and we have a list of subproject # If current subproject is empty (the default was not defined), and we have a list of subproject
# then make all of them # then make all of them
@ -314,16 +316,16 @@ define PARSE_SUBPROJECT
# Otherwise try to match the keymap from the current folder, or arguments to the make command # Otherwise try to match the keymap from the current folder, or arguments to the make command
else ifneq ($$(KEYMAP),) else ifneq ($$(KEYMAP),)
$$(eval $$(call PARSE_KEYMAP,$$(KEYMAP))) $$(eval $$(call PARSE_KEYMAP,$$(KEYMAP)))
# No matching keymap found, so we assume that the rest of the rule is the target
# If we haven't been able to parse out a subproject, then make all of them
# This is consistent with running make without any arguments from the keyboard
# folder
else ifeq ($1,)
$$(eval $$(call PARSE_ALL_SUBPROJECTS))
# Otherwise, make all keymaps, again this is consistent with how it works without
# any arguments
else else
# Otherwise something is wrong with the target $$(eval $$(call PARSE_ALL_KEYMAPS))
# Try to give as much information as possible of what it it was trying to do
ifeq ($$(CURRENT_SP),)
$$(info make: *** No rule to make target '$$(CURRENT_KB)-$$(RULE)'. Stop.)
else
$$(info make: *** No rule to make target '$$(CURRENT_KB)-$$(CURRENT_SP)-$$(RULE)'. Stop.)
endif
# Notice the tab instead of spaces below!
exit 1
endif endif
else else
# As earlier mentione,d when allsb is specified, we call our self recursively # As earlier mentione,d when allsb is specified, we call our self recursively