Skip to content

Commit

Permalink
Merge pull request #760 from hathach/fix-755-same-name-c-s-file
Browse files Browse the repository at this point in the history
add suffix _s to object of assembly file
  • Loading branch information
hathach authored Mar 30, 2021
2 parents 05d6d7d + 2e4657d commit e106e22
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions examples/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ SRC_S := $(SRC_S:.S=.s)

# Due to GCC LTO bug https://bugs.launchpad.net/gcc-arm-embedded/+bug/1747966
# assembly file should be placed first in linking order
OBJ += $(addprefix $(BUILD)/obj/, $(SRC_S:.s=.o))
# '_asm' suffix is added to object of assembly file
OBJ += $(addprefix $(BUILD)/obj/, $(SRC_S:.s=_asm.o))
OBJ += $(addprefix $(BUILD)/obj/, $(SRC_C:.c=.o))

# Verbose mode
Expand Down Expand Up @@ -111,13 +112,13 @@ $(BUILD)/obj/%.o: %.c

# ASM sources lower case .s
vpath %.s . $(TOP)
$(BUILD)/obj/%.o: %.s
$(BUILD)/obj/%_asm.o: %.s
@echo AS $(notdir $@)
@$(CC) -x assembler-with-cpp $(ASFLAGS) -c -o $@ $<

# ASM sources upper case .S
vpath %.S . $(TOP)
$(BUILD)/obj/%.o: %.S
$(BUILD)/obj/%_asm.o: %.S
@echo AS $(notdir $@)
@$(CC) -x assembler-with-cpp $(ASFLAGS) -c -o $@ $<

Expand Down

0 comments on commit e106e22

Please sign in to comment.