Wednesday, March 30, 2011

[Level 2] gtk shell script for gcc/vala

1. get vala syntax from gnome

[gcc.sh]
#!/bin/bash -vx
output=`echo $1 | sed -e 's/\.c$//'`
gcc -Wall $1 -o $output `pkg-config --cflags --libs gtk+-2.0`
$output
$ alias gcc='./gcc.sh '
$ gcc ./1.helloworld.c

[valac.sh]
#!/bin/bash
output=`echo $1 | sed -e 's/\.vala$//'`
/usr/bin/valac --pkg gtk+-2.0 $1
$output
$ alias valac='./valac.sh '
$ valac ./3.helloworld.vala
Wish this helps. regards, Stanley Huang