This is one of my develop note for CRISPR-X. CRISPRs (clustered regularly interspaced palindromic repeats) are DNA sequences that many bacteria and archaea use to defend themselves. It has crazed wept across scientific community in 2013. CRISPR-X is our iGEM project, designed to find and evaluate potential sgRNA. Most importantly, CRISPR-X follows the standards of synthetic biology based on standard parts.
Considering a lot of old stuff about make online, I just want to highlight the syntax and philosophy of make.
make is a rule, it has default targets. Some are file targets, and others are command targets. The idea of automated test using make is treating every test case as a command target to execute. Integrating other tools, we can do lots of awesome things, such as using diff to check program validity, using gcov to get C/C++ program test coverage and so on.
Example based on Travis CI, Coveralls
In the above makefile, I use some variables to control the compile process. Here, two things need attention. Firstly, I try to use gcov, the GNU coverage evaluation tool. To make gcov works, the source file which you want to track must be compiled with flags -fprofile-arcs and -ftest-coverage. These flags tell gcc set counter in the compiled file to get the run times of every code lines. Most surprisingly, gcov returns a *.gcov file for every tracked source file which recording the details. Secondly, in makefile, we can use .PHONY the build-in target to mark those command targets. It’s useful when you have some file targets with the same name as your command targets. .PHONY avoids their name conflict.
You might have guessed it as the travis config is so easy. I use Travis CI mysql service, install C++ coveralls tool, setup my database and get the DB driver. It works successfully, and I got two badges now, the build passing and coverage percentage.