]> git.donarmstrong.com Git - qmk_firmware.git/blobdiff - tmk_core/chibios.mk
Do some cleanup for the API
[qmk_firmware.git] / tmk_core / chibios.mk
index c804d237e2822a2ebd59c6fba83bbc358ad2494f..4fa9fac2effe027e722a6e0d0230477f839b0a0e 100644 (file)
@@ -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