[Arduino] - How to find predefine in code.

Standard



1. Show verbose compiling in Preferences



2. Find -o and change to -dM -E
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10605 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/standard /var/folders/1c/8vw9xwqn0913c1pfc1wy65mr0000gn/T/build1765620328382765666.tmp/Blink.cpp -o /var/folders/1c/8vw9xwqn0913c1pfc1wy65mr0000gn/T/build1765620328382765666.tmp/Blink.cpp.o 
Change -o  to -dM -E
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10605 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/standard /var/folders/1c/8vw9xwqn0913c1pfc1wy65mr0000gn/T/build1765620328382765666.tmp/Blink.cpp -dM -E
You can see predefine

3. You can use " > filename" to get result in file.
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10605 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/standard /var/folders/1c/8vw9xwqn0913c1pfc1wy65mr0000gn/T/build1765620328382765666.tmp/Blink.cpp -dM -E > ~/predefine.txt



Ref : http://www.gammon.com.au/tips#style