-#! /usr/bin/perl
+#! /usr/bin/env perl
# Copyright (c) 2005-2012, 2014. The SimGrid Team.
# All rights reserved.
$outfile = $infile;
$outfile =~ s/\.c$/_unit.c/;
+ $outfile =~ s/\.cpp$/_unit.cpp/;
$outfile =~ s|.*/([^/]*)$|$1| if $outfile =~ m|/|;
$outfile = "$outdir$outfile";