Sources file for multiple OS's

Is there somewhere I can get an example SOURCES file that allows conditional
compiles for different OS’s. E.g. Win2000 and Whistler.

thanks,

daniel

I couldn’t figure out how to do this, so I used a kluge, by using:
!IF “$(BASEDIR)” == “h:\ddk40”
This is nasty since it’s specific to my environment, and is even case sensitive to
the value of the envvar BASEDIR. A better solution would be to use your own
envvar (that you can control) to indicate the target OS.

Regards,

Paul Bunn, UltraBac.com, 425-644-6000
Microsoft MVP - WindowsNT/2000
http://www.ultrabac.com

-----Original Message-----
From: Nemiroff, Daniel [mailto:xxxxx@intel.com]
Sent: Wednesday, November 29, 2000 9:19 AM
To: NT Developers Interest List
Subject: [ntdev] Sources file for multiple OS’s

Is there somewhere I can get an example SOURCES file that allows conditional
compiles for different OS’s. E.g. Win2000 and Whistler.

A lot of MS headers use _WIN32_WINVER, but they expect you to set it. You
may define it the system environment for the machine to be 0x0500 for Win2K
and 0x0510 for Whistler. You could also run an app which set in the
environment based on results of the GetVersionEx call. Unfortunately, the
compiler will not have a built in for the OS version it is running on.

Zyg

-----Original Message-----
From: Paul Bunn [mailto:xxxxx@UltraBac.com]
Sent: November 29, 2000 13:19
To: NT Developers Interest List
Subject: [ntdev] RE: Sources file for multiple OS’s

I couldn’t figure out how to do this, so I used a kluge, by using:
!IF “$(BASEDIR)” == “h:\ddk40”
This is nasty since it’s specific to my environment, and is even case
sensitive to
the value of the envvar BASEDIR. A better solution would be to use your own
envvar (that you can control) to indicate the target OS.

Regards,

Paul Bunn, UltraBac.com, 425-644-6000
Microsoft MVP - WindowsNT/2000
http://www.ultrabac.com

-----Original Message-----
From: Nemiroff, Daniel [mailto:xxxxx@intel.com]
Sent: Wednesday, November 29, 2000 9:19 AM
To: NT Developers Interest List
Subject: [ntdev] Sources file for multiple OS’s

Is there somewhere I can get an example SOURCES file that allows conditional
compiles for different OS’s. E.g. Win2000 and Whistler.


You are currently subscribed to ntdev as: xxxxx@jetform.com
To unsubscribe send a blank email to $subst(‘Email.Unsub’)

Paul has the right idea with an envvar. I modified the setenv.bat for all
of the DDKs I use to set a TargetOS envvar, then test that in the sources
file. You don’t have to modify the setenv.bat, if I were to do it over
again, I would probably just wrap a batch file that sets the envvar around
it. I also pass that envvar in as one of the C_DEFINES, but that wasn’t the
question.

Phil

-----Original Message-----
From: Zygmunt Wiercioch [mailto:xxxxx@JetForm.com]
Sent: Wednesday, November 29, 2000 11:27 AM
To: NT Developers Interest List
Subject: [ntdev] RE: Sources file for multiple OS’s

A lot of MS headers use _WIN32_WINVER, but they expect you to set it. You
may define it the system environment for the machine to be 0x0500 for Win2K
and 0x0510 for Whistler. You could also run an app which set in the
environment based on results of the GetVersionEx call. Unfortunately, the
compiler will not have a built in for the OS version it is running on.

Zyg

-----Original Message-----
From: Paul Bunn [mailto:xxxxx@UltraBac.com]
Sent: November 29, 2000 13:19
To: NT Developers Interest List
Subject: [ntdev] RE: Sources file for multiple OS’s

I couldn’t figure out how to do this, so I used a kluge, by using:
!IF “$(BASEDIR)” == “h:\ddk40”
This is nasty since it’s specific to my environment, and is even case
sensitive to
the value of the envvar BASEDIR. A better solution would be to use your own
envvar (that you can control) to indicate the target OS.

Regards,

Paul Bunn, UltraBac.com, 425-644-6000
Microsoft MVP - WindowsNT/2000
http://www.ultrabac.com

-----Original Message-----
From: Nemiroff, Daniel [mailto:xxxxx@intel.com]
Sent: Wednesday, November 29, 2000 9:19 AM
To: NT Developers Interest List
Subject: [ntdev] Sources file for multiple OS’s

