how to enable #ifdef macro in the command line of make?

[Keyword] Linux, C++, make, macro

In source code, we used some #ifdef macros. How can I enable #ifdef macro in the command line of "make" (NOTE: I do NOT want to change source code or makefile to define that macro from time to time).

e.g. test.cpp:
...
#ifdef TEST1
// code segment for test1
...
#endif
...
#ifdef TEST2
// code segment for test2
...
#endif
....

Question: How can I enable either macro via command line of make?
e.g. make ????? -> enable TEST1
make ????? -> enable TEST2

Thanks in advance!

Compilers normally use the -D flags

eg

test.o: test.cpp
     $(CC) $(CFLAGS) -DTEST1 test.cpp -o $@

if u wish to do it outside makefile
make CFLAGS=-DMACRO

dont forget that inside your make file u are using the CFLAGS macro while compilation

hi porter & uvrakesh, i got it. thanks a lot.