@ -99,40 +99,13 @@ $(eval $(call NEXT_PATH_ELEMENT))
# endif
# endif
# endif
# endif
d e f i n e G E T _ K E Y B O A R D S
i f n d e f A L T _ G E T _ K E Y B O A R D S
All_RULES_MK := $$ ( patsubst $( ROOT_DIR) /keyboards/%/rules.mk,%,$$ ( wildcard $( ROOT_DIR) /keyboards/*/rules.mk) )
All_RULES_MK += $$ ( patsubst $( ROOT_DIR) /keyboards/%/rules.mk,%,$$ ( wildcard $( ROOT_DIR) /keyboards/*/*/rules.mk) )
All_RULES_MK += $$ ( patsubst $( ROOT_DIR) /keyboards/%/rules.mk,%,$$ ( wildcard $( ROOT_DIR) /keyboards/*/*/*/rules.mk) )
All_RULES_MK += $$ ( patsubst $( ROOT_DIR) /keyboards/%/rules.mk,%,$$ ( wildcard $( ROOT_DIR) /keyboards/*/*/*/*/rules.mk) )
KEYMAPS_MK := $$ ( patsubst $( ROOT_DIR) /keyboards/%/rules.mk,%,$$ ( wildcard $( ROOT_DIR) /keyboards/*/keymaps/*/rules.mk) )
KEYMAPS_MK += $$ ( patsubst $( ROOT_DIR) /keyboards/%/rules.mk,%,$$ ( wildcard $( ROOT_DIR) /keyboards/*/*/keymaps/*/rules.mk) )
KEYMAPS_MK += $$ ( patsubst $( ROOT_DIR) /keyboards/%/rules.mk,%,$$ ( wildcard $( ROOT_DIR) /keyboards/*/*/*/keymaps/*/rules.mk) )
KEYMAPS_MK += $$ ( patsubst $( ROOT_DIR) /keyboards/%/rules.mk,%,$$ ( wildcard $( ROOT_DIR) /keyboards/*/*/*/*/keymaps/*/rules.mk) )
KEYBOARDS := $$ ( sort $$ ( filter-out $$ ( KEYMAPS_MK) , $$ ( All_RULES_MK) ) )
e l s e
KEYBOARDS := $( shell find keyboards/ -type f -iname "rules.mk" | grep -v keymaps | sed 's!keyboards/\(.*\)/rules.mk!\1!' | sort | uniq)
e n d i f
e n d e f
$( eval $ ( call GET_KEYBOARDS ) )
# Only consider folders with makefiles, to prevent errors in case there are extra folders
#KEYBOARDS += $(patsubst $(ROOD_DIR)/keyboards/%/rules.mk,%,$(wildcard $(ROOT_DIR)/keyboards/*/*/rules.mk))
.PHONY : list -keyboards
.PHONY : list -keyboards
list-keyboards :
list-keyboards :
echo $( KEYBOARDS)
util/list_keyboards.sh | sort -u | tr '\n' ' '
d e f i n e P R I N T _ K E Y B O A R D
$( info $( PRINTING_KEYBOARD) )
e n d e f
.PHONY : generate -keyboards -file
.PHONY : generate -keyboards -file
generate-keyboards-file :
generate-keyboards-file :
$( foreach PRINTING_KEYBOARD,$( KEYBOARDS) ,$( eval $( call PRINT_KEYBOARD) ) )
util/list_keyboards.sh | sort -u
.PHONY : clean
.PHONY : clean
clean :
clean :
@ -159,7 +132,6 @@ endif
# $(info Keyboard: $(KEYBOARD))
# $(info Keyboard: $(KEYBOARD))
# $(info Keymap: $(KEYMAP))
# $(info Keymap: $(KEYMAP))
# $(info Subproject: $(SUBPROJECT))
# $(info Subproject: $(SUBPROJECT))
# $(info Keyboards: $(KEYBOARDS))
# Set the default goal depending on where we are running make from
# Set the default goal depending on where we are running make from
@ -294,7 +266,7 @@ define PARSE_RULE
$$ ( eval $$ ( call PARSE_TEST) )
$$ ( eval $$ ( call PARSE_TEST) )
# If the rule starts with the name of a known keyboard, then continue
# If the rule starts with the name of a known keyboard, then continue
# the parsing from PARSE_KEYBOARD
# the parsing from PARSE_KEYBOARD
else ifeq ( $$ ( call TRY_TO_MATCH_RULE_FROM_LIST,$$ ( KEYBOARDS ) ) ,true)
else ifeq ( $$ ( call TRY_TO_MATCH_RULE_FROM_LIST,$$ ( shell util/list_keyboards.sh | sort -u ) ) ,true)
KEYBOARD_RULE = $$ ( MATCHED_ITEM)
KEYBOARD_RULE = $$ ( MATCHED_ITEM)
$$ ( eval $$ ( call PARSE_KEYBOARD,$$ ( MATCHED_ITEM) ) )
$$ ( eval $$ ( call PARSE_KEYBOARD,$$ ( MATCHED_ITEM) ) )
# Otherwise use the KEYBOARD variable, which is determined either by
# Otherwise use the KEYBOARD variable, which is determined either by
@ -411,7 +383,7 @@ endef
# if we are going to compile all keyboards, match the rest of the rule
# if we are going to compile all keyboards, match the rest of the rule
# for each of them
# for each of them
d e f i n e P A R S E _ A L L _ K E Y B O A R D S
d e f i n e P A R S E _ A L L _ K E Y B O A R D S
$$ ( eval $$ ( call PARSE_ALL_IN_LIST,PARSE_KEYBOARD,$( KEYBOARDS ) ) )
$$ ( eval $$ ( call PARSE_ALL_IN_LIST,PARSE_KEYBOARD,$( shell util/list_keyboards.sh noci | sort -u ) ) )
e n d e f
e n d e f
# $1 Subproject
# $1 Subproject