#!/bin/bash

#get number of CPUS
NUMCPUS=$1;


#version of cppcheck
version=`echo *.tar | sed 's/\.tar//g' | sed 's/cppcheck-//g'`
echo $version

#Erase install
rm -rf install  src cppcheck-$version

#install directory
mkdir src

tar -xvf cppcheck-$version.tar

mv cppcheck-$version/* src
rm -rf cppcheck-$version

#compile
cd src
make -j $NUMCPUS  
make -j $NUMCPUS  install PREFIX=$ISSM_TIER/externalpackages/cppcheck/install
cd ..
