nmake modify macro based on target
问题 I've got a Makefile.mak where I optionally create a test.exe or a DLL from my C-based source code. I'm using CL.EXE and NMAKE. I'd like to modify my CFLAGS macro like this when the target is TEST.EXE: CFLAGS = $(CFLAGS) -DMAIN And, of course, I use this in my C code: #ifdef MAIN ... int main()... yada yada #endif I had tried !IF $@ == "test.exe" but it crashed out and doesn't work logically since the $@, target, isn't deterministic in that part of the makefile. The logical place to define the