Skip to content

Commit

Permalink
sw: Remove DWARF targets and dumps when DEBUG=OFF
Browse files Browse the repository at this point in the history
  • Loading branch information
colluca committed Sep 4, 2024
1 parent a62426c commit 198f5aa
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
10 changes: 5 additions & 5 deletions target/snitch_cluster/sw/apps/common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,11 @@ $(APP)_RISCV_LDFLAGS += $(addprefix -l,$($(APP)_LIBNAMES))
ELF := $(abspath $(addprefix $($(APP)_BUILD_DIR)/,$(addsuffix .elf,$(APP))))
DEP := $(abspath $(addprefix $($(APP)_BUILD_DIR)/,$(addsuffix .d,$(APP))))
DUMP := $(abspath $(addprefix $($(APP)_BUILD_DIR)/,$(addsuffix .dump,$(APP))))
DWARF := $(abspath $(addprefix $($(APP)_BUILD_DIR)/,$(addsuffix .dwarf,$(APP))))
ALL_OUTPUTS := $(ELF) $(DEP) $(DUMP) $(DWARF)
ALL_OUTPUTS := $(ELF)

ifeq ($(DEBUG), ON)
ALL_OUTPUTS += $(DUMP)
endif

#########
# Rules #
Expand Down Expand Up @@ -77,9 +80,6 @@ $(ELF): $(SRCS) $(DEP) $($(APP)_LIBS) | $($(APP)_BUILD_DIR)
$(DUMP): $(ELF) | $($(APP)_BUILD_DIR)
$(RISCV_OBJDUMP) $(RISCV_OBJDUMP_FLAGS) $< > $@

$(DWARF): $(ELF) | $($(APP)_BUILD_DIR)
$(RISCV_DWARFDUMP) $< > $@

ifneq ($(filter-out clean%,$(MAKECMDGOALS)),)
-include $(DEP)
endif
7 changes: 6 additions & 1 deletion target/snitch_cluster/sw/runtime/runtime.mk
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,12 @@ SNRT_OBJS = $(addprefix $(SNRT_BUILDDIR)/,$(addsuffix .o,$(basename $(notdir
SNRT_DEPS = $(addprefix $(SNRT_BUILDDIR)/,$(addsuffix .d,$(basename $(notdir $(SNRT_SRCS)))))
SNRT_LIB = $(SNRT_BUILDDIR)/libsnRuntime.a
SNRT_DUMP = $(SNRT_BUILDDIR)/libsnRuntime.dump
SNRT_OUTPUTS = $(SNRT_LIB) $(SNRT_DUMP)
SNRT_OUTPUTS = $(SNRT_LIB)

ifeq ($(DEBUG), ON)
SNRT_OUTPUTS += $(SNRT_DUMP)
endif


#########
# Rules #
Expand Down
3 changes: 1 addition & 2 deletions target/snitch_cluster/sw/tests/tests.mk
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,10 @@ TEST_NAMES = $(basename $(notdir $(wildcard $(TESTS_SRCDIR)/*.c)))
TEST_ELFS = $(abspath $(addprefix $(TESTS_BUILDDIR)/,$(addsuffix .elf,$(TEST_NAMES))))
TEST_DEPS = $(abspath $(addprefix $(TESTS_BUILDDIR)/,$(addsuffix .d,$(TEST_NAMES))))
TEST_DUMPS = $(abspath $(addprefix $(TESTS_BUILDDIR)/,$(addsuffix .dump,$(TEST_NAMES))))
TEST_DWARFS = $(abspath $(addprefix $(TESTS_BUILDDIR)/,$(addsuffix .dwarf,$(TEST_NAMES))))
TEST_OUTPUTS = $(TEST_ELFS)

ifeq ($(DEBUG), ON)
TEST_OUTPUTS += $(DUMPS) $(DWARFS)
TEST_OUTPUTS += $(DUMPS)
endif

#########
Expand Down

0 comments on commit 198f5aa

Please sign in to comment.