Using DDKBUILD can be boring at times ... (download)

Hi all,

when I took the OSR seminars in October 2005, I was introduced to DDKBUILD.
Surely I had already heard of it, but I mean why use it if you are anyways
building your stuff from command line. But after Mark explained all the
advantages and how nice it was to have your driver project in your solution
without toggling between command line and VS/VC IDE I got curious.

Now, in the very same week I started a Perl project which was going to be
the foundation of all my future driver projects - this was because
developers usually tend to do things in a general way, while the specific
solution would only take 2 minutes - and I simply was tired of setting up my
project manually after setting up my first test project :stuck_out_tongue:

This script grew since then and is now as good as I wanted it to be. This is
why I want to donate it to the public domain. The script is quite simple and
fully self-contained. It first checks the command line parameters. As the
first parameter it expects a project name (letters, digits, underscore) and
a path as the second parameter. If the path does not exist it is being
created!
After this it reads all the contents from its part and extracts the
textual and the binary files into an array …

STOP … binary files? In a script? Sure! I’ve put a small (1kB) EXE file
into it which is UU-encoded. This file does nothing more than create a GUID,
convert it to its textual form and output it on the command line.
The program has been published under BSD license yesterday.

… the script then executes this binary and grabs the GUID to fit it into
the VC .NET 2003 project file (XML-based). Despite the GUID the script also
substitutes some place holders with the project name, current year and
current date. As I said it is very simple.

After all that substitution work is done, the script will finally write the
files into the target directory given on the command line. Note, that it
overwrites any existing files (if any). This can be dangerous at times, but
a warning should suffice.

The following files will be created (or overwritten):
.c (file with DriverEntry)
.h (header for the .c module)
.vcproj (project file)
drvcommon.h (some macros to make life easier)
drvversion.h (version header)
drvversion.rc (version resource script, depends on drvversion.h)
makefile (the mandatory makefile)
sources (the sources file, don’t forget to edit it!)

The project compiles right away when opened. It provides a very simple
skeleton for a driver.

Since I expect Perl to be on any developers machine, I think you would like
to give it a try (find the download link below).
http://assarbad.net/stuff/!export/create_proj.rar (~5kB)

Prerequisites: A DDKBUILD-compatible DDK and the %BASEDIR% variable set.
Limitation: only creates VC .NET 2003 project files.

Dedicated to all the lazy programmers (such as me) :stuck_out_tongue_winking_eye:

Enjoy,

Oliver

BTW: If one of the list members has a license of perl2exe and is willing to
convert the script to an executable, please ping me off-list.