simple_self_test.sh (Source)

#!/bin/bash -x
rm -f test.o test.c test.elf
cat >test.c <<EOF
int main(void) {
  return 0;
}
EOF
avr-gcc --version
cat test.c
avr-gcc -std=c99 -g -mmcu=atmega328p -Os -DF_CPU=16000000 -c test.c
avr-gcc -std=c99 -g -mmcu=atmega328p -o test.elf test.o