Share via


Sources Macros (Compact 2013)

3/26/2014

A sources file is a text file that sets macro definitions to direct the compiling and linking operations of the Build Tool (Build.exe). This topic describes some of the more common macros that developers use. You can find the full list of sources macros in Sources File.

Output File Macros

These macros describe the output files to create. They provide file names, types, locations, and other information.

  • TARGETTYPE — Type of binary file to build. Common values are DYNLINK (for .dll files), PROGRAM (for .exe files), LIBRARY (for .lib files), and NOTARGET (for special sources files that do not produce an output binary).
  • TARGETNAME — Name of the .dll, .exe, or .lib file to build.
  • EXEENTRY or DllMain — Name of the function that is used as an entry point for an .exe or .dll file.
  • RELEASETYPE — Output directory in which to place the binaries and libraries.

Input File Macros

These macros describe the inputs, including sources and libraries, for the compiling and linking activities.

  • DEFFILE — Name of the module definition file for .dll files.
  • SOURCES — List of source code files that are processed during the build to become the contents of a .lib file or .dll file.
  • TARGETLIBS — List of libraries to search for code references. Typically, you use this macro when you create a .dll or .exe file.
  • SOURCELIBS — List of libraries whose object code is included in its entirety. Typically, you use this macro when you create a static .lib file and specify .lib files to link with the module specified in TARGETNAME.

Compiler and Linker Control Macros

The following macros control the operation of the compiler and linker.

  • CDEFINES / ADEFINES — Macros passed as #defines to the compiler and assembler, respectively.
  • INCLUDES — Include path to search for the header files that the source files include.

Synchronization Macros

Synchronization macros are useful in the multithreaded build environment, which build.exe uses by default. When build.exe runs, these macros ensure that modules with dependencies are not built until those dependencies are satisfied. Build.exe generally handles dependencies properly, but if you use special makefile rules, these macros might be necessary.

  • LINK_PRODUCES — Instructs build.exe to build this directory before it builds any directories that contain the corresponding LINK_CONSUMES macro.
  • LINK_CONSUMES: Instructs build.exe to build this directory after it builds the directory that contains the corresponding LINK_PRODUCES macro.

Makefile Rules Macros

The following macros contain makefile rules.

  • WINCETARGETFILE0 — Specifies extra makefile rules to run once before all build passes (not once per pass).
  • WINCETARGETFILES — Specifies extra makefile rules to run once after the link pass (not once per pass).

See Also

Concepts

Compile and Link with the Build Tool
A Build Example