Building the driver using makefile instead of build utility

I am building the driver for VISTA. I am using the WDK 6000.
I wish to use the make frame work for compiling instead of the build utility. ( I will not open the checked/free build environment. I will open a new command prompt and issue the make in it.)

The binary files build using the build -cef utility and the one built by make frame work DIFFER but their sizes are the same.

I have set the paths appropriately required for the DDK to compile by the makefile.

I checked the log file generated during the building using the build environment (ex:buildchk_wlh_x86.log). I have placed the same build options in my makefile.

I have kept the same compilation flags and linked the same files as done in the build utility

But still the binaries generated differ in content. My aim is to ensure that the binaries generated using the makefile and the build utility need to be same except for the time stamp.

Will there be any other options apart from the one present in the build log file.

Your comments would be of great help.

Regards,
Sudhakar

Why do you think you want to do this? Msft supports building a driver only with build, not with any other way. Are you trying to build in VS without using wdkbuild.bat?

d

Sent from my phone with no t9, all spilling mistakes are not intentional.

-----Original Message-----
From: xxxxx@yahoo.co.in
Sent: Thursday, June 11, 2009 12:14 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Building the driver using makefile instead of build utility

I am building the driver for VISTA. I am using the WDK 6000.
I wish to use the make frame work for compiling instead of the build utility. ( I will not open the checked/free build environment. I will open a new command prompt and issue the make in it.)

The binary files build using the build -cef utility and the one built by make frame work DIFFER but their sizes are the same.

I have set the paths appropriately required for the DDK to compile by the makefile.

I checked the log file generated during the building using the build environment (ex:buildchk_wlh_x86.log). I have placed the same build options in my makefile.

I have kept the same compilation flags and linked the same files as done in the build utility

But still the binaries generated differ in content. My aim is to ensure that the binaries generated using the makefile and the build utility need to be same except for the time stamp.

Will there be any other options apart from the one present in the build log file.

Your comments would be of great help.

Regards,
Sudhakar


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Thanks Holan… I am using the WDK build only. Not the VS. Our intention is to generalise the build process. We just copy the entire the librariies and the files related to the DDK in a single location( the ones that are obtained after installation). We wish to make the end user free from opening the windows checked/free build prompt. By this the end user will be unaware of the DDK. We will have a batch file which well tell the paths of the DDK. We will untlimately use the nmake of the build only. But we are not very clear on the arguments that need to be given it. By exploring the build log file i found few of them and used them. By doing that i was successful in generating the sys file of the same size as generated using the standard build command prompt. But the ontents in it were differening. Please help me by providing some info on the compilation flags and the link flags associated with the build -cef command.

Regards,
Sudhakar

>Please help me by providing some info on the compilation flags and the link flags associated with the build -cef command.

Sorry, but No. You use build, you do not reverse engineer build and duplicate it in your own env. If you don’t want a new window, run setenv.bat on the cmd line. Wrap it in a cmd file that uses setlocal/endlocal around the call to setenv.bat and you can probably rig something that undoes everything on exit from the bat file

d

Sent from my phone with no t9, all spilling mistakes are not intentional.

-----Original Message-----
From: xxxxx@yahoo.co.in
Sent: Thursday, June 11, 2009 3:04 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Building the driver using makefile instead of build utility

Thanks Holan… I am using the WDK build only. Not the VS. Our intention is to generalise the build process. We just copy the entire the librariies and the files related to the DDK in a single location( the ones that are obtained after installation). We wish to make the end user free from opening the windows checked/free build prompt. By this the end user will be unaware of the DDK. We will have a batch file which well tell the paths of the DDK. We will untlimately use the nmake of the build only. But we are not very clear on the arguments that need to be given it. By exploring the build log file i found few of them and used them. By doing that i was successful in generating the sys file of the same size as generated using the standard build command prompt. But the ontents in it were differening. Please help me by providing some info on the compilation flags and the link flags associated with the build -cef command.

Regards,
Sudhakar


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

xxxxx@yahoo.co.in wrote:

Thanks Holan… I am using the WDK build only. Not the VS. Our intention is to generalise the build process. We just copy the entire the librariies and the files related to the DDK in a single location( the ones that are obtained after installation). We wish to make the end user free from opening the windows checked/free build prompt. By this the end user will be unaware of the DDK. We will have a batch file which well tell the paths of the DDK. We will untlimately use the nmake of the build only. But we are not very clear on the arguments that need to be given it. By exploring the build log file i found few of them and used them. By doing that i was successful in generating the sys file of the same size as generated using the standard build command prompt. But the ontents in it were differening. Please help me by providing some info on the compilation flags and the link flags associated with the build -cef command.

Regards,
Sudhakar

Try the .cmd file below. Put it in the same directory with your SOURCES.
When you click on it, it will open a cmd window where you can type “make”.
Hope this helps.