Is there somewhere I can get an example SOURCES file that allows conditional
compiles for different OS’s. E.g. Win2000 and Whistler.

Okay I set a TARGETPATH specific to the OS, however the build Util sets the
object root to objchk or objfre. Is there anyway to set this as well?

thanks,

Daniel

-----Original Message-----
From: Barila, Phil [mailto:xxxxx@intel.com]
Sent: Wednesday, November 29, 2000 12:35 PM
To: NT Developers Interest List
Subject: [ntdev] RE: Sources file for multiple OS’s

Paul has the right idea with an envvar. I modified the setenv.bat for all
of the DDKs I use to set a TargetOS envvar, then test that in the sources
file. You don’t have to modify the setenv.bat, if I were to do it over
again, I would probably just wrap a batch file that sets the envvar around
it. I also pass that envvar in as one of the C_DEFINES, but that wasn’t the
question.

Phil

-----Original Message-----
From: Zygmunt Wiercioch [mailto:xxxxx@JetForm.com]
Sent: Wednesday, November 29, 2000 11:27 AM
To: NT Developers Interest List
Subject: [ntdev] RE: Sources file for multiple OS’s

A lot of MS headers use _WIN32_WINVER, but they expect you to set it. You
may define it the system environment for the machine to be 0x0500 for Win2K
and 0x0510 for Whistler. You could also run an app which set in the
environment based on results of the GetVersionEx call. Unfortunately, the
compiler will not have a built in for the OS version it is running on.

Zyg

-----Original Message-----
From: Paul Bunn [mailto:xxxxx@UltraBac.com]
Sent: November 29, 2000 13:19
To: NT Developers Interest List
Subject: [ntdev] RE: Sources file for multiple OS’s

I couldn’t figure out how to do this, so I used a kluge, by using:
!IF “$(BASEDIR)” == “h:\ddk40”
This is nasty since it’s specific to my environment, and is even case
sensitive to
the value of the envvar BASEDIR. A better solution would be to use your own
envvar (that you can control) to indicate the target OS.

Regards,

Paul Bunn, UltraBac.com, 425-644-6000
Microsoft MVP - WindowsNT/2000
http://www.ultrabac.com

-----Original Message-----
From: Nemiroff, Daniel [mailto:xxxxx@intel.com]
Sent: Wednesday, November 29, 2000 9:19 AM
To: NT Developers Interest List
Subject: [ntdev] Sources file for multiple OS’s

Is there somewhere I can get an example SOURCES file that allows conditional
compiles for different OS’s. E.g. Win2000 and Whistler.


You are currently subscribed to ntdev as: xxxxx@intel.com
To unsubscribe send a blank email to $subst(‘Email.Unsub’)

A few months ago, OSR had an article on doing this in “The NT Insider”. Take
a look at Volume 6, Issue 4, “Taming the Beast: The Windows 2000 Build
Environment”. It works.

Gary

-----Original Message-----
From: Nemiroff, Daniel [mailto:xxxxx@intel.com]
Sent: Thursday, November 30, 2000 9:54 AM
To: NT Developers Interest List
Subject: [ntdev] RE: Sources file for multiple OS’s

Okay I set a TARGETPATH specific to the OS, however the build Util sets the
object root to objchk or objfre. Is there anyway to set this as well?

thanks,

Daniel

-----Original Message-----
From: Barila, Phil [mailto:xxxxx@intel.com]
Sent: Wednesday, November 29, 2000 12:35 PM
To: NT Developers Interest List
Subject: [ntdev] RE: Sources file for multiple OS’s

Paul has the right idea with an envvar. I modified the setenv.bat for all
of the DDKs I use to set a TargetOS envvar, then test that in the sources
file. You don’t have to modify the setenv.bat, if I were to do it over
again, I would probably just wrap a batch file that sets the envvar around
it. I also pass that envvar in as one of the C_DEFINES, but that wasn’t the
question.

Phil

-----Original Message-----
From: Zygmunt Wiercioch [mailto:xxxxx@JetForm.com]
Sent: Wednesday, November 29, 2000 11:27 AM
To: NT Developers Interest List
Subject: [ntdev] RE: Sources file for multiple OS’s

A lot of MS headers use _WIN32_WINVER, but they expect you to set it. You
may define it the system environment for the machine to be 0x0500 for Win2K
and 0x0510 for Whistler. You could also run an app which set in the
environment based on results of the GetVersionEx call. Unfortunately, the
compiler will not have a built in for the OS version it is running on.

Zyg

