Build with condition check

Hello,
Can I build with certain flag conditions in makefile in DDK. i.e. If I have
different sources or different targets to be generated based on a flag, can I
have conditional compilation, with the argument being passed as a build
argument.

This kind of facility is available on Linux…

Cheers
Akshay

DISCLAIMER:
This message (including attachment if any) is confidential and may be privileged. Before opening attachments please check them for viruses and defects. MindTree Consulting Private Limited (MindTree) will not be responsible for any viruses or defects or any forwarded attachments emanating either from within MindTree or outside. If you have received this message by mistake please notify the sender by return e-mail and delete this message from your system. Any unauthorized use or dissemination of this message in whole or in part is strictly prohibited. Please note that e-mails are susceptible to change and MindTree shall not be liable for any improper, untimely or incomplete transmission.

The ddk way is to have subdirectories for each of your distinct build cases,
with common sources in the parent directory (and a dirs file to direct the
build of the subprojects.)

-----Original Message-----
From: Akshay Agarwal [mailto:xxxxx@mindtree.com]
Sent: Monday, June 02, 2003 1:17 AM
To: NT Developers Interest List
Subject: [ntdev] Build with condition check

Hello,
Can I build with certain flag conditions in makefile in DDK. i.e. If I have
different sources or different targets to be generated based on a flag, can
I have conditional compilation, with the argument being passed as a build
argument.

This kind of facility is available on Linux…

Cheers
Akshay

DISCLAIMER:
This message (including attachment if any) is confidential and may be
privileged. Before opening attachments please check them for viruses and
defects. MindTree Consulting Private Limited (MindTree) will not be
responsible for any viruses or defects or any forwarded attachments
emanating either from within MindTree or outside. If you have received this
message by mistake please notify the sender by return e-mail and delete
this message from your system. Any unauthorized use or dissemination of this
message in whole or in part is strictly prohibited. Please note that
e-mails are susceptible to change and MindTree shall not be liable for any
improper, untimely or incomplete transmission.


You are currently subscribed to ntdev as: xxxxx@stratus.com To
unsubscribe send a blank email to xxxxx@lists.osr.com

You can easily build a batch file to do a CD to the appropriate directory
and build it from its local DIRS file.

Alberto.

-----Original Message-----
From: Roddy, Mark [mailto:xxxxx@stratus.com]
Sent: Monday, June 02, 2003 10:33 AM
To: NT Developers Interest List
Subject: [ntdev] RE: Build with condition check

The ddk way is to have subdirectories for each of your distinct build cases,
with common sources in the parent directory (and a dirs file to direct the
build of the subprojects.)

-----Original Message-----
From: Akshay Agarwal [mailto:xxxxx@mindtree.com]
Sent: Monday, June 02, 2003 1:17 AM
To: NT Developers Interest List
Subject: [ntdev] Build with condition check

Hello,
Can I build with certain flag conditions in makefile in DDK. i.e. If I have
different sources or different targets to be generated based on a flag, can
I have conditional compilation, with the argument being passed as a build
argument.

This kind of facility is available on Linux…

Cheers
Akshay

DISCLAIMER:
This message (including attachment if any) is confidential and may be
privileged. Before opening attachments please check them for viruses and
defects. MindTree Consulting Private Limited (MindTree) will not be
responsible for any viruses or defects or any forwarded attachments
emanating either from within MindTree or outside. If you have received this
message by mistake please notify the sender by return e-mail and delete
this message from your system. Any unauthorized use or dissemination of this
message in whole or in part is strictly prohibited. Please note that
e-mails are susceptible to change and MindTree shall not be liable for any
improper, untimely or incomplete transmission.


You are currently subscribed to ntdev as: xxxxx@stratus.com To
unsubscribe send a blank email to xxxxx@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@compuware.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

The contents of this e-mail are intended for the named addressee only. It
contains information that may be confidential. Unless you are the named
addressee or an authorized designee, you may not copy or use it, or disclose
it to anyone else. If you received it in error please notify us immediately
and then destroy it.

That is how I have them… But internally I have some flags… and based on
that want to do a conditional compilation… I can pass this condition as a
parameter to the build…

say - build -cwz COND_A

and have something like ifdef COND_A in the makefile…

This feature is there in the gnu make… Not very much sure of DDK build
though.

Cheers
Akshay

-----Original Message-----
From: Roddy, Mark [mailto:xxxxx@stratus.com]
Sent: Monday, June 02, 2003 8:03 PM
To: NT Developers Interest List
Subject: [ntdev] RE: Build with condition check

The ddk way is to have subdirectories for each of your distinct build cases,
with common sources in the parent directory (and a dirs file to direct the
build of the subprojects.)

-----Original Message-----
From: Akshay Agarwal [mailto:xxxxx@mindtree.com]
Sent: Monday, June 02, 2003 1:17 AM
To: NT Developers Interest List
Subject: [ntdev] Build with condition check

Hello,
Can I build with certain flag conditions in makefile in DDK. i.e. If I have
different sources or different targets to be generated based on a flag, can
I have conditional compilation, with the argument being passed as a build
argument.

This kind of facility is available on Linux…

