I'd like to use make to get a modular build in combination with Continuous Integration, automatic unit testing and multi-platform builds Similar setups are common in Java and .NET, but I'm having a hard time putting this together for make and C/C++. Any thoughts?
My requirements:
- fast build; non recursive make (stackoverflow what is your experience with non-recursive make)
- modular system (i.e. minimal dependencies, makefile in subdirectory with components)
- multiplatform (typically PC for unit testing, embedded target for system integration/release)
- complete dependency checking
- ability to perform (automatic) unit tests (Agile engineering)
- hook into Continuous integration system
- easy to use
I've started with non-rec make. I still find it a great place to start.
Limitations so far:
- no integration of unit tests
- incompatibility of windows based ARM compilers with cygwin paths
- incompatibility of makefile with windows \ paths
- forward dependencies
My structure looks like:
project_root /algorithm /src /algo1.c /algo2.c /unit_test /algo1_test.c /algo2_test.c /out algo1_test.exe algo1_test.xml algo2_test.exe algo2_test.xml headers.h /embunit /harnass makefile Rules.top
I'd like to keep things simple; here the unit tests (algo1_test.exe) depend on both the 'algorithm' component (ok) and the unit test framework (which may or may not be known at the time of building this). However, moving the build rules to the top make does not appeal to me as this would distribute local knowledge of components throughout the system.
As for the cygwin paths: I'm working on making the build using relative paths. This resolves the /cygdrive/c issue (as compilers can generally handle / paths) without bringing in c: (which make dislikes). Any other idea's?