From e15f35fd9b9746c4f001710b53c073cd2672008e Mon Sep 17 00:00:00 2001 From: tmk Date: Fri, 2 Jul 2021 16:45:23 +0900 Subject: [PATCH] rules.mk: Allow same name between .c and .cpp --- tmk_core/rules.mk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tmk_core/rules.mk b/tmk_core/rules.mk index 3c386b1f..1c33cc84 100644 --- a/tmk_core/rules.mk +++ b/tmk_core/rules.mk @@ -334,10 +334,10 @@ MSG_CREATING_LIBRARY = Creating library: # Define all object files. -OBJ = $(patsubst %.c,$(OBJDIR)/%.o,$(patsubst %.cpp,$(OBJDIR)/%.o,$(patsubst %.S,$(OBJDIR)/%.o,$(SRC)))) +OBJ = $(patsubst %.c,$(OBJDIR)/%.o,$(patsubst %.cpp,$(OBJDIR)/%.cpp.o,$(patsubst %.S,$(OBJDIR)/%.o,$(SRC)))) # Define all listing files. -LST = $(patsubst %.c,$(OBJDIR)/%.lst,$(patsubst %.cpp,$(OBJDIR)/%.lst,$(patsubst %.S,$(OBJDIR)/%.lst,$(SRC)))) +LST = $(patsubst %.c,$(OBJDIR)/%.lst,$(patsubst %.cpp,$(OBJDIR)/%.cpp.lst,$(patsubst %.S,$(OBJDIR)/%.lst,$(SRC)))) # Compiler flags to generate dependency files. @@ -561,7 +561,7 @@ $(OBJDIR)/%.o : %.c # Compile: create object files from C++ source files. -$(OBJDIR)/%.o : %.cpp +$(OBJDIR)/%.cpp.o : %.cpp @echo mkdir -p $(@D) @echo $(MSG_COMPILING_CPP) $<