Add some debug assembly

This commit is contained in:
JackCarterSmith 2025-05-12 20:10:16 +02:00
parent b6aae3384e
commit 8985f3d3a3
Signed by: JackCarterSmith
GPG Key ID: 832E52F4E23F8F24

View File

@ -152,6 +152,7 @@ endif
# Generate dependency information
CFLAGS_ASM := $(CFLAGS)
CFLAGS += -MMD -MP -MF"$(@:%.o=%.d)"
@ -175,6 +176,7 @@ all: $(BUILD_DIR)/$(TARGET).elf $(BUILD_DIR)/$(TARGET).hex $(BUILD_DIR)/$(TARGET
#######################################
# list of objects
OBJECTS = $(addprefix $(BUILD_DIR)/,$(notdir $(C_SOURCES:.c=.o)))
OBJECTS_ASM = $(addprefix $(BUILD_DIR)/,$(notdir $(C_SOURCES:.c=.s)))
vpath %.c $(sort $(dir $(C_SOURCES)))
# list of ASM program objects
OBJECTS += $(addprefix $(BUILD_DIR)/,$(notdir $(ASM_SOURCES:.s=.o)))
@ -185,12 +187,15 @@ vpath %.S $(sort $(dir $(ASMM_SOURCES)))
$(BUILD_DIR)/%.o: %.c Makefile | $(BUILD_DIR)
$(CC) -c $(CFLAGS) -Wa,-a,-ad,-alms=$(BUILD_DIR)/$(notdir $(<:.c=.lst)) $< -o $@
$(BUILD_DIR)/%.s: %.c Makefile | $(BUILD_DIR)
$(CC) $(CFLAGS_ASM) -fverbose-asm -S $< -o $@
$(BUILD_DIR)/%.o: %.s Makefile | $(BUILD_DIR)
$(AS) -c $(CFLAGS) $< -o $@
$(BUILD_DIR)/%.o: %.S Makefile | $(BUILD_DIR)
$(AS) -c $(CFLAGS) $< -o $@
$(BUILD_DIR)/$(TARGET).elf: $(OBJECTS) Makefile
$(BUILD_DIR)/$(TARGET).elf: $(OBJECTS) $(OBJECTS_ASM) Makefile
$(CC) $(OBJECTS) $(LDFLAGS) -o $@
$(SZ) $@