aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzvecr <git@zvecr.com>2019-02-15 04:14:26 +0000
committerMechMerlin <30334081+mechmerlin@users.noreply.github.com>2019-02-14 20:14:26 -0800
commit40e67a3074293bc8e96574e7d603a943d3ca8d38 (patch)
tree1e152c2282a4a0737e1a5952ec4ac6d96a333b63
parent85022f8bb5129f7118b55556c1ce85bc7d721356 (diff)
downloadqmk_firmware-40e67a3074293bc8e96574e7d603a943d3ca8d38.tar.gz
qmk_firmware-40e67a3074293bc8e96574e7d603a943d3ca8d38.zip
Add a mechanism for force building a particular community layout (#5027)
* Add a mechanism for force building a particular community layout * Add docs for FORCE_LAYOUT argument * Update output name when FORCE_LAYOUT is enabled
-rw-r--r--build_keyboard.mk4
-rw-r--r--build_layout.mk9
-rw-r--r--docs/feature_layouts.md29
3 files changed, 42 insertions, 0 deletions
diff --git a/build_keyboard.mk b/build_keyboard.mk
index 71ba80523..ee6a69fc7 100644
--- a/build_keyboard.mk
+++ b/build_keyboard.mk
@@ -135,6 +135,10 @@ ifeq ($(strip $(CONVERT_TO_PROTON_C)), yes)
135 OPT_DEFS += -DCONVERT_TO_PROTON_C 135 OPT_DEFS += -DCONVERT_TO_PROTON_C
136endif 136endif
137 137
138ifneq ($(FORCE_LAYOUT),)
139 TARGET := $(TARGET)_$(FORCE_LAYOUT)
140endif
141
138include quantum/mcu_selection.mk 142include quantum/mcu_selection.mk
139 143
140ifdef MCU_FAMILY 144ifdef MCU_FAMILY
diff --git a/build_layout.mk b/build_layout.mk
index beb1cb662..6e9f97dae 100644
--- a/build_layout.mk
+++ b/build_layout.mk
@@ -15,4 +15,13 @@ define SEARCH_LAYOUTS
15 $$(foreach LAYOUTS_REPO,$$(LAYOUTS_REPOS),$$(eval $$(call SEARCH_LAYOUTS_REPO))) 15 $$(foreach LAYOUTS_REPO,$$(LAYOUTS_REPOS),$$(eval $$(call SEARCH_LAYOUTS_REPO)))
16endef 16endef
17 17
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
18$(foreach LAYOUT,$(LAYOUTS),$(eval $(call SEARCH_LAYOUTS))) \ No newline at end of file 27$(foreach LAYOUT,$(LAYOUTS),$(eval $(call SEARCH_LAYOUTS))) \ No newline at end of file
diff --git a/docs/feature_layouts.md b/docs/feature_layouts.md
index 1ee8b5e35..b34fd442d 100644
--- a/docs/feature_layouts.md
+++ b/docs/feature_layouts.md
@@ -51,6 +51,35 @@ The folder name must be added to the keyboard's `rules.mk`:
51 51
52but the `LAYOUT_<layout>` variable must be defined in `<folder>.h` as well. 52but the `LAYOUT_<layout>` variable must be defined in `<folder>.h` as well.
53 53
54## Building a Keymap
55
56You should be able to build the keyboard keymap with a command in this format:
57
58 make <keyboard>:<layout>
59
60### Conflicting layouts
61When a keyboard supports multiple layout options,
62
63 LAYOUTS = ortho_4x4 ortho_4x12
64
65And a layout exists for both options,
66```
67layouts/
68+ community/
69| + ortho_4x4/
70| | + <layout>/
71| | | + ...
72| + ortho_4x12/
73| | + <layout>/
74| | | + ...
75| + ...
76```
77
78The FORCE_LAYOUT argument can be used to specify which layout to build
79
80 make <keyboard>:<layout> FORCE_LAYOUT=ortho_4x4
81 make <keyboard>:<layout> FORCE_LAYOUT=ortho_4x12
82
54## Tips for Making Layouts Keyboard-Agnostic 83## Tips for Making Layouts Keyboard-Agnostic
55 84
56### Includes 85### Includes