summaryrefslogtreecommitdiffstats
path: root/build_layout.mk
diff options
context:
space:
mode:
Diffstat (limited to 'build_layout.mk')
-rw-r--r--build_layout.mk18
1 files changed, 18 insertions, 0 deletions
diff --git a/build_layout.mk b/build_layout.mk
new file mode 100644
index 000000000..beb1cb662
--- /dev/null
+++ b/build_layout.mk
@@ -0,0 +1,18 @@
+LAYOUTS_PATH := layouts
+LAYOUTS_REPOS := $(patsubst %/,%,$(sort $(dir $(wildcard $(LAYOUTS_PATH)/*/))))
+
+define SEARCH_LAYOUTS_REPO
+ LAYOUT_KEYMAP_PATH := $$(LAYOUTS_REPO)/$$(LAYOUT)/$$(KEYMAP)
+ LAYOUT_KEYMAP_C := $$(LAYOUT_KEYMAP_PATH)/keymap.c
+ ifneq ("$$(wildcard $$(LAYOUT_KEYMAP_C))","")
+ -include $$(LAYOUT_KEYMAP_PATH)/rules.mk
+ KEYMAP_C := $$(LAYOUT_KEYMAP_C)
+ KEYMAP_PATH := $$(LAYOUT_KEYMAP_PATH)
+ endif
+endef
+
+define SEARCH_LAYOUTS
+ $$(foreach LAYOUTS_REPO,$$(LAYOUTS_REPOS),$$(eval $$(call SEARCH_LAYOUTS_REPO)))
+endef
+
+$(foreach LAYOUT,$(LAYOUTS),$(eval $(call SEARCH_LAYOUTS))) \ No newline at end of file