summaryrefslogtreecommitdiff
path: root/README-valgrind
blob: e2e0e980cb1717a6e6f9063827449c5df2cfa409 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#! /bin/bash

# Convert Makefile.am files:
#  find tests -name Makefile.am \
#    | xargs grep -wl PATH|xargs perl -pi -e 's,src:\$\$PATH,src/vg:\$\$PATH,'

# Create src/vg:

coreutils=$(echo 'spy:;@echo $(all_programs)' | (cd src; make -f Makefile -f - spy | tr -s '\n ' '  '))
mkdir src/vg
pwd=`pwd`
up=`dirname $pwd`
path='export PATH='$up':${PATH#*:}'
pre='#!/bin/sh\n'"$path"'\n'
n=9
vg='exec /usr/bin/valgrind --quiet --num-callers='$n
cat <<EOF > src/vg/gen
for i in $coreutils; do
  printf "$pre$vg \$i"' "\$@"\n' > \$i
  chmod a+x \$i
done
EOF
cd src/vg
. ./gen