diff options
| author | Takeshi ISHII <2170248+mtei@users.noreply.github.com> | 2021-01-06 07:27:10 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-01-06 07:27:10 +0900 |
| commit | 3edfb93d5de5ce1a783cecb2d97b0ca0ff1e0aff (patch) | |
| tree | cb7052ddda07eec543ac43dee55f7033605021e3 /tmk_core | |
| parent | 34513b466599066e0f3d33cc66e72ac4f039b717 (diff) | |
| download | qmk_firmware-3edfb93d5de5ce1a783cecb2d97b0ca0ff1e0aff.tar.gz qmk_firmware-3edfb93d5de5ce1a783cecb2d97b0ca0ff1e0aff.zip | |
Add build debug option to tmk_core/rules.mk (#11324)
* Add DUMP_C_MACROS to tmk_core/rules.mk
* update DUMP_C_MACROS
* add VERBOSE_LD_CMD, VERBOSE_AS_CMD
* add VERBOSE_C_CMD, VERBOSE_C_INCLUDE
* update DUMP_C_MACROS, VERBOSE_C_INCLUDE, VERBOSE_C_CMD
Diffstat (limited to 'tmk_core')
| -rw-r--r-- | tmk_core/rules.mk | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/tmk_core/rules.mk b/tmk_core/rules.mk index a77e55dd1..f5f758943 100644 --- a/tmk_core/rules.mk +++ b/tmk_core/rules.mk | |||
| @@ -150,6 +150,9 @@ ifeq ($(strip $(DEBUG_ENABLE)),yes) | |||
| 150 | else | 150 | else |
| 151 | ASFLAGS += -Wa,-adhlns=$(@:%.o=%.lst),--listing-cont-lines=100 | 151 | ASFLAGS += -Wa,-adhlns=$(@:%.o=%.lst),--listing-cont-lines=100 |
| 152 | endif | 152 | endif |
| 153 | ifeq ($(VERBOSE_AS_CMD),yes) | ||
| 154 | ASFLAGS += -v | ||
| 155 | endif | ||
| 153 | 156 | ||
| 154 | #---------------- Library Options ---------------- | 157 | #---------------- Library Options ---------------- |
| 155 | # Minimalistic printf version | 158 | # Minimalistic printf version |
| @@ -192,6 +195,9 @@ CREATE_MAP ?= yes | |||
| 192 | ifeq ($(CREATE_MAP),yes) | 195 | ifeq ($(CREATE_MAP),yes) |
| 193 | LDFLAGS += -Wl,-Map=$(BUILD_DIR)/$(TARGET).map,--cref | 196 | LDFLAGS += -Wl,-Map=$(BUILD_DIR)/$(TARGET).map,--cref |
| 194 | endif | 197 | endif |
| 198 | ifeq ($(VERBOSE_LD_CMD),yes) | ||
| 199 | LDFLAGS += -v | ||
| 200 | endif | ||
| 195 | #LDFLAGS += -Wl,--relax | 201 | #LDFLAGS += -Wl,--relax |
| 196 | LDFLAGS += $(EXTMEMOPTS) | 202 | LDFLAGS += $(EXTMEMOPTS) |
| 197 | LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS)) | 203 | LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS)) |
| @@ -327,8 +333,19 @@ $1_ASFLAGS = $$(ALL_ASFLAGS) $$($1_DEFS) $$($1_INCFLAGS) $$($1_CONFIG_FLAGS) | |||
| 327 | $1/%.o : %.c $1/%.d $1/cflags.txt $1/compiler.txt | $(BEGIN) | 333 | $1/%.o : %.c $1/%.d $1/cflags.txt $1/compiler.txt | $(BEGIN) |
| 328 | @mkdir -p $$(@D) | 334 | @mkdir -p $$(@D) |
| 329 | @$$(SILENT) || printf "$$(MSG_COMPILING) $$<" | $$(AWK_CMD) | 335 | @$$(SILENT) || printf "$$(MSG_COMPILING) $$<" | $$(AWK_CMD) |
| 330 | $$(eval CMD := $$(CC) -c $$($1_CFLAGS) $$(INIT_HOOK_CFLAGS) $$(GENDEPFLAGS) $$< -o $$@ && $$(MOVE_DEP)) | 336 | $$(eval CC_EXEC := $$(CC)) |
| 337 | ifneq ($$(VERBOSE_C_CMD),) | ||
| 338 | $$(if $$(filter $$(notdir $$(VERBOSE_C_CMD)),$$(notdir $$<)),$$(eval CC_EXEC += -v)) | ||
| 339 | endif | ||
| 340 | ifneq ($$(VERBOSE_C_INCLUDE),) | ||
| 341 | $$(if $$(filter $$(notdir $$(VERBOSE_C_INCLUDE)),$$(notdir $$<)),$$(eval CC_EXEC += -H)) | ||
| 342 | endif | ||
| 343 | $$(eval CMD := $$(CC_EXEC) -c $$($1_CFLAGS) $$(INIT_HOOK_CFLAGS) $$(GENDEPFLAGS) $$< -o $$@ && $$(MOVE_DEP)) | ||
| 331 | @$$(BUILD_CMD) | 344 | @$$(BUILD_CMD) |
| 345 | ifneq ($$(DUMP_C_MACROS),) | ||
| 346 | $$(eval CMD := $$(CC) -E -dM $$($1_CFLAGS) $$(INIT_HOOK_CFLAGS) $$(GENDEPFLAGS) $$<) | ||
| 347 | @$$(if $$(filter $$(notdir $$(DUMP_C_MACROS)),$$(notdir $$<)),$$(BUILD_CMD)) | ||
| 348 | endif | ||
| 332 | 349 | ||
| 333 | # Compile: create object files from C++ source files. | 350 | # Compile: create object files from C++ source files. |
| 334 | $1/%.o : %.cpp $1/%.d $1/cxxflags.txt $1/compiler.txt | $(BEGIN) | 351 | $1/%.o : %.cpp $1/%.d $1/cxxflags.txt $1/compiler.txt | $(BEGIN) |
