1 LAYOUTS_PATH := layouts
2 LAYOUTS_REPOS := $(patsubst %/,%,$(sort $(dir $(wildcard $(LAYOUTS_PATH)/*/))))
4 define SEARCH_LAYOUTS_REPO
5 LAYOUT_KEYMAP_PATH := $$(LAYOUTS_REPO)/$$(LAYOUT)/$$(KEYMAP)
6 LAYOUT_KEYMAP_C := $$(LAYOUT_KEYMAP_PATH)/keymap.c
7 ifneq ("$$(wildcard $$(LAYOUT_KEYMAP_C))","")
8 -include $$(LAYOUT_KEYMAP_PATH)/rules.mk
9 KEYMAP_C := $$(LAYOUT_KEYMAP_C)
10 KEYMAP_PATH := $$(LAYOUT_KEYMAP_PATH)
15 $$(foreach LAYOUTS_REPO,$$(LAYOUTS_REPOS),$$(eval $$(call SEARCH_LAYOUTS_REPO)))
18 ifneq ($(FORCE_LAYOUT),)
19 ifneq (,$(findstring $(FORCE_LAYOUT),$(LAYOUTS)))
20 $(info Forcing layout: $(FORCE_LAYOUT))
21 LAYOUTS := $(FORCE_LAYOUT)
23 $(error Forced layout does not exist)
27 $(foreach LAYOUT,$(LAYOUTS),$(eval $(call SEARCH_LAYOUTS)))