summaryrefslogtreecommitdiff
path: root/lib/python/qmk/cli/generate/rules_mk.py
diff options
context:
space:
mode:
authorZach White <skullydazed@gmail.com>2021-01-09 13:34:14 -0800
committerGitHub <noreply@github.com>2021-01-09 13:34:14 -0800
commit962bc8d9dd413690dbeadeaac971a5389697210f (patch)
tree02e7c5ebe87f466103901d72740fbf25c9d19a30 /lib/python/qmk/cli/generate/rules_mk.py
parentc550047ba68bd633d35b10d545ff240cf1fc9786 (diff)
Use the schema to eliminate custom code (#11108)
* use the schema to eliminate custom code * Update docs/reference_info_json.md Co-authored-by: Ryan <fauxpark@gmail.com> * make flake8 happy * bugfix * do not overwrite make vars from json Co-authored-by: Ryan <fauxpark@gmail.com>
Diffstat (limited to 'lib/python/qmk/cli/generate/rules_mk.py')
-rwxr-xr-xlib/python/qmk/cli/generate/rules_mk.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/python/qmk/cli/generate/rules_mk.py b/lib/python/qmk/cli/generate/rules_mk.py
index 2a7e918569..0fdccb4048 100755
--- a/lib/python/qmk/cli/generate/rules_mk.py
+++ b/lib/python/qmk/cli/generate/rules_mk.py
@@ -37,26 +37,26 @@ def generate_rules_mk(cli):
# Bring in settings
for info_key, rule_key in info_to_rules.items():
- rules_mk_lines.append(f'{rule_key} := {kb_info_json[info_key]}')
+ rules_mk_lines.append(f'{rule_key} ?= {kb_info_json[info_key]}')
# Find features that should be enabled
if 'features' in kb_info_json:
for feature, enabled in kb_info_json['features'].items():
if feature == 'bootmagic_lite' and enabled:
- rules_mk_lines.append('BOOTMAGIC_ENABLE := lite')
+ rules_mk_lines.append('BOOTMAGIC_ENABLE ?= lite')
else:
feature = feature.upper()
enabled = 'yes' if enabled else 'no'
- rules_mk_lines.append(f'{feature}_ENABLE := {enabled}')
+ rules_mk_lines.append(f'{feature}_ENABLE ?= {enabled}')
# Set the LED driver
if 'led_matrix' in kb_info_json and 'driver' in kb_info_json['led_matrix']:
driver = kb_info_json['led_matrix']['driver']
- rules_mk_lines.append(f'LED_MATRIX_DRIVER = {driver}')
+ rules_mk_lines.append(f'LED_MATRIX_DRIVER ?= {driver}')
# Add community layouts
if 'community_layouts' in kb_info_json:
- rules_mk_lines.append(f'LAYOUTS = {" ".join(kb_info_json["community_layouts"])}')
+ rules_mk_lines.append(f'LAYOUTS ?= {" ".join(kb_info_json["community_layouts"])}')
# Show the results
rules_mk = '\n'.join(rules_mk_lines) + '\n'