Code: Select all
#!/bin/sh
myfile="$@"
gcc `pkg-config --cflags --libs gtk+-2.0` -o "$myfile" "$myfile".c
strip "$myfile"
I had some fun with it and added a little cream to your strawberry dessert
you can compile the c code in this thread with it
Code: Select all
#!/bin/sh
# drag N drop c compiler
# gcc compiler flags config by vovchick
# file filters , Xdialog and gcc version checking by big_bass
# 7-19-2010
MY_CFILE="$@"
DIR_N=`dirname "$@"`
MY_FILE=`basename "$@" .c`
#check gcc version
gcc_version=`gcc -dumpversion`
Xdialog --title "gcc version" \
--infobox "\ngcc version $gcc_version\n" 0 0 2000
if echo `basename "$@"` | grep -q '.c$'; then
Xdialog --wrap --title "COMPILE" \
--yesno "Do you want to compile $@ " 0 0
case $? in
0)
echo "Yes chosen."
gcc `pkg-config --cflags --libs gtk+-2.0` -o "$DIR_N"/"$MY_FILE" "$MY_CFILE"
strip "$DIR_N/$MYFILE"
;;
1)
echo "No chosen."
exit
;;
255)
echo "Box closed."
exit
;;
esac
Xdialog --title "Complete" \
--infobox "\nConversion to $MY_FILE bin has finished.\n" 0 0 4000
else
Xdialog --title "ERROR MESSAGE drag N drop" \
--msgbox "only C code allowed " 0 0
case $? in
0)
echo "OK"
exit
;;
255)
echo "Box closed."
exit
;;
esac
fi