summaryrefslogtreecommitdiff
path: root/tmk_core/rules.mk
diff options
context:
space:
mode:
authorQMK Bot <hello@qmk.fm>2020-12-31 06:21:45 +0000
committerQMK Bot <hello@qmk.fm>2020-12-31 06:21:45 +0000
commit633d2cb648467ccc410f479eda0828e88b7d0aad (patch)
tree21fba330d31dafea51b6a219ea6aafa8ae676f1e /tmk_core/rules.mk
parent47b9b110097a864d6ab76516b2213afd59948527 (diff)
parent6169b47e82b475c629f9a957f8c36ea39e47ea50 (diff)
Merge remote-tracking branch 'origin/master' into develop
Diffstat (limited to 'tmk_core/rules.mk')
-rw-r--r--tmk_core/rules.mk19
1 files changed, 15 insertions, 4 deletions
diff --git a/tmk_core/rules.mk b/tmk_core/rules.mk
index a7053d185c..a77e55dd13 100644
--- a/tmk_core/rules.mk
+++ b/tmk_core/rules.mk
@@ -79,7 +79,12 @@ CSTANDARD = -std=gnu99
# -Wall...: warning level
# -Wa,...: tell GCC to pass this to the assembler.
# -adhlns...: create assembler listing
-ifndef SKIP_DEBUG_INFO
+DEBUG_ENABLE ?= yes
+ifeq ($(strip $(SKIP_DEBUG_INFO)),yes)
+ DEBUG_ENABLE=no
+endif
+
+ifeq ($(strip $(DEBUG_ENABLE)),yes)
CFLAGS += -g$(DEBUG)
endif
CFLAGS += $(CDEFS)
@@ -110,7 +115,7 @@ CFLAGS += $(CSTANDARD)
# -Wall...: warning level
# -Wa,...: tell GCC to pass this to the assembler.
# -adhlns...: create assembler listing
-ifndef SKIP_DEBUG_INFO
+ifeq ($(strip $(DEBUG_ENABLE)),yes)
CXXFLAGS += -g$(DEBUG)
endif
CXXFLAGS += $(CXXDEFS)
@@ -140,7 +145,7 @@ CXXFLAGS += -Wa,-adhlns=$(@:%.o=%.lst)
# -listing-cont-lines: Sets the maximum number of continuation lines of hex
# dump that will be displayed for a given single line of source input.
ASFLAGS += $(ADEFS)
-ifndef SKIP_DEBUG_INFO
+ifeq ($(strip $(DEBUG_ENABLE)),yes)
ASFLAGS += -Wa,-adhlns=$(@:%.o=%.lst),-gstabs,--listing-cont-lines=100
else
ASFLAGS += -Wa,-adhlns=$(@:%.o=%.lst),--listing-cont-lines=100
@@ -202,7 +207,10 @@ REMOVEDIR = rmdir
COPY = cp
WINSHELL = cmd
SECHO = $(SILENT) || echo
-
+MD5SUM ?= md5sum
+ifneq ($(filter Darwin FreeBSD,$(shell uname -s)),)
+ MD5SUM = md5
+endif
# Compiler flags to generate dependency files.
#GENDEPFLAGS = -MMD -MP -MF .dep/$(@F).d
@@ -431,6 +439,9 @@ check-size:
$(SILENT) || echo "(Firmware size check does not yet support $(MCU) microprocessors; skipping.)"
endif
+check-md5:
+ $(MD5SUM) $(BUILD_DIR)/$(TARGET).$(FIRMWARE_FORMAT)
+
# Create build directory
$(shell mkdir -p $(BUILD_DIR) 2>/dev/null)