summaryrefslogtreecommitdiff
path: root/tmk_core
diff options
context:
space:
mode:
authorfredizzimo <fsundvik@gmail.com>2016-06-19 01:09:21 +0300
committerJack Humbert <jack.humb@gmail.com>2016-06-18 18:09:21 -0400
commit3f6fac4721c0f03dab7704b09329d720c85470ce (patch)
tree90c1b6b37749bff415fcf328dc536234ece7e600 /tmk_core
parentdb32864ce7029d758f57729cc2f75e051a28d0a2 (diff)
Add quick version of the all-* makefile targets (#417)
Diffstat (limited to 'tmk_core')
-rw-r--r--tmk_core/rules.mk22
1 files changed, 15 insertions, 7 deletions
diff --git a/tmk_core/rules.mk b/tmk_core/rules.mk
index 99ae91b635..2b703e057f 100644
--- a/tmk_core/rules.mk
+++ b/tmk_core/rules.mk
@@ -661,29 +661,36 @@ show_path:
@echo SRC=$(SRC)
SUBDIRS := $(sort $(dir $(wildcard $(TOP_DIR)/keyboard/*/.)))
-all-keyboards-defaults:
+all-keyboards-defaults-%:
@for x in $(SUBDIRS) ; do \
printf "Compiling with default: $$x" | $(AWK_CMD); \
- LOG=$$($(MAKE) -C $$x VERBOSE=$(VERBOSE) COLOR=$(COLOR) SILENT=true 2>&1) ; if [ $$? -gt 0 ]; then $(PRINT_ERROR_PLAIN); elif [ "$$LOG" != "" ] ; then $(PRINT_WARNING_PLAIN); else $(PRINT_OK); fi; \
+ LOG=$$($(MAKE) -C $$x $(subst all-keyboards-defaults-,,$@) VERBOSE=$(VERBOSE) COLOR=$(COLOR) SILENT=true 2>&1) ; if [ $$? -gt 0 ]; then $(PRINT_ERROR_PLAIN); elif [ "$$LOG" != "" ] ; then $(PRINT_WARNING_PLAIN); else $(PRINT_OK); fi; \
done
+all-keyboards-defaults: all-keyboards-defaults-all
+
KEYBOARDS := $(SUBDIRS:$(TOP_DIR)/keyboard/%/=/keyboard/%)
-all-keyboards: $(KEYBOARDS)
+all-keyboards-%: $(KEYBOARDS)
/keyboard/%:
$(eval KEYBOARD=$(patsubst /keyboard/%,%,$@))
$(eval KEYMAPS=$(notdir $(patsubst %/.,%,$(wildcard $(TOP_DIR)$@/keymaps/*/.))))
@for x in $(KEYMAPS) ; do \
printf "Compiling $(BOLD)$(KEYBOARD)$(NO_COLOR) with $(BOLD)$$x$(NO_COLOR)" | $(AWK) '{ printf "%-88s", $$0; }'; \
- LOG=$$($(MAKE) -C $(TOP_DIR)$@ keymap=$$x VERBOSE=$(VERBOSE) COLOR=$(COLOR) SILENT=true 2>&1) ; if [ $$? -gt 0 ]; then $(PRINT_ERROR_PLAIN); elif [ "$$LOG" != "" ] ; then $(PRINT_WARNING_PLAIN); else $(PRINT_OK); fi; \
+ LOG=$$($(MAKE) -C $(TOP_DIR)$@ $(subst all-keyboards-,,$@) keymap=$$x VERBOSE=$(VERBOSE) COLOR=$(COLOR) SILENT=true 2>&1) ; if [ $$? -gt 0 ]; then $(PRINT_ERROR_PLAIN); elif [ "$$LOG" != "" ] ; then $(PRINT_WARNING_PLAIN); else $(PRINT_OK); fi; \
done
-all-keymaps:
+all-keyboards: all-keyboards-all
+
+all-keymaps-%:
+ $(eval MAKECONFIG=$(call get_target,all-keymaps,$@))
$(eval KEYMAPS=$(notdir $(patsubst %/.,%,$(wildcard $(TOP_DIR)/keyboard/$(KEYBOARD)/keymaps/*/.))))
@for x in $(KEYMAPS) ; do \
printf "Compiling $(BOLD)$(KEYBOARD)$(NO_COLOR) with $(BOLD)$$x$(NO_COLOR)" | $(AWK) '{ printf "%-88s", $$0; }'; \
- LOG=$$($(MAKE) keyboard=$(KEYBOARD) keymap=$$x VERBOSE=$(VERBOSE) COLOR=$(COLOR) SILENT=true 2>&1) ; if [ $$? -gt 0 ]; then $(PRINT_ERROR_PLAIN); elif [ "$$LOG" != "" ] ; then $(PRINT_WARNING_PLAIN); else $(PRINT_OK); fi; \
+ LOG=$$($(MAKE) $(subst all-keymaps-,,$@) keyboard=$(KEYBOARD) keymap=$$x VERBOSE=$(VERBOSE) COLOR=$(COLOR) SILENT=true 2>&1) ; if [ $$? -gt 0 ]; then $(PRINT_ERROR_PLAIN); elif [ "$$LOG" != "" ] ; then $(PRINT_WARNING_PLAIN); else $(PRINT_OK); fi; \
done
+all-keymaps: all-keymaps-all
+
# Create build directory
$(shell mkdir $(BUILD_DIR) 2>/dev/null)
@@ -700,4 +707,5 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
build elf hex eep lss sym coff extcoff \
clean clean_list debug gdb-config show_path \
program teensy dfu flip dfu-ee flip-ee dfu-start \
-all-keyboards-defaults all-keyboards all-keymaps
+all-keyboards-defaults all-keyboards all-keymaps \
+all-keyboards-defaults-% all-keyboards-% all-keymaps-%