Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the linker make the map file instead of it being a separate step… #471

Merged
merged 1 commit into from
Dec 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions ch32v003fun/ch32v003fun.mk
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Default prefix for Windows
ifeq ($(OS),Windows_NT)
PREFIX?=riscv64-unknown-elf
PREFIX?=riscv64-unknown-elf
# Check if riscv64-linux-gnu-gcc exists
else ifneq ($(shell which riscv64-linux-gnu-gcc),)
PREFIX?=riscv64-linux-gnu
PREFIX?=riscv64-linux-gnu
# Check if riscv64-unknown-elf-gcc exists
else ifneq ($(shell which riscv64-unknown-elf-gcc),)
PREFIX?=riscv64-unknown-elf
PREFIX?=riscv64-unknown-elf
# Default prefix
else
PREFIX?=riscv64-elf
PREFIX?=riscv64-elf
endif

# Fedora places newlib in a different location
Expand All @@ -34,7 +34,7 @@ ifeq ($(DEBUG),1)
endif

CFLAGS?=-g -Os -flto -ffunction-sections -fdata-sections -fmessage-length=0 -msmall-data-limit=8
LDFLAGS+=-Wl,--print-memory-usage
LDFLAGS+=-Wl,--print-memory-usage -Wl,-Map=$(TARGET).map

ifeq ($(TARGET_MCU),CH32V003)
CFLAGS_ARCH+=-march=rv32ec -mabi=ilp32e -DCH32V003=1
Expand Down Expand Up @@ -189,7 +189,6 @@ FILES_TO_COMPILE:=$(SYSTEM_C) $(TARGET).$(TARGET_EXT) $(ADDITIONAL_C_FILES)

$(TARGET).bin : $(TARGET).elf
$(PREFIX)-objdump -S $^ > $(TARGET).lst
$(PREFIX)-objdump -t $^ > $(TARGET).map
$(PREFIX)-objcopy -O binary $< $(TARGET).bin
$(PREFIX)-objcopy -O ihex $< $(TARGET).hex

Expand Down
Loading