简体   繁体   中英

define macro in makefile for visual studio C++ build

I have two exe which use the same .dll through explicit linking, both do some specific work, which are differentiated through some macros. I have created a make file to build the dll, now how to define that macro in makefile, so that I can generate respective dll for my use. while my build is on windows, and I am using visual studio compiler, any input will be appreciable.

When you run make , you can set macros on the command-line. These macros become read-only during the make run (in other words, they override any assignments that you may attempt inside the Makefile).

So, create a make-based VisualStudio project. For the Debug configuration ensure it runs

make TARGET=Debug

and for the Release configuration

make TARGET=Release

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM