Note that current trends in the Arduino core and etc are AWAY from checking for specific cpu types, and toward checking for specific features that you're using instead.
So instead of
// m1280 has more timers to initialize
sbi(TCCR3B, CS31); // set timer 3 prescale factor to 64
sbi(TCCR3A, WGM30); // put timer 3 in 8-bit phase correct pwm mode
sbi(TCCR4B, CS41); // set timer 4 prescale factor to 64
sbi(TCCR4A, WGM40); // put timer 4 in 8-bit phase correct pw
One would check whether the individual timers instead:
#if defined(TCCR3B) && defined(CS31) && defined(WGM30)
#if defined(TCCR4B) && defined(CS41) && defined(WGM40)
this way, you can compile on essentially similar cpus without having to go and find all the places where the code checks for CPU type. (m328 vs m328p, or m1280 vs m2560, for instance!)
#define RAMEND 0x4FF
Exactly! It's much better to check for having more than a minimum amount of RAM, than to make the size of an array dependent on CPU type.
Some things are documented here: http://www.nongnu.org/avr-libc/user-manual/group__avr__io.html