qmk_firmware/builddefs/xap.mk

43 lines
1.6 KiB
Makefile
Raw Normal View History

2022-02-13 22:46:17 +00:00
# Copyright 2022 Nick Brassel (@tzarc)
# SPDX-License-Identifier: GPL-2.0-or-later
# XAP embedded info.json
$(KEYMAP_OUTPUT)/src/info_json_gz.h: $(INFO_JSON_FILES)
@$(SILENT) || printf "$(MSG_GENERATING) $@" | $(AWK_CMD)
$(eval CMD=$(QMK_BIN) xap-generate-info-h -o "$(KEYMAP_OUTPUT)/src/info_json_gz.h" -kb $(KEYBOARD) -km $(KEYMAP))
2022-02-13 22:46:17 +00:00
@$(BUILD_CMD)
XAP_FILES := $(shell ls -1 data/xap/* | sort | xargs echo)
ifneq ("$(wildcard $(KEYBOARD_PATH_1)/xap.json)","")
XAP_FILES += $(KEYBOARD_PATH_1)/xap.json
endif
ifneq ("$(wildcard $(KEYBOARD_PATH_2)/xap.json)","")
XAP_FILES += $(KEYBOARD_PATH_2)/xap.json
endif
ifneq ("$(wildcard $(KEYBOARD_PATH_3)/xap.json)","")
XAP_FILES += $(KEYBOARD_PATH_3)/xap.json
endif
ifneq ("$(wildcard $(KEYBOARD_PATH_4)/xap.json)","")
XAP_FILES += $(KEYBOARD_PATH_4)/xap.json
endif
ifneq ("$(wildcard $(KEYBOARD_PATH_5)/xap.json)","")
XAP_FILES += $(KEYBOARD_PATH_5)/xap.json
endif
ifneq ("$(wildcard $(KEYMAP_PATH)/xap.json)","")
XAP_FILES += $(KEYMAP_PATH)/xap.json
endif
2022-02-13 22:46:17 +00:00
$(KEYMAP_OUTPUT)/src/xap_generated.inl: $(XAP_FILES)
@$(SILENT) || printf "$(MSG_GENERATING) $@" | $(AWK_CMD)
$(eval CMD=$(QMK_BIN) xap-generate-qmk-inc -o "$(KEYMAP_OUTPUT)/src/xap_generated.inl" -kb $(KEYBOARD) -km $(KEYMAP))
2022-02-13 22:46:17 +00:00
@$(BUILD_CMD)
$(KEYMAP_OUTPUT)/src/xap_generated.h: $(XAP_FILES)
@$(SILENT) || printf "$(MSG_GENERATING) $@" | $(AWK_CMD)
$(eval CMD=$(QMK_BIN) xap-generate-qmk-h -o "$(KEYMAP_OUTPUT)/src/xap_generated.h" -kb $(KEYBOARD) -km $(KEYMAP))
2022-02-13 22:46:17 +00:00
@$(BUILD_CMD)
generated-files: $(KEYMAP_OUTPUT)/src/info_json_gz.h $(KEYMAP_OUTPUT)/src/xap_generated.inl $(KEYMAP_OUTPUT)/src/xap_generated.h
VPATH += $(KEYMAP_OUTPUT)/src