How to compile project with include and src folders

Hi nRF Team,

We are using nRF52832 with nRF5_SDK_17.1.0_ddde560. Our project is growing bigger and we need to separate the header and source files into different folder for better management. We wanted to split .h files into include folder and .c files into src folder. However, doing so will throw this error when we compile the project

make: *** No rule to make target '../../../custom_file.c', needed by '_build/nrf52832_xxaa/custom_file.c.o'.  Stop.
make: *** Waiting for unfinished jobs....

I believe we need to modify a file to allow the compile to know this change of path. I understand that the target should be

'../../../src/custom_file.c'

instead of 

'../../../custom_file.c'

However, I don't know where to change this. Can you please show me how to do so?

I already updated the Makefile to something like 

$(PROJ_DIR)/src/custom_file.c \

Best regards,

Xander

Related