Files
retroSoC/app/asm/Makefile
T
maksyuki 7418acfe42 refactor: refactor Makefiles and related scripts for improved readability and consistency
- Adjusted variable alignment in Makefiles for better readability.
- Ensured consistent formatting across various Makefiles and scripts.
- Added a new .bake.toml file to define project formatting policies for mbake.
- Updated paths and variable definitions in multiple configuration files to enhance clarity.
- Removed unnecessary comments and whitespace for cleaner code.
2026-07-21 11:21:39 +08:00

24 lines
669 B
Makefile

.PHONY: all
GCC = riscv32-unknown-elf-
AS = $(GCC)as
LD = $(GCC)ld
OBJDUMP = $(GCC)objdump
OBJCOPY = $(GCC)objcopy
AS_FLAGS = -fno-pic -march=rv32im -mabi=ilp32
LDFLAGS = -T flash.ld -melf32lriscv
APP ?= hello
OUT_DIR ?= .
APP_ALL = $(OUT_DIR)/$(APP)-asm
all: $(APP).s
@mkdir -p $(OUT_DIR)
$(AS) $(AS_FLAGS) $(APP).s -o $(APP_ALL).o
$(LD) $(LDFLAGS) $(APP_ALL).o -o $(APP_ALL).elf
$(OBJDUMP) -d $(APP_ALL).elf > $(APP_ALL).txt
$(OBJCOPY) -S -O binary $(APP_ALL).elf $(APP_ALL).bin
$(OBJCOPY) -S -I binary -O verilog $(APP_ALL).bin $(APP_ALL).flash
clean:
rm -rf $(APP_ALL).o $(APP_ALL).elf $(APP_ALL).txt $(APP_ALL).bin $(APP_ALL).flash