Cheers
Akshay

DISCLAIMER:
This message (including attachment if any) is confidential and may be
privileged. Before opening attachments please check them for viruses and
defects. MindTree Consulting Private Limited (MindTree) will not be
responsible for any viruses or defects or any forwarded attachments
emanating either from within MindTree or outside. If you have received this
message by mistake please notify the sender by return e-mail and delete
this message from your system. Any unauthorized use or dissemination of this
message in whole or in part is strictly prohibited. Please note that
e-mails are susceptible to change and MindTree shall not be liable for any
improper, untimely or incomplete transmission.


You are currently subscribed to ntdev as: xxxxx@stratus.com To
unsubscribe send a blank email to xxxxx@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@mindtree.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

DISCLAIMER:
This message (including attachment if any) is confidential and may be privileged. Before opening attachments please check them for viruses and defects. MindTree Consulting Private Limited (MindTree) will not be responsible for any viruses or defects or any forwarded attachments emanating either from within MindTree or outside. If you have received this message by mistake please notify the sender by return e-mail and delete this message from your system. Any unauthorized use or dissemination of this message in whole or in part is strictly prohibited. Please note that e-mails are susceptible to change and MindTree shall not be liable for any improper, untimely or incomplete transmission.

It is partially possible but you can’t have different sources. The problem
is SOURCES file is interpreted two ways. Once by build.exe utility which
knows nothing about conditions and only scans it for some keywords as
sources list. Then build.exe invokes nmake.exe which makes MAKEFILE in
current directory which includes makefile.def from DDK which in turn
includes SOURCES file from current directory and uses it as standard
makefile and you can use nmake syntax. For example:

!IF “$(DDKBUILDENV)” == “fre”
C_DEFINES=$(C_DEFINES) -D_TDBG_LEVEL=0 -DAVOID_ASSERTS
!ELSE
C_DEFINES=$(C_DEFINES) -D_TDBG_LEVEL=2
!ENDIF

It is useful if you want to build several binaries of the same type with
minor differences as for example with and without traces, with 56-bit or
128-bit encryption etc. but not when want to build different binary types
with slightly different set of sources. Then, subdirectories is the way.

BTW, really funny disclaimer…

Best regards,

