]> git.donarmstrong.com Git - qmk_firmware.git/commitdiff
Add a mechanism for force building a particular community layout (#5027)
authorzvecr <git@zvecr.com>
Fri, 15 Feb 2019 04:14:26 +0000 (04:14 +0000)
committerMechMerlin <30334081+mechmerlin@users.noreply.github.com>
Fri, 15 Feb 2019 04:14:26 +0000 (20:14 -0800)
* Add a mechanism for force building a particular community layout

* Add docs for FORCE_LAYOUT argument

* Update output name when FORCE_LAYOUT is enabled

build_keyboard.mk
build_layout.mk
docs/feature_layouts.md

index 71ba805236bca9fb995444c0750fc3fd3e50c11c..ee6a69fc79deae1a5568c1efd1bff3671d44b699 100644 (file)
@@ -135,6 +135,10 @@ ifeq ($(strip $(CONVERT_TO_PROTON_C)), yes)
     OPT_DEFS += -DCONVERT_TO_PROTON_C
 endif
 
+ifneq ($(FORCE_LAYOUT),)
+    TARGET := $(TARGET)_$(FORCE_LAYOUT)
+endif
+
 include quantum/mcu_selection.mk
 
 ifdef MCU_FAMILY
index beb1cb66278a386cd9fc43c18b4a6a016bdbd70c..6e9f97dae2117337ea869f8271be7d6d9f6868ce 100644 (file)
@@ -15,4 +15,13 @@ define SEARCH_LAYOUTS
     $$(foreach LAYOUTS_REPO,$$(LAYOUTS_REPOS),$$(eval $$(call SEARCH_LAYOUTS_REPO)))
 endef
 
+ifneq ($(FORCE_LAYOUT),)
+    ifneq (,$(findstring $(FORCE_LAYOUT),$(LAYOUTS)))
+        $(info Forcing layout: $(FORCE_LAYOUT))
+        LAYOUTS := $(FORCE_LAYOUT)
+    else
+        $(error Forced layout does not exist)
+    endif
+endif
+
 $(foreach LAYOUT,$(LAYOUTS),$(eval $(call SEARCH_LAYOUTS)))
\ No newline at end of file
index 1ee8b5e35c6ea1e4bbcf86341ad8efc7c6d89d40..b34fd442d5c2f92d0ac460355591ecf894dab84e 100644 (file)
@@ -51,6 +51,35 @@ The folder name must be added to the keyboard's `rules.mk`:
 
 but the `LAYOUT_<layout>` variable must be defined in `<folder>.h` as well.
 
+## Building a Keymap
+
+You should be able to build the keyboard keymap with a command in this format:
+
+    make <keyboard>:<layout>
+
+### Conflicting layouts
+When a keyboard supports multiple layout options,
+
+    LAYOUTS = ortho_4x4 ortho_4x12
+
+And a layout exists for both options,
+```
+layouts/
++ community/
+| + ortho_4x4/
+| | + <layout>/
+| | | + ...
+| + ortho_4x12/
+| | + <layout>/
+| | | + ...
+| + ...
+```
+
+The FORCE_LAYOUT argument can be used to specify which layout to build
+
+    make <keyboard>:<layout> FORCE_LAYOUT=ortho_4x4
+    make <keyboard>:<layout> FORCE_LAYOUT=ortho_4x12
+
 ## Tips for Making Layouts Keyboard-Agnostic
 
 ### Includes