aboutsummaryrefslogtreecommitdiff
path: root/tmk_core
diff options
context:
space:
mode:
authorTakeshi ISHII <2170248+mtei@users.noreply.github.com>2020-12-31 15:20:56 +0900
committerGitHub <noreply@github.com>2020-12-31 15:20:56 +0900
commit6169b47e82b475c629f9a957f8c36ea39e47ea50 (patch)
tree6ee86438dcadb94c3a06fa291469ffcb5a533540 /tmk_core
parent10096fc42e52e5b22acd6ceef941816401468998 (diff)
downloadqmk_firmware-6169b47e82b475c629f9a957f8c36ea39e47ea50.tar.gz
qmk_firmware-6169b47e82b475c629f9a957f8c36ea39e47ea50.zip
Add target 'check-md5' to `build_keyboard.mk` (#11338)
* Add target 'build-for-compare' to `build_keyboard.mk` 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 c66df1664 2020 November 28 Breaking Changes Update (#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 c66df1664 2020 November 28 Breaking Changes Update (#11053) HEAD is now at cc08e3082 nix-shell: add milc dependency (#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 ``` * make builds reproducable by default * update build_keyboard.mk: remove 'build-for-compare' target * GNU make (3.81) on macOS 10.14(Mojave) does not have the 'undefine' directive. * Adopted fauxpark's suggestion. * Update tmk_core/rules.mk Co-authored-by: Ryan <fauxpark@gmail.com> * update tmk_core/rules.mk * fix tmk_core/rules.mk Co-authored-by: Zach White <skullydazed@gmail.com> Co-authored-by: Ryan <fauxpark@gmail.com>
Diffstat (limited to 'tmk_core')
-rw-r--r--tmk_core/common/command.c4
-rw-r--r--tmk_core/rules.mk19
2 files changed, 16 insertions, 7 deletions
diff --git a/tmk_core/common/command.c b/tmk_core/common/command.c
index feeb2202e..59aa4e4d3 100644
--- a/tmk_core/common/command.c
+++ b/tmk_core/common/command.c
@@ -144,10 +144,8 @@ static void print_version(void) {
144 print("VID: " STR(VENDOR_ID) "(" STR(MANUFACTURER) ") " 144 print("VID: " STR(VENDOR_ID) "(" STR(MANUFACTURER) ") "
145 "PID: " STR(PRODUCT_ID) "(" STR(PRODUCT) ") " 145 "PID: " STR(PRODUCT_ID) "(" STR(PRODUCT) ") "
146 "VER: " STR(DEVICE_VER) "\n"); 146 "VER: " STR(DEVICE_VER) "\n");
147#ifdef SKIP_VERSION
148 print("BUILD: (" __DATE__ ")\n"); 147 print("BUILD: (" __DATE__ ")\n");
149#else 148#ifndef SKIP_VERSION
150 print("BUILD: " STR(QMK_VERSION) " (" __TIME__ " " __DATE__ ")\n");
151# ifdef PROTOCOL_CHIBIOS 149# ifdef PROTOCOL_CHIBIOS
152 print("CHIBIOS: " STR(CHIBIOS_VERSION) ", CONTRIB: " STR(CHIBIOS_CONTRIB_VERSION) "\n"); 150 print("CHIBIOS: " STR(CHIBIOS_VERSION) ", CONTRIB: " STR(CHIBIOS_CONTRIB_VERSION) "\n");
153# endif 151# endif
diff --git a/tmk_core/rules.mk b/tmk_core/rules.mk
index a7053d185..a77e55dd1 100644
--- a/tmk_core/rules.mk
+++ b/tmk_core/rules.mk
@@ -79,7 +79,12 @@ CSTANDARD = -std=gnu99
79# -Wall...: warning level 79# -Wall...: warning level
80# -Wa,...: tell GCC to pass this to the assembler. 80# -Wa,...: tell GCC to pass this to the assembler.
81# -adhlns...: create assembler listing 81# -adhlns...: create assembler listing
82ifndef SKIP_DEBUG_INFO 82DEBUG_ENABLE ?= yes
83ifeq ($(strip $(SKIP_DEBUG_INFO)),yes)
84 DEBUG_ENABLE=no
85endif
86
87ifeq ($(strip $(DEBUG_ENABLE)),yes)
83 CFLAGS += -g$(DEBUG) 88 CFLAGS += -g$(DEBUG)
84endif 89endif
85CFLAGS += $(CDEFS) 90CFLAGS += $(CDEFS)
@@ -110,7 +115,7 @@ CFLAGS += $(CSTANDARD)
110# -Wall...: warning level 115# -Wall...: warning level
111# -Wa,...: tell GCC to pass this to the assembler. 116# -Wa,...: tell GCC to pass this to the assembler.
112# -adhlns...: create assembler listing 117# -adhlns...: create assembler listing
113ifndef SKIP_DEBUG_INFO 118ifeq ($(strip $(DEBUG_ENABLE)),yes)
114 CXXFLAGS += -g$(DEBUG) 119 CXXFLAGS += -g$(DEBUG)
115endif 120endif
116CXXFLAGS += $(CXXDEFS) 121CXXFLAGS += $(CXXDEFS)
@@ -140,7 +145,7 @@ CXXFLAGS += -Wa,-adhlns=$(@:%.o=%.lst)
140# -listing-cont-lines: Sets the maximum number of continuation lines of hex 145# -listing-cont-lines: Sets the maximum number of continuation lines of hex
141# dump that will be displayed for a given single line of source input. 146# dump that will be displayed for a given single line of source input.
142ASFLAGS += $(ADEFS) 147ASFLAGS += $(ADEFS)
143ifndef SKIP_DEBUG_INFO 148ifeq ($(strip $(DEBUG_ENABLE)),yes)
144 ASFLAGS += -Wa,-adhlns=$(@:%.o=%.lst),-gstabs,--listing-cont-lines=100 149 ASFLAGS += -Wa,-adhlns=$(@:%.o=%.lst),-gstabs,--listing-cont-lines=100
145else 150else
146 ASFLAGS += -Wa,-adhlns=$(@:%.o=%.lst),--listing-cont-lines=100 151 ASFLAGS += -Wa,-adhlns=$(@:%.o=%.lst),--listing-cont-lines=100
@@ -202,7 +207,10 @@ REMOVEDIR = rmdir
202COPY = cp 207COPY = cp
203WINSHELL = cmd 208WINSHELL = cmd
204SECHO = $(SILENT) || echo 209SECHO = $(SILENT) || echo
205 210MD5SUM ?= md5sum
211ifneq ($(filter Darwin FreeBSD,$(shell uname -s)),)
212 MD5SUM = md5
213endif
206 214
207# Compiler flags to generate dependency files. 215# Compiler flags to generate dependency files.
208#GENDEPFLAGS = -MMD -MP -MF .dep/$(@F).d 216#GENDEPFLAGS = -MMD -MP -MF .dep/$(@F).d
@@ -431,6 +439,9 @@ check-size:
431 $(SILENT) || echo "(Firmware size check does not yet support $(MCU) microprocessors; skipping.)" 439 $(SILENT) || echo "(Firmware size check does not yet support $(MCU) microprocessors; skipping.)"
432endif 440endif
433 441
442check-md5:
443 $(MD5SUM) $(BUILD_DIR)/$(TARGET).$(FIRMWARE_FORMAT)
444
434# Create build directory 445# Create build directory
435$(shell mkdir -p $(BUILD_DIR) 2>/dev/null) 446$(shell mkdir -p $(BUILD_DIR) 2>/dev/null)
436 447