I'm having a small issue with CppUTest on a project I'm working on. The directories in my project are laid out sort of like this:
/root
/src
/src1
/src2
/Testing
/mocks
/objs
/tests
Makefile
Object files for my sources under test get dumped in weird places (ie: not objs) because the src directories are 'above' the makefile. This isn't a huge problem, but it is a wart I'd like to remove. I dug through MakefileWorker.mk and saw that enabling VPATH is designed for just this situation. The issue is that when I enable VPATH with CPPUTEST_USE_VPATH = Y the make fails right away. The actual make output is:
make: *** No rule to make target `objs/applcommon/DataSource_Mock.o', needed by `tests/applcommon_tests'. Stop.
It seems to fail immediately on building the first *.o but I haven't been able to parse the makefile to figure out exactly why (over my head).
My source/test/include directories are configured as follows:
SRC_DIRS = \
../DataStructures/DataSource/ \
../DataStructures/PubSubDataSource/ \
../DataStructures/LinkedList/ \
../Utilities/
TEST_SRC_DIRS = \
mocks/ \
doubles/ \
utils/ \
tests/ \
tests/DataStructures/DataSource/ \
tests/LinkedList/ \
tests/DataStructures/PubSubDataSource/
INCLUDE_DIRS = \
$(CPPUTEST_HOME)/include/ \
$(SRC_DIRS) \
../Utilities/ \
mocks/ \
doubles/ \
utils/
FYI I'm using OS X with Apple's GCC toolchain and command line tools.
Does anyone see any red flags here? Am I misunderstanding the use of the VPATH flag? Is there any other information that you need? Any help you can provide is greatly appreciated.
Thanks in advance!