What does TEMP0_FILES
below compute to? SOURCE_FILES
can equal to multiple source files. Please tell me the purpose of the following syntax :.cpp=.o
SOURCE_FILES = main.cpp
TEMP0_FILES = $(SOURCE_FILES:.cpp=.o)
What does TEMP0_FILES
below compute to? SOURCE_FILES
can equal to multiple source files. Please tell me the purpose of the following syntax :.cpp=.o
SOURCE_FILES = main.cpp
TEMP0_FILES = $(SOURCE_FILES:.cpp=.o)
The : syntax causes a substitution to occur on the variable. In this case it will replace ".cpp" with ".o" in all of the items in the SOURCE_FILES variable.
TEMP0_FILES will be "main.o"
If SOURCE_FILES is "main.cpp otherfile.cpp otherfile2.cpp" TEMP0_FILES will become: "main.o otherfile.o otherfile2.o" etc.