Remove commented out MCUs in rules.mk (#5884)
[jackhill/qmk/firmware.git] / build_layout.mk
CommitLineData
d2ff66a9
JH
1LAYOUTS_PATH := layouts
2LAYOUTS_REPOS := $(patsubst %/,%,$(sort $(dir $(wildcard $(LAYOUTS_PATH)/*/))))
3
4define 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)
11 endif
12endef
13
14define SEARCH_LAYOUTS
15 $$(foreach LAYOUTS_REPO,$$(LAYOUTS_REPOS),$$(eval $$(call SEARCH_LAYOUTS_REPO)))
16endef
17
40e67a30 18ifneq ($(FORCE_LAYOUT),)
19 ifneq (,$(findstring $(FORCE_LAYOUT),$(LAYOUTS)))
20 $(info Forcing layout: $(FORCE_LAYOUT))
21 LAYOUTS := $(FORCE_LAYOUT)
22 else
23 $(error Forced layout does not exist)
24 endif
25endif
26
d2ff66a9 27$(foreach LAYOUT,$(LAYOUTS),$(eval $(call SEARCH_LAYOUTS)))