Partager via


Use Custom Makefile Rules (Compact 7)

3/12/2014

Custom makefile rules can control Build.exe in ways that sources macros cannot. For instance, you can specify that actions such as copying files and running external programs occur before or after the compile phase.

One common use of custom makefile rules is to turn a compiled boot loader into a binary image file that you can download and flash to a target device. The next example demonstrates how to do this in directory Platform\SMP865x\src\bootloader\base (a MIPSII platform).

In the sources file, the WINCETARGETFILES macro calls out a makefile rule named BootImage. To avoid editing the makefile directly, specify the rule in Makefile.inc, which Makefile.def includes automatically.

For Makefile.inc in this directory, there is only one rule, which is a series of simple commands that creates the Boot.bin and Boot.sre files. This rule could just as easily copy files, delete files, or do another operation.

If you need a rule to run before the compile phase, use WINCETARGETFILE0 instead.

See Also

Concepts

Improve The Build Process