So I thought I’d get cute and define two different paths for output files;
one for free, one for checked. (I’m using BinPlace too! Very cool.)
In a PROJECT.MK file, I have something like the following:
…
!if ($(NTDEBUG) == “” || $(NTDEBUG)=“…”) # (FREEBUILD not
defined yet)
PRJ_DBG=
!else
PRJ_DBG=d
!endif
LIBS_DIR=libs$(PRJ_DBG)
…
In the SOURCES file, I have something like the following:
TARGETNAME=mylibrary
TARGETPATH=…$(LIBS_DIR)
TARGETTYPE=DRIVER_LIBRARY
…
So the goal is to put the debug library in “…\libsd” and the release
library in “…\libs”. NMAKE handles this just fine. It tries to do just what
I wanted. However, the problem comes when the directories get created. (Who
does this? Build.exe?) No matter which version is being built, “…\libsd” is
created, which of course works fine for the Debug build, but causes the the
Release build to fail. Interestingly, if I switch the logic for PRJ_DBG
variable (so PRJ_DBG=d is first in the !if clause), only “…\libs” gets
created.
Anyway, I’m curious about this. It appears to be a bug, but I might be
missing something. To get around this, I’m using a MAKEFIL0 to create the
directory I need. Comments?
-Kevin
(I’m using the Win2K build environments from the 2003 Server DDK.)
Read the DDK documentation for the correct way to do this, especially the
“Specifying the Location of Created Files” topic. The normal process does
use the same location for the checked and free versions, and it is
lib\version\cpu. You can add a suffix to the filename for the debug version
or follow the docs and do it as you like, but your way won’t work as you
have noticed. It takes a while and sometimes you have to spend a lot of
time reading the makefile.new and other files in BASEDIR\BIN as the
DRIVER_LIBRARY is obsolete and is converted to LIBRARY by those makefiles.
“KS” wrote in message news:xxxxx@ntdev…
>
> So I thought I’d get cute and define two different paths for output files;
> one for free, one for checked. (I’m using BinPlace too! Very cool.)
>
> In a PROJECT.MK file, I have something like the following:
> …
> !if ($(NTDEBUG) == “” || $(NTDEBUG)=“…”) # (FREEBUILD
not
> defined yet)
> PRJ_DBG=
> !else
> PRJ_DBG=d
> !endif
>
> LIBS_DIR=libs$(PRJ_DBG)
> …
>
> In the SOURCES file, I have something like the following:
> TARGETNAME=mylibrary
> TARGETPATH=…$(LIBS_DIR)
> TARGETTYPE=DRIVER_LIBRARY
> …
>
> So the goal is to put the debug library in “…\libsd” and the release
> library in “…\libs”. NMAKE handles this just fine. It tries to do just
what
> I wanted. However, the problem comes when the directories get created.
(Who
> does this? Build.exe?) No matter which version is being built, “…\libsd”
is
> created, which of course works fine for the Debug build, but causes the
the
> Release build to fail. Interestingly, if I switch the logic for PRJ_DBG
> variable (so PRJ_DBG=d is first in the !if clause), only “…\libs” gets
> created.
>
> Anyway, I’m curious about this. It appears to be a bug, but I might be
> missing something. To get around this, I’m using a MAKEFIL0 to create the
> directory I need. Comments?
>
> -Kevin
> (I’m using the Win2K build environments from the 2003 Server DDK.)
>
>
>
>
>
Hmmm… So, “If it hurts when you do that, don’t do that!” 
I have read the docs and the makefiles. Nothing in either location
prohibits what I am trying to do. In fact, makefile.new will modify
TARGETPATH (if you set it to “obj”) using the same techniques I am. (Set
_OBJ_DIR=obj$(BUILD_ALT_DIR). Set TARGETPATH=$(_OBJ_DIR).)
On DRIVER_LIBRARY… MSDN July 2003 makes no mention of this type being
deprecated. I agree that DRIVER_LIBRARY becomes LIBRARY in makefile.new.
But before it does, the includes path is set… DDK_INC_PATH for
DRIVER_LIBRARY; SDK_INC_PATH for LIBRARY. After that, everything is the
same.
-KS
Read the DDK documentation for the correct way to do this, especially the
“Specifying the Location of Created Files” topic. The normal process does
use the same location for the checked and free versions, and it is
lib\version\cpu. You can add a suffix to the filename for the debug version
or follow the docs and do it as you like, but your way won’t work as you
have noticed. It takes a while and sometimes you have to spend a lot of
time reading the makefile.new and other files in BASEDIR\BIN as the
DRIVER_LIBRARY is obsolete and is converted to LIBRARY by those makefiles.
“KS” wrote in message news:xxxxx@ntdev…
> >
> > So I thought I’d get cute and define two different paths for output files;
> > one for free, one for checked. (I’m using BinPlace too! Very cool.)
> >
> > In a PROJECT.MK file, I have something like the following:
> > …
> > !if ($(NTDEBUG) == “” || $(NTDEBUG)=“…”) # (FREEBUILD
> not
> > defined yet)
> > PRJ_DBG=
> > !else
> > PRJ_DBG=d
> > !endif
> >
> > LIBS_DIR=libs$(PRJ_DBG)
> > …
> >
> > In the SOURCES file, I have something like the following:
> > TARGETNAME=mylibrary
> > TARGETPATH=…$(LIBS_DIR)
> > TARGETTYPE=DRIVER_LIBRARY
> > …
> >
> > So the goal is to put the debug library in “…\libsd” and the release
> > library in “…\libs”. NMAKE handles this just fine. It tries to do just
> what
> > I wanted. However, the problem comes when the directories get created.
> (Who
> > does this? Build.exe?) No matter which version is being built, “…\libsd”
> is
> > created, which of course works fine for the Debug build, but causes the
> the
> > Release build to fail. Interestingly, if I switch the logic for PRJ_DBG
> > variable (so PRJ_DBG=d is first in the !if clause), only “…\libs” gets
> > created.
> >
> > Anyway, I’m curious about this. It appears to be a bug, but I might be
> > missing something. To get around this, I’m using a MAKEFIL0 to create the
> > directory I need. Comments?
> >
> > -Kevin
> > (I’m using the Win2K build environments from the 2003 Server DDK.)
> >
> >
> >
> >
> >
What is wrong with a simple “#if $(FREEBUILD)”? The automatic directory
creation might, in some cases, not work for non-standard directories. Use
conditional directory creation statements in the various paths.
“Kevin Smith” wrote in message news:xxxxx@ntdev…
>
> Hmmm… So, “If it hurts when you do that, don’t do that!” 
>
> I have read the docs and the makefiles. Nothing in either location
> prohibits what I am trying to do. In fact, makefile.new will modify
> TARGETPATH (if you set it to “obj”) using the same techniques I am. (Set
> _OBJ_DIR=obj$(BUILD_ALT_DIR). Set TARGETPATH=$(_OBJ_DIR).)
>
> On DRIVER_LIBRARY… MSDN July 2003 makes no mention of this type being
> deprecated. I agree that DRIVER_LIBRARY becomes LIBRARY in makefile.new.
> But before it does, the includes path is set… DDK_INC_PATH for
> DRIVER_LIBRARY; SDK_INC_PATH for LIBRARY. After that, everything is the
> same.
>
> -KS
>
> > Read the DDK documentation for the correct way to do this, especially
the
> > “Specifying the Location of Created Files” topic. The normal process
does
> > use the same location for the checked and free versions, and it is
> > lib\version\cpu. You can add a suffix to the filename for the debug
version
> > or follow the docs and do it as you like, but your way won’t work as you
> > have noticed. It takes a while and sometimes you have to spend a lot of
> > time reading the makefile.new and other files in BASEDIR\BIN as the
> > DRIVER_LIBRARY is obsolete and is converted to LIBRARY by those
makefiles.
> >
> > “KS” wrote in message news:xxxxx@ntdev…
> > >
> > > So I thought I’d get cute and define two different paths for output
files;
> > > one for free, one for checked. (I’m using BinPlace too! Very cool.)
> > >
> > > In a PROJECT.MK file, I have something like the following:
> > > …
> > > !if ($(NTDEBUG) == “” || $(NTDEBUG)=“…”) #
(FREEBUILD
> > not
> > > defined yet)
> > > PRJ_DBG=
> > > !else
> > > PRJ_DBG=d
> > > !endif
> > >
> > > LIBS_DIR=libs$(PRJ_DBG)
> > > …
> > >
> > > In the SOURCES file, I have something like the following:
> > > TARGETNAME=mylibrary
> > > TARGETPATH=…$(LIBS_DIR)
> > > TARGETTYPE=DRIVER_LIBRARY
> > > …
> > >
> > > So the goal is to put the debug library in “…\libsd” and the release
> > > library in “…\libs”. NMAKE handles this just fine. It tries to do
just
> > what
> > > I wanted. However, the problem comes when the directories get created.
> > (Who
> > > does this? Build.exe?) No matter which version is being built,
“…\libsd”
> > is
> > > created, which of course works fine for the Debug build, but causes
the
> > the
> > > Release build to fail. Interestingly, if I switch the logic for
PRJ_DBG
> > > variable (so PRJ_DBG=d is first in the !if clause), only “…\libs”
gets
> > > created.
> > >
> > > Anyway, I’m curious about this. It appears to be a bug, but I might be
> > > missing something. To get around this, I’m using a MAKEFIL0 to create
the
> > > directory I need. Comments?
> > >
> > > -Kevin
> > > (I’m using the Win2K build environments from the 2003 Server DDK.)
> > >
> > >
> > >
> > >
> > >
>
>