Start here

Home
About Klocwork
What's new
Fixed issues
Release notes
Installation

Reference

C/C++ checkers
Java checkers
C# checkers
MISRA C 2004 checkers
MISRA C++ 2008 checkers
MISRA C 2012 checkers
MISRA C 2012 checkers with Amendment 1
Commands
Metrics
Troubleshooting
Reference

Product components

C/C++ Integration build analysis
Java Integration build analysis
Desktop analysis
Refactoring
Klocwork Static Code Analysis
Klocwork Code Review
Structure101
Tuning
Custom checkers

Coding environments

Visual Studio
Eclipse for C/C++
Eclipse for Java
IntelliJ IDEA
Other

Administration

Project configuration
Build configuration
Administration
Analysis performance
Server performance
Security/permissions
Licensing
Klocwork Static Code Analysis Web API
Klocwork Code Review Web API

Community

View help online
Visit RogueWave.com
Klocwork Support
Rogue Wave Videos

Legal

Legal information

Example: Creating and using a build specification template

JoeAdmin has created a server project called sampleproject in /home/joeadmin/sampleproject. There is only one file, src.c , in sampleproject.

  1. JoeAdmin runs kwinject on the make command, using the -V option to substitute the projects_root directory with the kwpsroot variable, and using the -o option to specify a file name with the .tpl extension:
    /home/joeadmin/sampleproject $ /kw-server/bin/kwinject -o sampleproject.tpl -V kwpsroot=`pwd` make clean all
    This command specifies that the build specification template file will be named sampleproject.tpl.
    The resulting build specification template file looks like this:
    version;105 config;/usr/bin/gcc|c;<compiler configuration flags here> compile;%(kwpsroot);/usr/bin/gcc|c;%(kwpsroot)/src.o;src.c link;%(kwpsroot);%(kwpsroot)/<default>;src.o
  2. JoeAdmin imports the build specification template into the integration project "sampleproject" on the Klocwork Server:
    /home/joeadmin/sampleproject $ /kw-server/bin/kwadmin import-config sampleproject sampleproject.tpl
  3. The developer JaneUser extracts sampleproject to /home/janeuser.
  4. She creates local-project and project-settings directories for sampleproject, and connects to the integration project on the Klocwork Server:
    /home/janeuser/sampleproject $ /kw-user/bin/kwcheck create --project sampleproject
  5. She runs a Klocwork analysis on sampleproject:
    /home/janeuser/sampleproject $ /kw-user/bin/kwcheck run
    Because of the connection to the integration project, kwcheck automatically detects and uses the build specification template. kwcheck replaces the kwpsroot variable with the location of the .kwps directory on her machine (/home/janeuser/sampleproject).