Skip to content

Commit

Permalink
Add target 'build-for-compare' to build_keyboard.mk
Browse files Browse the repository at this point in the history
The `build-for-compare` target provides an easy way to check the md5 checksum of the generated binary.

You can easily see if there is any change in the generated binaries between the two versions, as in the example below.

```
$ git checkout 0.11.0
M	build_keyboard.mk
M	tmk_core/rules.mk
Note: checking out '0.11.0'.
HEAD is now at c66df16 2020 November 28 Breaking Changes Update (qmk#11053)

$ make helix:all:build-for-compare | grep ^MD5
MD5 (.build/helix_rev2_default.hex) = 5c3606562c944bb4d18832e601b45d4a
MD5 (.build/helix_rev2_edvorakjp.hex) = 9e43d13d389d518ba7e99cd7337e28d6
MD5 (.build/helix_rev2_five_rows.hex) = 8bcb61c2fd5d237c2997f2fa007d4934
MD5 (.build/helix_rev2_five_rows_jis.hex) = b97cd818d52f73ca2d4e78c86d90a791
MD5 (.build/helix_rev2_froggy.hex) = c492172364188f4e2918b10bf0f3a0a6
MD5 (.build/helix_rev2_froggy_106.hex) = b0861fd735a8f81881a8c02730641a2b
MD5 (.build/helix_rev2_led_test.hex) = 5c97d982a5da5cfb3dacb28a8934b81d
MD5 (.build/helix_rev2_xulkal.hex) = 01f603dc46bcf9094d7e106831d8f5b1
MD5 (.build/helix_rev2_yshrsmz.hex) = 5a008bca2d0c5790a151c02834c529ba

$ git checkout 0.11.1
M	build_keyboard.mk
M	tmk_core/rules.mk
Previous HEAD position was c66df16 2020 November 28 Breaking Changes Update (qmk#11053)
HEAD is now at cc08e30 nix-shell: add milc dependency (qmk#11086)

$ make helix:all:build-for-compare | grep ^MD5
MD5 (.build/helix_rev2_default.hex) = 5c3606562c944bb4d18832e601b45d4a
MD5 (.build/helix_rev2_edvorakjp.hex) = 9e43d13d389d518ba7e99cd7337e28d6
MD5 (.build/helix_rev2_five_rows.hex) = 8bcb61c2fd5d237c2997f2fa007d4934
MD5 (.build/helix_rev2_five_rows_jis.hex) = b97cd818d52f73ca2d4e78c86d90a791
MD5 (.build/helix_rev2_froggy.hex) = c492172364188f4e2918b10bf0f3a0a6
MD5 (.build/helix_rev2_froggy_106.hex) = b0861fd735a8f81881a8c02730641a2b
MD5 (.build/helix_rev2_led_test.hex) = 5c97d982a5da5cfb3dacb28a8934b81d
MD5 (.build/helix_rev2_xulkal.hex) = d848383adfd7463b138c6da179cf1436
MD5 (.build/helix_rev2_yshrsmz.hex) = 5a008bca2d0c5790a151c02834c529ba
```
  • Loading branch information
mtei committed Dec 29, 2020
1 parent 5584348 commit e53a22f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
7 changes: 7 additions & 0 deletions build_keyboard.mk
Expand Up @@ -369,6 +369,13 @@ endif
build: elf cpfirmware
check-size: build
objs-size: build
build-for-compare: SKIP_GIT = yes
build-for-compare: SKIP_VERSION = yes
build-for-compare: SKIP_DEBUG_INFO = yes
build-for-compare: build check-md5
# $(info SKIP_GIT=$(SKIP_GIT))
# $(info SKIP_VERSION=$(SKIP_VERSION))
# $(info SKIP_DEBUG_INFO=$(SKIP_DEBUG_INFO))

include show_options.mk
include $(TMK_PATH)/rules.mk
4 changes: 4 additions & 0 deletions tmk_core/rules.mk
Expand Up @@ -426,9 +426,13 @@ check-size:
fi \
fi \
fi
check-md5:
md5 $(BUILD_DIR)/$(TARGET).hex
else
check-size:
$(SILENT) || echo "(Firmware size check does not yet support $(MCU) microprocessors; skipping.)"
check-md5:
md5 $(BUILD_DIR)/$(TARGET).bin
endif

# Create build directory
Expand Down

0 comments on commit e53a22f

Please sign in to comment.