summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorHa Thach <[email protected]>2021-03-30 10:20:55 +0700
committerGitHub <[email protected]>2021-03-30 10:20:55 +0700
commite106e22bddad51fefab0bb8ca31a0a17d841dec7 (patch)
tree2f8b7b2774e684bf50cc584f847d9328ba98e924 /examples
parent05d6d7d8d1e21ffa1a6a0d05ccfd298c5ff5a131 (diff)
parent2e4657d11178ba590131fb35c10aa1fe491d99a8 (diff)
Merge pull request #760 from hathach/fix-755-same-name-c-s-file
add suffix _s to object of assembly file
Diffstat (limited to 'examples')
-rw-r--r--examples/rules.mk7
1 files changed, 4 insertions, 3 deletions
diff --git a/examples/rules.mk b/examples/rules.mk
index 9265bb684..a19cd678e 100644
--- a/examples/rules.mk
+++ b/examples/rules.mk
@@ -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
@@ -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 $@ $<