mkdir -p /tmp/applet
cat $1.pde > /tmp/applet/$1.cpp
echo 'extern "C" void __cxa_pure_virtual(void); void __cxa_pure_virtual(void) { abort(); }' >> /tmp/applet/$1.cpp
AINSTALL=$HOME/arduino-0021
cat $AINSTALL/hardware/arduino/cores/arduino/main.cpp >> /tmp/applet/$1.cpp
avr-g++ -c -mmcu=atmega328p -I. -DF_CPU=16000000 -I$AINSTALL/hardware/arduino/cores/arduino -I$AINSTALL/hardware/tools/avr/avr/include -I$AINSTALL/libraries/EEPROM -I$AINSTALL/libraries/Gameduino -I$AINSTALL/libraries/SPI -I$AINSTALL/libraries/Firmata -I$AINSTALL/libraries/Ethernet -I$AINSTALL/libraries/Ethernet/utility -I$AINSTALL/libraries/Servo -I$AINSTALL/libraries -Os -ffunction-sections -fdata-sections /tmp/applet/$1.cpp -o /tmp/applet/$1.o 
