Makefile & Source

Source: Internet
Author: User

When compiling a WDM program, two files are required:
Makefile
(What is this? You may ask .) For younger programmers, you may not have seen this file. In fact, before the emergence of the vc ide, we must use makefile to determine which files in the project need to be re-compiled. The current ide has automatically completed this job.
The job we need to do is to provide such a file with the following content:

  1. #
  2. # Do not edit this file !!! Edit./sources. If you want to add a new source
  3. # File to this component. This file merely indirects to the real make File
  4. # That is shared by all the driver components of the Windows NT DDK
  5. #
  6. ! Include $ (ntmakeenv)/makefile. Def

 

As it said, Do not edit this file. In fact, the makefile content required by each WDM program is the same, that is, we only need to simply copy a makefile to a new project.

Sources

  1. Targetname = hellowdm // name of the compiled driver
  2. Targettype = driver // The compilation type is driver compilation.
  3. Drivertype = WDM // The driver type is WDM.
  4. Targetpath = OBJ // The generated file is stored in the OBJ directory.
  5. Required des = $ (basedir)/INC; // This is the header file to be introduced.
  6. $ (Basedir)/INC/DDK ;/
  7. Targetlibs = $ (basedir)/lib/*/free/usbd. Lib // This is the library file to be introduced.
  8. Sources = hellowdm. cpp // This is the source code file

 

This file specifies that the target name of the driver is hellowdm. SYS. It is a WDM driver and the generated file is stored in the OBJ directory. It is worth noting that there cannot be spaces before and after "=", otherwise there will be errors during compilation.

 

1. Generation of "debug"
First, assume that your source code is stored in D:/hellowdm. Follow these steps:

Start> program> Development Kits> Windows 2000 DDK> checked Build Environment"
2. Generate "release"
Follow these steps:

Start> program> Development Kits> Windows 2000 DDK> Free Build Environment"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.