summaryrefslogtreecommitdiffstats
path: root/tmk_core/chibios.mk
diff options
context:
space:
mode:
authorJack Humbert <jack.humb@gmail.com>2017-11-01 20:01:45 -0400
committerGitHub <noreply@github.com>2017-11-01 20:01:45 -0400
commitfe56fffe7d70e706432a1d1f6315a7978390e57b (patch)
tree6625b3c6b5fc55a9b165105ea2b73e6834ba8540 /tmk_core/chibios.mk
parentd069a42c072e32072da62b14b13c1f27f7432c92 (diff)
Adds .qmk file type as a target for QMK Toolbox (#1084)
* adds .qmk file type as a target * adds info.json with vendor and product * add files for qmk info script * add layout file for planck * ignore .qmk files * more settings * update rules for avr and chibios * update .qmk generation for info.json and inheritence
Diffstat (limited to 'tmk_core/chibios.mk')
-rw-r--r--tmk_core/chibios.mk24
1 files changed, 24 insertions, 0 deletions
diff --git a/tmk_core/chibios.mk b/tmk_core/chibios.mk
index c804d237e2..4fa9fac2ef 100644
--- a/tmk_core/chibios.mk
+++ b/tmk_core/chibios.mk
@@ -180,6 +180,30 @@ EXTRALIBDIRS = $(RULESPATH)/ld
DFU_UTIL ?= dfu-util
+# Generate a .qmk for the QMK-FF
+qmk: $(BUILD_DIR)/$(TARGET).bin
+ zip $(TARGET).qmk -FSrj $(KEYMAP_PATH)/*
+ zip $(TARGET).qmk -u $<
+ printf "@ $<\n@=firmware.bin\n" | zipnote -w $(TARGET).qmk
+ printf "{\n \"generated\": \"%s\"\n}" "$$(date)" > $(BUILD_DIR)/$(TARGET).json
+ if [ -f $(KEYBOARD_PATH_5)/info.json ]; then \
+ jq -s '.[0] * .[1]' $(BUILD_DIR)/$(TARGET).json $(KEYBOARD_PATH_5)/info.json | ex -sc 'wq!$(BUILD_DIR)/$(TARGET).json' /dev/stdin; \
+ fi
+ if [ -f $(KEYBOARD_PATH_4)/info.json ]; then \
+ jq -s '.[0] * .[1]' $(BUILD_DIR)/$(TARGET).json $(KEYBOARD_PATH_4)/info.json | ex -sc 'wq!$(BUILD_DIR)/$(TARGET).json' /dev/stdin; \
+ fi
+ if [ -f $(KEYBOARD_PATH_3)/info.json ]; then \
+ jq -s '.[0] * .[1]' $(BUILD_DIR)/$(TARGET).json $(KEYBOARD_PATH_3)/info.json | ex -sc 'wq!$(BUILD_DIR)/$(TARGET).json' /dev/stdin; \
+ fi
+ if [ -f $(KEYBOARD_PATH_2)/info.json ]; then \
+ jq -s '.[0] * .[1]' $(BUILD_DIR)/$(TARGET).json $(KEYBOARD_PATH_2)/info.json | ex -sc 'wq!$(BUILD_DIR)/$(TARGET).json' /dev/stdin; \
+ fi
+ if [ -f $(KEYBOARD_PATH_1)/info.json ]; then \
+ jq -s '.[0] * .[1]' $(BUILD_DIR)/$(TARGET).json $(KEYBOARD_PATH_1)/info.json | ex -sc 'wq!$(BUILD_DIR)/$(TARGET).json' /dev/stdin; \
+ fi
+ zip $(TARGET).qmk -urj $(BUILD_DIR)/$(TARGET).json
+ printf "@ $(TARGET).json\n@=info.json\n" | zipnote -w $(TARGET).qmk
+
dfu-util: $(BUILD_DIR)/$(TARGET).bin sizeafter
$(DFU_UTIL) $(DFU_ARGS) -D $(BUILD_DIR)/$(TARGET).bin