You can pass extra defines to the compiler with the -D command line parameter; this is done for example in the build.extra_flags parameter in boards.txt
Ex:
atxy6.build.extra_flags=-DMILLIS_USE_TIMERA0 -DNO_EXTERNAL_I2C_PULLUP -DUSE_TIMERD0_PWM
So if I wanted a define called MYDEFINE to test via #ifdef MYDEFINE, I would just add
atxy6.build.extra_flags=-DMILLIS_USE_TIMERA0 -DNO_EXTERNAL_I2C_PULLUP -DUSE_TIMERD0_PWM -DMYDEFINE
But say I don't just want to pass a define that can be tested with #ifdef, but pass an actual value to it, for example, say I want MYDEFINE to be defined as 1 - what's the syntax for that?
I realize by this point I should know how to do this, but I don't, and I can't figure out search terms that give me relevant results in google.
(the context is that in my megaTinyCore, you need to set the VREF voltage to make the DAC work, and I want to choose between the 5 available values with a tools submenu. I know I could do:
atxy6.menu.dacvref.0v55.build.dacvref=-DDACVREF0V55
atxy6.menu.dacvref.1v1.build.dacvref=-DDACVREF1V1
atxy6.menu.dacvref.1v5.build.dacvref=-DDACVREF1V5
atxy6.menu.dacvref.2v5.build.dacvref=-DDACVREF2V5
atxy6.menu.dacvref.4v3.build.dacvref=-DDACVREF4V3
atxy6.build.extra_flags=-DMILLIS_USE_TIMERA0 -DNO_EXTERNAL_I2C_PULLUP -DUSE_TIMERD0_PWM {build.dacvref}
and then
#ifdef DACVREF0V55
#define DACVREF 0
#endif
#ifdef DACVREF1V1
#define DACVREF 1
#endif
etc
But that is ugly and obnoxious, and there's clearly a better way, I just don't know it.
Thanks in advance!