I would like to restructure my code to have certain .h and .cpp files place in appropriate subdirectories. Is there a way to do this without changing all my includes to point to the subdirectory first.
I was hoping there might be something like
INCLUDE_DIRS=src,src/subdir
that I could put in the project.properties file but that doesn't seem to work.
Hey @rickkas7 Well I thought it worked because I was getting no compiler errors but it appears to cause something else to be compiled rather than my source files. For example I created a new project with the start blink test code. Compiled to 5.9.0 and flashed it with success.
Added in the build.mk file and made sure it was in the src directory.
Did a clean and compile.
Compiles successfully, flashes but does not execute the code that I have in setup and loop. It also seems to go to a flashing green, then solid green, then the two orange, etc. The device does not have access to the internet but I am in Manual mode so not sure what code is being compile and loaded when I add this build.mk file.
Contents of the file are just the one liner you provided.
Behaves the same whether the testsubdir exists or not.
Here is my main.cpp
Hmm... maybe you need to add the boilerplate still.
## Standard behavior must be included here
INCLUDE_DIRS += $(SOURCE_PATH)/$(USRSRC) # add user sources to include path
CPPSRC += $(call target_files,$(USRSRC_SLASH),*.cpp)
CSRC += $(call target_files,$(USRSRC_SLASH),*.c)
APPSOURCES=$(call target_files,$(USRSRC_SLASH),*.cpp)
APPSOURCES+=$(call target_files,$(USRSRC_SLASH),*.c)
## Custom stuff can be added here
INCLUDE_DIRS += $(SOURCE_PATH)/src/testsubdir