– pa

-------------- begin ---- cut here ------
:: Replacement for WDK buld env shortcuts
:: Opens interactive cmd box for WDK build.
:: This is *not* intended to run from Visual Studio etc.
@echo off
@IF NOT CMDEXTVERSION 2 EXIT

: *** SET THIS TO YOUR WDK PATH ***
set BASEDIR=%SystemDrive%\winDDK\7100.0.0

:: *** Choose where to start
set _a_workdir=%~dp0
:-or- set _a_workdir=%cd%

if NOT exist %BASEDIR%\bin\setenv.bat (
@echo ERROR: bad WDK path! & goto :ERR
)

:: ++ Prompt user for target OS and checked/free:

:RTEQ
@ECHO What do you want to build today?
@ECHO 0=2k 1=WXP 2=WNET 3=WLH 4=Win7 5=WNET/x64 6=WLH/x64 7=Win7/x64
SET /P _a_n=Target OS?
if %_a_n% LEQ 7 goto :RTE%_a_n%
goto :RTEQ

:RTE0
set _a_targetenv=W2K
goto :RTEN

:RTE1
set _a_targetenv=WXP
goto :RTEN
:RTE2
set _a_targetenv=WNET
goto :RTEN
:RTE3
set _a_targetenv=WLH
goto :RTEN
:RTE4
set _a_targetenv=WIN7
:RTE5
set _a_targetenv=WNET x64
goto :RTEN
:RTE6
set _a_targetenv=WLH x64
goto :RTEN
:RTE7
set _a_targetenv=WIN7 x64
goto :RTEN
:RTEN

:CF0
SET /P _a_n=Checked(1) or Free(2)?
if %_a_n% LEQ 2 goto :CF%_a_n%
goto :CF0
:CF1
set _a_chkfre=chk
goto :CFN
:CF2
set _a_chkfre=fre
:CFN

PATH %windir%\system32;%windir%;%windir%\system32\wbem;
set VS_UNICODE_OUTPUT=

if exist %BASEDIR%\bin\OACR* set _a_no_oacr=NO_OACR

call %BASEDIR%\bin\setenv.bat %BASEDIR%\ %_a_chkfre% %_a_targetenv%
%_a_no_oacr%

if NOT “%_a_workdir%” == “” cd /d %_a_workdir%

::**************************************************
:: TODO add here your env tweaks
::**************************************************

: Define some handy commands:
doskey clean=@if exist clean.bat ( call clean.bat ) else ( nmake clean )
doskey make=build -webzg
doskey remake=build -cwebzg
doskey log=notepad.exe build%BUILD_ALT_DIR%.log

:: Now spawning another cmd for interactive box:
@%comspec%
exit /B

@rem Errors arrive here:
:ERR
pause Hit enter to continue…
goto :EOF
---------------end ---- cut here --------

Thanks for the information. I need to use GNU make instead of nmake. the “cl.exe” and the “link.exe” bear the same version as present in the DDK. the cl.exe is used for compilation and link.exe is used for the linking.

Based on the above conversation i understand that i need to use only the build and not the GNU make or any other means.

Can you please help me by clarifying what kind of impact does it impose. I am able to build a driver using the GNU make. Does the driver binary have any issues on usage. Please bear my innocence and help me.

Please help

Use GNU make to invoke BUILD. I had a customer who tried GNU make directly,
after a ton of bugs the development team all threatened to quit, they
changed to invoking build from GNU and removed over half the bugs in the
tracking system in one effort.


Don Burn (MVP, Windows DDK)
Windows Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr

wrote in message news:xxxxx@ntdev…
> Thanks for the information. I need to use GNU make instead of nmake. the
> “cl.exe” and the “link.exe” bear the same version as present in the DDK.
> the cl.exe is used for compilation and link.exe is used for the linking.
>
> Based on the above conversation i understand that i need to use only the
> build and not the GNU make or any other means.
>
> Can you please help me by clarifying what kind of impact does it impose. I
> am able to build a driver using the GNU make. Does the driver binary have
> any issues on usage. Please bear my innocence and help me.
>
> Please help
>
>
> Information from ESET NOD32 Antivirus, version of virus
> signature database 4148 (20090611)

>
> The message was checked by ESET NOD32 Antivirus.
>
> http://www.eset.com
>
>
>

Information from ESET NOD32 Antivirus, version of virus signature database 4148 (20090611)

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com

We only testing building and certifying drivers built with build.exe. nothing else. As soon as you move into your own build/makefile/whatever and encounter an issue (at build time, runtime, whatever), Microsoft PSS cannot help you. Furthermore, you are snapshotting the results of what directives happened to be in your sources file at the time. Let’s say you add a new directive (NATIVE_EH=1) to sources. If you used build, you just build -cz and you are done. In your system, you have to reexamine the entire build log and find all of the (perhaps) subtle changes that occurred b/c of the new directive. Basically, you are frozen in time and featuers and it can become very difficult to change in the future, or migrate to a new wdk and understand what new compilation flags you might be missing.

