I have this directory structure.
app/
src
include
lib/
src
maincode/
main.cc
Makefile
I want to create an automatic target from the source list in a makefile. Therefore, I do not need to write a rule for each file.
Example
source=\
../src/a.cpp
../src/ab.cpp
../lib/src/b.cpp
I want to write a rule like
%.o:%.cpp
so I don’t need to repeat the rule for each file. How can i achieve this?
source
share