-----Original Message-----
From: Paul Bunn [mailto:xxxxx@UltraBac.com]
Sent: November 29, 2000 13:19
To: NT Developers Interest List
Subject: [ntdev] RE: Sources file for multiple OS’s

I couldn’t figure out how to do this, so I used a kluge, by using:
!IF “$(BASEDIR)” == “h:\ddk40”
This is nasty since it’s specific to my environment, and is even case
sensitive to
the value of the envvar BASEDIR. A better solution would be to use your own
envvar (that you can control) to indicate the target OS.

Regards,

Paul Bunn, UltraBac.com, 425-644-6000
Microsoft MVP - WindowsNT/2000
http://www.ultrabac.com

-----Original Message-----
From: Nemiroff, Daniel [mailto:xxxxx@intel.com]
Sent: Wednesday, November 29, 2000 9:19 AM
To: NT Developers Interest List
Subject: [ntdev] Sources file for multiple OS’s

Is there somewhere I can get an example SOURCES file that allows conditional
compiles for different OS’s. E.g. Win2000 and Whistler.


You are currently subscribed to ntdev as: xxxxx@intel.com
To unsubscribe send a blank email to $subst(‘Email.Unsub’)


You are currently subscribed to ntdev as: xxxxx@delphieng.com
To unsubscribe send a blank email to $subst(‘Email.Unsub’)

You can pretty much set and use any envvar anyway you want, but I don’t
understand what you want to accomplish by setting the object root? If you
describe what you want to do, someone here probably knows how. :slight_smile:

Phil

-----Original Message-----
From: Nemiroff, Daniel [mailto:xxxxx@intel.com]
Sent: Thursday, November 30, 2000 9:54 AM
To: NT Developers Interest List
Subject: [ntdev] RE: Sources file for multiple OS’s

Okay I set a TARGETPATH specific to the OS, however the build Util sets the
object root to objchk or objfre. Is there anyway to set this as well?

thanks,

Daniel

-----Original Message-----
From: Barila, Phil [mailto:xxxxx@intel.com]
Sent: Wednesday, November 29, 2000 12:35 PM
To: NT Developers Interest List
Subject: [ntdev] RE: Sources file for multiple OS’s

Paul has the right idea with an envvar. I modified the setenv.bat for all
of the DDKs I use to set a TargetOS envvar, then test that in the sources
file. You don’t have to modify the setenv.bat, if I were to do it over
again, I would probably just wrap a batch file that sets the envvar around
it. I also pass that envvar in as one of the C_DEFINES, but that wasn’t the
question.

Phil

-----Original Message-----
From: Zygmunt Wiercioch [mailto:xxxxx@JetForm.com]
Sent: Wednesday, November 29, 2000 11:27 AM
To: NT Developers Interest List
Subject: [ntdev] RE: Sources file for multiple OS’s

A lot of MS headers use _WIN32_WINVER, but they expect you to set it. You
may define it the system environment for the machine to be 0x0500 for Win2K
and 0x0510 for Whistler. You could also run an app which set in the
environment based on results of the GetVersionEx call. Unfortunately, the
compiler will not have a built in for the OS version it is running on.

Zyg

-----Original Message-----
From: Paul Bunn [mailto:xxxxx@UltraBac.com]
Sent: November 29, 2000 13:19
To: NT Developers Interest List
Subject: [ntdev] RE: Sources file for multiple OS’s

I couldn’t figure out how to do this, so I used a kluge, by using:
!IF “$(BASEDIR)” == “h:\ddk40”
This is nasty since it’s specific to my environment, and is even case
sensitive to
the value of the envvar BASEDIR. A better solution would be to use your own
envvar (that you can control) to indicate the target OS.

Regards,

Paul Bunn, UltraBac.com, 425-644-6000
Microsoft MVP - WindowsNT/2000
http://www.ultrabac.com

-----Original Message-----
From: Nemiroff, Daniel [mailto:xxxxx@intel.com]
Sent: Wednesday, November 29, 2000 9:19 AM
To: NT Developers Interest List
Subject: [ntdev] Sources file for multiple OS’s

Is there somewhere I can get an example SOURCES file that allows conditional
compiles for different OS’s. E.g. Win2000 and Whistler.


You are currently subscribed to ntdev as: xxxxx@intel.com
To unsubscribe send a blank email to $subst(‘Email.Unsub’)


You are currently subscribed to ntdev as: xxxxx@intel.com
To unsubscribe send a blank email to $subst(‘Email.Unsub’)