aboutsummaryrefslogtreecommitdiff
path: root/svg_dep.sh
blob: 5e3ac1b2d18b5665679e5c810d7ddd470eb40059 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/sh

rm -f Makefile.svg

for f in `cd exemples;grep '\.svg["'\''\#]' *.pl *.pm|sed 's/.*["'\'']\([A-Za-z0-9_]*\)\.svg\(\#*[A-Za-z0-9_]*\)["'\''].*/\1\2.pm/' | sed 's/\#/\//'|sort -u` ; do
    echo $f
    n=${f%%.pm}
    s=$(echo $n | sed 's/\//.svg#/' | sed 's/^\([^#]*\)$/\1.svg/')
    cat >> Makefile.svg <<EOF
exemples/AUTOGEN/$f: exemples/data/${n%%/*}.svg
	cd exemples; perl -e "BEGIN {unshift @INC, '.', './data', '../src';} use MTools;new MTools (800, 600, '');minstanciate ('$s',1);"

install_$f: exemples/AUTOGEN/$f
	install -d \${DESTDIR}\${PREFIX}/share/doc/mtools-perl/examples/AUTOGEN/`dirname $n`
	install \$< \${DESTDIR}\${PREFIX}/share/doc/mtools-perl/examples/AUTOGEN/`dirname $n`

EOF
done