Creating libraries for different Adruino's

What differences are you talking about? If it is to do with different pin mappings then see the macros and functions in pins_arduino.h. If it is for different microcontroller architectures you could test which MCU flags are defined (__AVR_ATmega2560__, __AVR_ATmega1284P__ etc). A better way might be to test for the existence of different #defines. For instance, HardwareSerial.cpp contains this code:

#if defined(UBRRH) || defined(UBRR0H)
  extern HardwareSerial Serial;
#elif defined(USBCON)
  #include "USBAPI.h"
//  extern HardwareSerial Serial_;
#endif
#if defined(UBRR1H)
  extern HardwareSerial Serial1;
#endif
#if defined(UBRR2H)
  extern HardwareSerial Serial2;
#endif
#if defined(UBRR3H)
  extern HardwareSerial Serial3;
#endif

It defines up to four serial devices, based on whether the appropriate hardware registers exist. If you can do it this way it is much better than for testing for AVR_ATmega2560 etc since it is likely to work with Atmel microcontrollers that you weren't even aware of.