d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@yahoo.co.in
Sent: Thursday, June 11, 2009 7:05 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Building the driver using makefile instead of build utility

Thanks for the information. I need to use GNU make instead of nmake. the “cl.exe” and the “link.exe” bear the same version as present in the DDK. the cl.exe is used for compilation and link.exe is used for the linking.

Based on the above conversation i understand that i need to use only the build and not the GNU make or any other means.

Can you please help me by clarifying what kind of impact does it impose. I am able to build a driver using the GNU make. Does the driver binary have any issues on usage. Please bear my innocence and help me.

Please help


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

I have successfully used GNU make to build drivers. As long as you point
$CC and $LD (and some others!) to inside DDK (like you mentioned), it
works out fine.

You have to be careful about a few things like ->

  1. to get the right version of make that can handle windows paths.
  2. setup the env correctly. Look for all envs that are set by
    setenv*.bat in DDK.

I did not see any issue with the driver built this way.
Harish
PS I do NOT prefer this approach but If required, it can be made to
work.

-----Original Message-----
From: xxxxx@yahoo.co.in [mailto:xxxxx@yahoo.co.in]
Sent: Thursday, June 11, 2009 7:05 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Building the driver using makefile instead of build
utility

Thanks for the information. I need to use GNU make instead of nmake.
the “cl.exe” and the “link.exe” bear the same version as present in the
DDK. the cl.exe is used for compilation and link.exe is used for the
linking.

Based on the above conversation i understand that i need to use only the
build and not the GNU make or any other means.

Can you please help me by clarifying what kind of impact does it impose.
I am able to build a driver using the GNU make. Does the driver binary
have any issues on usage. Please bear my innocence and help me.

Please help


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

“Please help”??? There really is no help.

This issue has been discussed thousands of times in the past on the board,
always with the same recommendation … USE BUILD. PERIOD. The only
deviation to that is to create a makefile project in Visual Studio and then
use one of two BAT files; either DDKBUILD.BAT from Hollistech.com or
DDKBUILD.BAT from OsrOnline.com. Either one of those will call BUILD
however, so you stay with in the guidelines for creating an acceptable sys
file. And incase you do end up suspecting a build as having caused a problem
it is super easy to go back to the blessed WDK build environments and
compare notes, and most likely find the problem.

Rolling your own makefile so you can follow some hairbrained idea that moves
you away from acceptable standards leaves you dangling on a precipice, with
only yourself for assistance.

BUILD works. GNU make doesn’t.

The personal opinion of
Gary G. Little

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Doron Holan
Sent: Thursday, June 11, 2009 11:01 AM
To: Windows System Software Devs Interest List
Subject: RE: RE:[ntdev] Building the driver using makefile instead of build
utility

We only testing building and certifying drivers built with build.exe.
nothing else. As soon as you move into your own build/makefile/whatever and
encounter an issue (at build time, runtime, whatever), Microsoft PSS cannot
help you. Furthermore, you are snapshotting the results of what directives
happened to be in your sources file at the time. Let’s say you add a new
directive (NATIVE_EH=1) to sources. If you used build, you just build -cz
and you are done. In your system, you have to reexamine the entire build
log and find all of the (perhaps) subtle changes that occurred b/c of the
new directive. Basically, you are frozen in time and featuers and it can
become very difficult to change in the future, or migrate to a new wdk and
understand what new compilation flags you might be missing.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@yahoo.co.in
Sent: Thursday, June 11, 2009 7:05 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Building the driver using makefile instead of build
utility

Thanks for the information. I need to use GNU make instead of nmake. the
“cl.exe” and the “link.exe” bear the same version as present in the DDK. the
cl.exe is used for compilation and link.exe is used for the linking.

Based on the above conversation i understand that i need to use only the
build and not the GNU make or any other means.

Can you please help me by clarifying what kind of impact does it impose. I
am able to build a driver using the GNU make. Does the driver binary have
any issues on usage. Please bear my innocence and help me.

Please help


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

Arora, Harish wrote:

I have successfully used GNU make to build drivers. As long as you point
$CC and $LD (and some others!) to inside DDK (like you mentioned), it
works out fine.

Been there several times.
Last time did this exercise for one extremely linux-minded team.
So it is definitely possible, and GNU tools have their advantages,
but - as others have replied - 100% unsupported and not worth the effort.

Good luck studying the WDK build system.

– pa

Given that you have found your way to this newsgroup, you don’t want to do this. The reason I say this is that you be assured that you will not receive help from anyone here in the future on this subject, including from people such as myself who don’t generally use BUILD. Once you go outside of the BUILD system, it just opens up too much vagueness to make it seem profitable to offer help.

Good luck,

mm