forked from qmk/qmk_firmware
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove build option firmware size impacts (qmk#6947)
* Update rules.mk template to remove build option size impacts * Add rules.mk cleaning script * Update all rules.mk files to remove build option firmware size impact messages * Remove references to feature filesize in documentation * Revert "Update all rules.mk files to remove build option firmware size impact messages" This reverts commit 7cfe709. * Fix regex in cleanup script and exclude keymaps/ directories * Update quantum/template/avr/rules.mk Fixed missing tabs/spaces. Co-Authored-By: fauxpark <[email protected]>
- Loading branch information
Showing
6 changed files
with
58 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/bin/bash | ||
|
||
# This script finds all rules.mk files in keyboards/ subdirectories, | ||
# and deletes the build option filesize impacts from them. | ||
|
||
# Print an error message with the word "ERROR" in red. | ||
echo_error() { | ||
echo -e "[\033[0;91mERROR\033[m]: $1" | ||
} | ||
|
||
# If we've been started from util/, we want to be in qmk_firmware/ | ||
[[ "$PWD" == *util ]] && cd .. | ||
|
||
# The root qmk_firmware/ directory should have a subdirectory called quantum/ | ||
if [ ! -d "quantum" ]; then | ||
echo_error "Could not detect the QMK firmware directory!" | ||
echo_error "Are you sure you're in the right place?" | ||
exit 1 | ||
fi | ||
|
||
# Set the inplace editing parameter for sed. | ||
# macOS/BSD sed expects a file extension immediately following -i. | ||
set_sed_i() { | ||
sed_i=(-i) | ||
|
||
case $(uname -a) in | ||
*Darwin*) sed_i=(-i "") | ||
esac | ||
} | ||
set_sed_i | ||
|
||
# Exclude keyamps/ directories | ||
files=$(find keyboards -type f -name 'rules.mk' -not \( -path '*/keymaps*' -prune \)) | ||
|
||
# Edit rules.mk files | ||
for file in $files; do | ||
sed "${sed_i[@]}" -e "s/(+[0-9].*)$//g" "$file" | ||
done | ||
|
||
echo "Cleaned up rules.mk files." |