diff options
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 22 |
1 files changed, 17 insertions, 5 deletions
| @@ -358,7 +358,6 @@ define PARSE_KEYMAP | |||
| 358 | MAKE_TARGET := $$(patsubst -%,%,$$(RULE)) | 358 | MAKE_TARGET := $$(patsubst -%,%,$$(RULE)) |
| 359 | # We need to generate an unique indentifer to append to the COMMANDS list | 359 | # We need to generate an unique indentifer to append to the COMMANDS list |
| 360 | COMMAND := COMMAND_KEYBOARD_$$(CURRENT_KB)_SUBPROJECT_$(CURRENT_SP)_KEYMAP_$$(CURRENT_KM) | 360 | COMMAND := COMMAND_KEYBOARD_$$(CURRENT_KB)_SUBPROJECT_$(CURRENT_SP)_KEYMAP_$$(CURRENT_KM) |
| 361 | COMMANDS += $$(COMMAND) | ||
| 362 | # If we are compiling a keyboard without a subproject, we want to display just the name | 361 | # If we are compiling a keyboard without a subproject, we want to display just the name |
| 363 | # of the keyboard, otherwise keyboard/subproject | 362 | # of the keyboard, otherwise keyboard/subproject |
| 364 | ifeq ($$(CURRENT_SP),) | 363 | ifeq ($$(CURRENT_SP),) |
| @@ -370,13 +369,18 @@ define PARSE_KEYMAP | |||
| 370 | KB_SP := $(BOLD)$$(KB_SP)$(NO_COLOR) | 369 | KB_SP := $(BOLD)$$(KB_SP)$(NO_COLOR) |
| 371 | # Specify the variables that we are passing forward to submake | 370 | # Specify the variables that we are passing forward to submake |
| 372 | MAKE_VARS := KEYBOARD=$$(CURRENT_KB) SUBPROJECT=$$(CURRENT_SP) KEYMAP=$$(CURRENT_KM) | 371 | MAKE_VARS := KEYBOARD=$$(CURRENT_KB) SUBPROJECT=$$(CURRENT_SP) KEYMAP=$$(CURRENT_KM) |
| 373 | MAKE_VARS += VERBOSE=$(VERBOSE) COLOR=$(COLOR) | ||
| 374 | # And the first part of the make command | 372 | # And the first part of the make command |
| 375 | MAKE_CMD := $$(MAKE) -r -R -C $(ROOT_DIR) -f build_keyboard.mk $$(MAKE_TARGET) | 373 | MAKE_CMD := $$(MAKE) -r -R -C $(ROOT_DIR) -f build_keyboard.mk $$(MAKE_TARGET) |
| 376 | # The message to display | 374 | # The message to display |
| 377 | MAKE_MSG := $$(MSG_MAKE_KB) | 375 | MAKE_MSG := $$(MSG_MAKE_KB) |
| 378 | # We run the command differently, depending on if we want more output or not | 376 | # We run the command differently, depending on if we want more output or not |
| 379 | # The true version for silent output and the false version otherwise | 377 | # The true version for silent output and the false version otherwise |
| 378 | $$(eval $$(call BUILD)) | ||
| 379 | endef | ||
| 380 | |||
| 381 | define BUILD | ||
| 382 | MAKE_VARS += VERBOSE=$(VERBOSE) COLOR=$(COLOR) | ||
| 383 | COMMANDS += $$(COMMAND) | ||
| 380 | COMMAND_true_$$(COMMAND) := \ | 384 | COMMAND_true_$$(COMMAND) := \ |
| 381 | printf "$$(MAKE_MSG)" | \ | 385 | printf "$$(MAKE_MSG)" | \ |
| 382 | $$(MAKE_MSG_FORMAT); \ | 386 | $$(MAKE_MSG_FORMAT); \ |
| @@ -398,13 +402,21 @@ define PARSE_ALL_KEYMAPS | |||
| 398 | $$(eval $$(call PARSE_ALL_IN_LIST,PARSE_KEYMAP,$$(KEYMAPS))) | 402 | $$(eval $$(call PARSE_ALL_IN_LIST,PARSE_KEYMAP,$$(KEYMAPS))) |
| 399 | endef | 403 | endef |
| 400 | 404 | ||
| 405 | define BUILD_TEST | ||
| 406 | TEST_NAME := $1 | ||
| 407 | MAKE_TARGET := $2 | ||
| 408 | COMMAND := $1 | ||
| 409 | MAKE_CMD := $$(MAKE) -r -R -C $(ROOT_DIR) -f build_test.mk $$(MAKE_TARGET) | ||
| 410 | MAKE_VARS := TEST=$$(TEST_NAME) | ||
| 411 | MAKE_MSG := $$(MSG_MAKE_TEST) | ||
| 412 | $$(eval $$(call BUILD)) | ||
| 413 | endef | ||
| 414 | |||
| 401 | define PARSE_TEST | 415 | define PARSE_TEST |
| 402 | TEST_NAME := $$(firstword $$(subst -, ,$$(RULE))) | 416 | TEST_NAME := $$(firstword $$(subst -, ,$$(RULE))) |
| 403 | TEST_TARGET := $$(subst $$(TEST_NAME),,$$(subst $$(TEST_NAME)-,,$$(RULE))) | 417 | TEST_TARGET := $$(subst $$(TEST_NAME),,$$(subst $$(TEST_NAME)-,,$$(RULE))) |
| 404 | MATCHED_TESTS := $$(foreach TEST,$$(TEST_LIST),$$(if $$(findstring $$(TEST_NAME),$$(TEST)),$$(TEST),)) | 418 | MATCHED_TESTS := $$(foreach TEST,$$(TEST_LIST),$$(if $$(findstring $$(TEST_NAME),$$(TEST)),$$(TEST),)) |
| 405 | $$(info Test name $$(TEST_NAME)) | 419 | $$(foreach TEST,$$(MATCHED_TESTS),$$(eval $$(call BUILD_TEST,$$(TEST),$$(TEST_TARGET)))) |
| 406 | $$(info Test target $$(TEST_TARGET)) | ||
| 407 | $$(info $$(MATCHED_TESTS)) | ||
| 408 | endef | 420 | endef |
| 409 | 421 | ||
| 410 | 422 | ||
