Query: how to set #define values in parameters of 'make'

T

Tropos

I have a _TEST_ flag that I want to sometimes set for compilation,
e.g.

#if _TEST_
#include "MyTestInterface.h"
#else
#include "MyRealInterface.h"
#endif

But I am in a version-controlled environment where there is a time
penalty for checking out/checking in the source file or makefile. Is
there any way I can say something like

make -D_TEST_=1

to set the value of _TEST_ for a single build?


Thanks

(e-mail address removed)
 
S

Sharad Kala

Tropos said:
I have a _TEST_ flag that I want to sometimes set for compilation,
e.g.

#if _TEST_
#include "MyTestInterface.h"
#else
#include "MyRealInterface.h"
#endif

But I am in a version-controlled environment where there is a time
penalty for checking out/checking in the source file or makefile. Is
there any way I can say something like

make -D_TEST_=1

to set the value of _TEST_ for a single build?

This if offtopic here. But there is a way to achieve what you want. Ask in

Sharad
 
L

Lionel B

Tropos said:
I have a _TEST_ flag that I want to sometimes set for compilation,
e.g.

#if _TEST_
#include "MyTestInterface.h"
#else
#include "MyRealInterface.h"
#endif

But I am in a version-controlled environment where there is a time
penalty for checking out/checking in the source file or makefile. Is
there any way I can say something like

make -D_TEST_=1

to set the value of _TEST_ for a single build?

<OT>

http://www.gnu.org/software/make/manual/html_chapter/make_9.html#SEC100
</OT>
 
T

Tropos

Sharad Kala said:
This if offtopic here. But there is a way to achieve what you want. Ask in

Sharad

I'm not using gcc. This is the standard 'make' with the SunOS compiler.

Tropos
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top