diff options
author | Joakim Tufvegren <jocke@barbanet.com> | 2020-06-26 00:32:21 +0200 |
---|---|---|
committer | Zach White <skullydazed@users.noreply.github.com> | 2020-07-07 07:27:39 -0700 |
commit | 5eb4675fda13783e6d1b18b7fbbe54a90a9fe68e (patch) | |
tree | 5fc53530a5507d9e02f90135bea6c4681cf9efd9 | |
parent | 0fcefdc0136cb3f6c49a678d07d3430455a008d1 (diff) | |
download | firmware-5eb4675fda13783e6d1b18b7fbbe54a90a9fe68e.tar.gz firmware-5eb4675fda13783e6d1b18b7fbbe54a90a9fe68e.tar.bz2 firmware-5eb4675fda13783e6d1b18b7fbbe54a90a9fe68e.zip |
Allow for building layouts from keymap.json files.
-rw-r--r-- | build_layout.mk | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/build_layout.mk b/build_layout.mk index 6e9f97dae..4748ad483 100644 --- a/build_layout.mk +++ b/build_layout.mk @@ -3,8 +3,14 @@ LAYOUTS_REPOS := $(patsubst %/,%,$(sort $(dir $(wildcard $(LAYOUTS_PATH)/*/)))) define SEARCH_LAYOUTS_REPO LAYOUT_KEYMAP_PATH := $$(LAYOUTS_REPO)/$$(LAYOUT)/$$(KEYMAP) + LAYOUT_KEYMAP_JSON := $$(LAYOUT_KEYMAP_PATH)/keymap.json LAYOUT_KEYMAP_C := $$(LAYOUT_KEYMAP_PATH)/keymap.c - ifneq ("$$(wildcard $$(LAYOUT_KEYMAP_C))","") + ifneq ("$$(wildcard $$(LAYOUT_KEYMAP_JSON))","") + -include $$(LAYOUT_KEYMAP_PATH)/rules.mk + KEYMAP_C := $(KEYBOARD_OUTPUT)/src/keymap.c + KEYMAP_JSON := $$(LAYOUT_KEYMAP_JSON) + KEYMAP_PATH := $$(LAYOUT_KEYMAP_PATH) + else ifneq ("$$(wildcard $$(LAYOUT_KEYMAP_C))","") -include $$(LAYOUT_KEYMAP_PATH)/rules.mk KEYMAP_C := $$(LAYOUT_KEYMAP_C) KEYMAP_PATH := $$(LAYOUT_KEYMAP_PATH) @@ -24,4 +30,7 @@ ifneq ($(FORCE_LAYOUT),) endif endif -$(foreach LAYOUT,$(LAYOUTS),$(eval $(call SEARCH_LAYOUTS)))
\ No newline at end of file +$(foreach LAYOUT,$(LAYOUTS),$(eval $(call SEARCH_LAYOUTS))) + +# Use rule from build_json.mk, but update prerequisite in case KEYMAP_JSON was updated +$(KEYBOARD_OUTPUT)/src/keymap.c: $(KEYMAP_JSON) |