My project organization is as follows:
- Makefile
- build
- objects
- apps
- include
- subdirectory (contains *.h)
- subdirectory (contains *.h)
- src
- subdirectory (contains *.cpp)
- subdirectory (contains *.cpp)
In my makefile, to grab all *.h from the subdirectories I currently use:
#includes (.h / .hpp)
INC_DIRS := \
$(wildcard include/*/)
INCLUDE = $(foreach d, $(INC_DIRS), -I$d)
This does work, and I am able to compile fine. However I was wondering if there was a simpler way to include all subdirectories in a single include statement.
The current method I am using does a '-Iinclude/subdirectory' for each subdirectory and it looks really messy and confusing in the terminal.