Michal Vodicka
STMicroelectronics Design and Application s.r.o.
[michal.vodicka@st.com, http:://www.st.com]


From: xxxxx@mindtree.com[SMTP:xxxxx@mindtree.com]
Reply To: xxxxx@lists.osr.com
Sent: Tuesday, June 03, 2003 7:02 AM
To: xxxxx@lists.osr.com
Subject: [ntdev] RE: Build with condition check

That is how I have them… But internally I have some flags… and based on
that want to do a conditional compilation… I can pass this condition as a
parameter to the build…

say - build -cwz COND_A

and have something like ifdef COND_A in the makefile…

This feature is there in the gnu make… Not very much sure of DDK build
though.

Cheers
Akshay

-----Original Message-----
From: Roddy, Mark [mailto:xxxxx@stratus.com]
Sent: Monday, June 02, 2003 8:03 PM
To: NT Developers Interest List
Subject: [ntdev] RE: Build with condition check

The ddk way is to have subdirectories for each of your distinct build
cases,
with common sources in the parent directory (and a dirs file to direct the
build of the subprojects.)

-----Original Message-----
From: Akshay Agarwal [mailto:xxxxx@mindtree.com]
Sent: Monday, June 02, 2003 1:17 AM
To: NT Developers Interest List
Subject: [ntdev] Build with condition check

Hello,
Can I build with certain flag conditions in makefile in DDK. i.e. If I
have
different sources or different targets to be generated based on a flag,
can
I have conditional compilation, with the argument being passed as a build
argument.

This kind of facility is available on Linux…

Cheers
Akshay

In the command line:

set MYVAR=something
build -cwz

In the SOURCES

! IF “$(MYVAR)” != “something”
!ELSE
!ENDIF

----- Original Message -----
From: “Akshay Agarwal”
To: “NT Developers Interest List”
Sent: Tuesday, June 03, 2003 9:02 AM
Subject: [ntdev] RE: Build with condition check

> That is how I have them… But internally I have some flags… and
based on
> that want to do a conditional compilation… I can pass this
condition as a
> parameter to the build…
>
>
> say - build -cwz COND_A
>
> and have something like ifdef COND_A in the makefile…
>
> This feature is there in the gnu make… Not very much sure of DDK
build
> though.
>
> Cheers
> Akshay
>
> -----Original Message-----
> From: Roddy, Mark [mailto:xxxxx@stratus.com]
> Sent: Monday, June 02, 2003 8:03 PM
> To: NT Developers Interest List
> Subject: [ntdev] RE: Build with condition check
>
>
> The ddk way is to have subdirectories for each of your distinct
build cases,
> with common sources in the parent directory (and a dirs file to
direct the
> build of the subprojects.)
>
> -----Original Message-----
> From: Akshay Agarwal [mailto:xxxxx@mindtree.com]
> Sent: Monday, June 02, 2003 1:17 AM
> To: NT Developers Interest List
> Subject: [ntdev] Build with condition check
>
>
> Hello,
> Can I build with certain flag conditions in makefile in DDK. i.e. If
I have
> different sources or different targets to be generated based on a
flag, can
> I have conditional compilation, with the argument being passed as a
build
> argument.
>
> This kind of facility is available on Linux…
>
> Cheers
> Akshay
>
>
> DISCLAIMER:
> This message (including attachment if any) is confidential and may
be
> privileged. Before opening attachments please check them for viruses
and
> defects. MindTree Consulting Private Limited (MindTree) will not be
> responsible for any viruses or defects or any forwarded attachments
> emanating either from within MindTree or outside. If you have
received this
> message by mistake please notify the sender by return e-mail and
delete
> this message from your system. Any unauthorized use or dissemination
of this
> message in whole or in part is strictly prohibited. Please note
that
> e-mails are susceptible to change and MindTree shall not be liable
for any
> improper, untimely or incomplete transmission.
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@stratus.com To
> unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@mindtree.com
> To unsubscribe send a blank email to
xxxxx@lists.osr.com
>
>
> DISCLAIMER:
> This message (including attachment if any) is confidential and may
be privileged. Before opening attachments please check them for
viruses and defects. MindTree Consulting Private Limited (MindTree)
will not be responsible for any viruses or defects or any forwarded
attachments emanating either from within MindTree or outside. If you
have received this message by mistake please notify the sender by
return e-mail and delete this message from your system. Any
unauthorized use or dissemination of this message in whole or in part
is strictly prohibited. Please note that e-mails are susceptible to
change and MindTree shall not be liable for any improper, untimely or
incomplete transmission.
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to
xxxxx@lists.osr.com
>

Thanks Michal and Maxim

Cheers
Akshay
-----Original Message-----
From: Michal Vodicka [mailto:xxxxx@veridicom.cz.nospam]
Sent: Wednesday, June 04, 2003 3:37 AM
To: NT Developers Interest List
Subject: [ntdev] RE: Build with condition check

It is partially possible but you can’t have different sources. The problem
is SOURCES file is interpreted two ways. Once by build.exe utility which
knows nothing about conditions and only scans it for some keywords as
sources list. Then build.exe invokes nmake.exe which makes MAKEFILE in
current directory which includes makefile.def from DDK which in turn
includes SOURCES file from current directory and uses it as standard
makefile and you can use nmake syntax. For example:

!IF “$(DDKBUILDENV)” == “fre”
C_DEFINES=$(C_DEFINES) -D_TDBG_LEVEL=0 -DAVOID_ASSERTS
!ELSE
C_DEFINES=$(C_DEFINES) -D_TDBG_LEVEL=2
!ENDIF

It is useful if you want to build several binaries of the same type with
minor differences as for example with and without traces, with 56-bit or
128-bit encryption etc. but not when want to build different binary types
with slightly different set of sources. Then, subdirectories is the way.

BTW, really funny disclaimer…

Best regards,

Michal Vodicka
STMicroelectronics Design and Application s.r.o.
[michal.vodicka@st.com, http:://www.st.com]


From: xxxxx@mindtree.com[SMTP:xxxxx@mindtree.com]
Reply To: xxxxx@lists.osr.com
Sent: Tuesday, June 03, 2003 7:02 AM
To: xxxxx@lists.osr.com
Subject: [ntdev] RE: Build with condition check

That is how I have them… But internally I have some flags… and based on
that want to do a conditional compilation… I can pass this condition as a
parameter to the build…

say - build -cwz COND_A

and have something like ifdef COND_A in the makefile…

This feature is there in the gnu make… Not very much sure of DDK build
though.

Cheers
Akshay

-----Original Message-----
From: Roddy, Mark [mailto:xxxxx@stratus.com]
Sent: Monday, June 02, 2003 8:03 PM
To: NT Developers Interest List
Subject: [ntdev] RE: Build with condition check

The ddk way is to have subdirectories for each of your distinct build
cases,
with common sources in the parent directory (and a dirs file to direct the
build of the subprojects.)

-----Original Message-----
From: Akshay Agarwal [mailto:xxxxx@mindtree.com]
Sent: Monday, June 02, 2003 1:17 AM
To: NT Developers Interest List
Subject: [ntdev] Build with condition check

Hello,
Can I build with certain flag conditions in makefile in DDK. i.e. If I
have
different sources or different targets to be generated based on a flag,
can
I have conditional compilation, with the argument being passed as a build
argument.

This kind of facility is available on Linux…

Cheers
Akshay


You are currently subscribed to ntdev as: xxxxx@mindtree.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

DISCLAIMER:
This message (including attachment if any) is confidential and may be privileged. Before opening attachments please check them for viruses and defects. MindTree Consulting Private Limited (MindTree) will not be responsible for any viruses or defects or any forwarded attachments emanating either from within MindTree or outside. If you have received this message by mistake please notify the sender by return e-mail and delete this message from your system. Any unauthorized use or dissemination of this message in whole or in part is strictly prohibited. Please note that e-mails are susceptible to change and MindTree shall not be liable for any improper, untimely or incomplete transmission.