diff --git a/STM32Make.make b/STM32Make.make index 98b3b4a..8bee06a 100644 --- a/STM32Make.make +++ b/STM32Make.make @@ -565,8 +565,14 @@ vpath %.cpp $(sort $(dir $(CPP_SOURCES))) # list of C objects OBJECTS += $(addprefix $(BUILD_DIR)/,$(notdir $(C_SOURCES:.c=.o))) vpath %.c $(sort $(dir $(C_SOURCES))) + # list of ASM program objects -OBJECTS += $(addprefix $(BUILD_DIR)/,$(notdir $(ASM_SOURCES:.s=.o))) +# list of ASM program objects +UPPER_CASE_ASM_SOURCES = $(filter %.S,$(ASM_SOURCES)) +LOWER_CASE_ASM_SOURCES = $(filter %.s,$(ASM_SOURCES)) + +OBJECTS += $(addprefix $(BUILD_DIR)/,$(notdir $(UPPER_CASE_ASM_SOURCES:.S=.o))) +OBJECTS += $(addprefix $(BUILD_DIR)/,$(notdir $(LOWER_CASE_ASM_SOURCES:.s=.o))) vpath %.s $(sort $(dir $(ASM_SOURCES))) $(BUILD_DIR)/%.o: %.cpp STM32Make.make | $(BUILD_DIR) @@ -581,6 +587,9 @@ $(BUILD_DIR)/%.o: %.c STM32Make.make | $(BUILD_DIR) $(BUILD_DIR)/%.o: %.s STM32Make.make | $(BUILD_DIR) $(AS) -c $(CFLAGS) $< -o $@ +$(BUILD_DIR)/%.o: %.S STM32Make.make | $(BUILD_DIR) + $(AS) -c $(CFLAGS) $< -o $@ + $(BUILD_DIR)/$(TARGET).elf: $(OBJECTS) STM32Make.make $(CXX) $(OBJECTS) $(LDFLAGS) -o $@ $(SZ) $@