Peter's keyboard firmware (QMK) https://qmk.fm/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

build_layout.mk 861B

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