My latest project is in C++ and I am using GNU Make. The project directory layout is as follows:
project
|-src
|-subdir1
|-subdir2 (containing tests)
|-doc
|-bin
I would like to be able to call make
in the top level directory (i.e. need a makefile in the project directory) to compile all sources in both "src" subdirectories and place the resulting binaries in the "bin" directory.
What would be the best approach to do this? It would also be great if I didn't have to add a make rule for every source file, but just had one for all .cc and .h files in the directories.