Specify board type inside the sketch

Hi all,

I have a question, but I can't find any answer:
I work with many Arduino boards, like Uno, Pro Mini, Mega and so on.
When I write a sketch I write it for a specific board, and I wish to specify the board type (and speed, processor et al.) inside the sketch itself, so when I compile it is compiled for the right board.

It is possible to do this using some type of directives?

Thanks

Luke

Such as the way "if defined" is used in this file? You would select the processor the code is to be compiled for:

#if defined(AVR_ATmega8)

pins_arduino.h (4.94 KB)