building drivers using nmake

Dear All,

I want to build kernel mode drivers using a makefile. Is this procedure
documented anywhere ? I need to know what options needs to be passed to
microsoft compiler and linker for the following values of TARGETTYPE:

  • DRIVER
  • EXPORT_DRIVER
  • DRIVER_LIBRARY

Thanks,
Hassan


Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

For the NT/2K/XP DDK’s, the default environment uses build.exe which amounts
to a glorified front end to nmake. Assuming what you want to do is add
custom targets in addition to the defaults ones used by makefile.def, add
one (or more) of the following macros to your ‘sources’ file, then create a
makefile.inc in the same directory that targets/dependencies/actions you
want to occur.

; Names in <>'s should be replaced, less the ‘<’ & ‘>’, with the target
(defined in makefile.inc) you want to execute.
NTTARGETFILE0=<target_for_pass_0>
NTTARGETFILE1=<target_for_pass_1> ; Pass 1 or later
NTTARGETFILES=<target_for_pass_1> ; Pass 1 or later when using NOLIB

See the %ddkroot%\src\wdm\wmi\wmiacpi sample for an example.

Alternately, if you really need to know what exact setting makefile.def
passes to build a driver, you can either read makefile.def or build your
driver once using makefile.def and look at build[chk|fre].log to see the
command lines passed. The build options can change between releases so
using makefile.def directly is a better solution for portability.

Hope this helps

> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com]On Behalf Of Hassan I Khan
> Sent: Tuesday, July 31, 2001 22:57
> To: NT Developers Interest List
> Subject: [ntdev] building drivers using nmake
>
>
> Dear All,
>
> I want to build kernel mode drivers using a makefile. Is this procedure
> documented anywhere ? I need to know what options needs to be passed to
> microsoft compiler and linker for the following values of TARGETTYPE:
>
> - DRIVER
> - EXPORT_DRIVER
> - DRIVER_LIBRARY
>
> Thanks,
> Hassan
>
> _________________________________________________________________


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com</target_for_pass_1></target_for_pass_1></target_for_pass_0>

Use BUILD and SOURCES. Unless you really enjoy self abuse.

Gary G. Little
Staff Engineer
Broadband Storage, Inc.
xxxxx@broadstor.com

-----Original Message-----
From: Hassan I Khan [mailto:xxxxx@hotmail.com]
Sent: Tuesday, July 31, 2001 3:57 PM
To: NT Developers Interest List
Subject: [ntdev] building drivers using nmake

Dear All,

I want to build kernel mode drivers using a makefile. Is this procedure
documented anywhere ? I need to know what options needs to be passed to
microsoft compiler and linker for the following values of TARGETTYPE:

  • DRIVER
  • EXPORT_DRIVER
  • DRIVER_LIBRARY

Thanks,
Hassan


Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


You are currently subscribed to ntdev as: xxxxx@broadstor.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

I am now able to write my own makefiles which can build the drivers as good
as they are built from BUILD & SOURCES file method…mainly by looking at
buildchk.log and makefile.def files. Thanks for pointing in the right
direction.

regards,
Hassan

On 07/31/01, ““S Kupec” ” wrote:
> For the NT/2K/XP DDK’s, the default environment uses build.exe which amounts
> to a glorified front end to nmake. Assuming what you want to do is add
> custom targets in addition to the defaults ones used by makefile.def, add
> one (or more) of the following macros to your ‘sources’ file, then create a
> makefile.inc in the same directory that targets/dependencies/actions you
> want to occur.
>
> ; Names in <>'s should be replaced, less the ‘<’ & ‘>’, with the target
> (defined in makefile.inc) you want to execute.
> NTTARGETFILE0=<target_for_pass_0>
> NTTARGETFILE1=<target_for_pass_1> ; Pass 1 or later
> NTTARGETFILES=<target_for_pass_1> ; Pass 1 or later when using NOLIB
>
> See the %ddkroot%\src\wdm\wmi\wmiacpi sample for an example.
>
> Alternately, if you really need to know what exact setting makefile.def
> passes to build a driver, you can either read makefile.def or build your
> driver once using makefile.def and look at build[chk|fre].log to see the
> command lines passed. The build options can change between releases so
> using makefile.def directly is a better solution for portability.
>
> Hope this helps
>
> > -----Original Message-----
> > From: xxxxx@lists.osr.com
> > [mailto:xxxxx@lists.osr.com]On Behalf Of Hassan I Khan
> > Sent: Tuesday, July 31, 2001 22:57
> > To: NT Developers Interest List
> > Subject: [ntdev] building drivers using nmake
> >
> >
> > Dear All,
> >
> > I want to build kernel mode drivers using a makefile. Is this procedure
> > documented anywhere ? I need to know what options needs to be passed to
> > microsoft compiler and linker for the following values of TARGETTYPE:
> >
> > - DRIVER
> > - EXPORT_DRIVER
> > - DRIVER_LIBRARY
> >
> > Thanks,
> > Hassan
> >
> > _________________________________________________________________
>
>
> —
> You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com</target_for_pass_1></target_for_pass_1></target_for_pass_0>