How to detect boards

I have a sketch that works on UNO and Teensy 3.6. I want to use something like the following to discover which one the sketch is running on:

#ifdef <tensy 3.6 id>
  run teensy code
#else
  run UNO coded
#endif

Is there a list somewhere that indicates what #ifdef values to use for each type of board?
If the detection isn’t done this way, then how?

i found that the following work for Arduinos

#if defined __AVR_ATmega328P__      // Uno
#if defined __AVR_ATmega2560__

there may be something similar for the ARM processor

Thanks I'll run some tests and do more research on detecting chip types.

> grep build.flags.defs hardware/teensy/avr/boards.txt
teensy41.build.flags.defs=-D__IMXRT1062__ -DTEENSYDUINO=152
teensy40.build.flags.defs=-D__IMXRT1062__ -DTEENSYDUINO=152
teensy36.build.flags.defs=-D__MK66FX1M0__ -DTEENSYDUINO=152
teensy35.build.flags.defs=-D__MK64FX512__ -DTEENSYDUINO=152
teensy31.build.flags.defs=-D__MK20DX256__ -DTEENSYDUINO=152
teensy30.build.flags.defs=-D__MK20DX128__ -DTEENSYDUINO=152
teensyLC.build.flags.defs=-D__MKL26Z64__ -DTEENSYDUINO=152
teensypp2.build.flags.defs=-DTEENSYDUINO=152 -DARDUINO_ARCH_AVR
teensy2.build.flags.defs=-DTEENSYDUINO=152 -DARDUINO_ARCH_AVR

EDIT // Even easier:

> grep build.board  hardware/teensy/avr/boards.txt
teensy41.build.board=TEENSY41
teensy40.build.board=TEENSY40
teensy36.build.board=TEENSY36
teensy35.build.board=TEENSY35
teensy31.build.board=TEENSY32
teensy30.build.board=TEENSY30
teensyLC.build.board=TEENSYLC
teensypp2.build.board=TEENSY2PP
teensy2.build.board=TEENSY2

These get ARDUINO_ prefix so this does the trick:

#ifdef ARDUINO_TEENSY36

For AVR boards there is ARDUINO_AVR_BOARDNAME.

thanks

Thank you so much oqibidipo. That did it…

Best regards!