Building Projects

The MPLAB X Build Process

MPLAB X uses the GNU make program to control the build process. make is a utility that decides which files need to be built and then invokes the appropriate build tool (e.g. assembler, compiler, linker) for those files and their dependencies. make determines what needs to be built based on a script-like document called a makefile which is generated by MPLAB X to describe your project to make.

Build Methods

Any time you want to build your code, debug your code, run your code, or program a target device, the make utility will be invoked. There are several ways that make can build your code, based on which one of the following methods you use to start the build process.

Build Project

Build Project is the simplest of the build methods. All it does is call make which will build any files within a project that have changed since the last build. The first time it is invoked, it will build the entire project, but subsequent builds will be much faster for larger projects. For users of MPLAB 8, this is the equivalent of doing a "Make" in "Release" mode.

Clean and Build Project

Clean and Build Project deletes any intermediate files generated by previous builds and then invokes make to rebuild all files in the project, regardless of whether or not they have changed since the last build. For users of MPLAB 8, this is the equivalent of doing a "Build All" in "Release" mode.

Debug Project

Debug Project invokes make much like Build Project, but it links in additional code required by the selected hardware debug tool (e.g. MPLAB REAL ICE, MPLAB ICD3 or MPLAB PICkit 3). After a successful build, it will automatically proceed to program the target device and run the code via the selected debugger. For users of MPLAB 8, this is equivalent to doing a "Make" in "Debug" mode, programming the target (via the tool selected in the Debugger menu) and running the program through the debug tool.

Run Project

Run Project is similar to Debug Project but it does NOT link in any debug code. It invokes make just like Build Project. Then after a successful build, it will automatically program the target device via the selected debugger or programmer and then release the target device from reset so that it begins running autonomously. No debug functions are available in this mode. For users of MPLAB 8, this is equivalent to doing a "Make" in "Release" mode, programming the target (via the tool selected in the Programmer menu) and doing a "Release from Reset".

Program Target

Program Target invokes make just like Build Project. Then after a successful build, it will automatically program the target device via the selected debugger or programmer. No debug code is linked in and no debug functions are available in this mode. For users of MPLAB 8, this is equivalent to doing a "Make" in "Release" mode and then programming the target (via the tool selected in the Programmer menu). If the device was programmed in-circuit, it will not run until disconnected from the programmer/debugger.

© 2016 Microchip Technology, Inc.
Information contained on this site regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer's risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.