Building a Project Outside of MPLAB® X IDE

MPLAB® X IDE uses GNU Make as its build tool. The installation of MPLAB X IDE provides this program. The locations are:

  • Windows® 32-Bit OSC:\Program Files\Microchip\MPLABX\vx.xx\gnuBins\GnuWin32\bin
  • Windows® 64-Bit OSC:\Program Files (x86)\Microchip\MPLABX\vx.xx\gnuBins\GnuWin32\bin
  • Linux® 32/64 OS/opt/microchip/mplabx/vx.xx/mplab_ide/bin
  • Mac® OS X®/Applications/microchip/mplabx/vx.xx/mplab_ide.app/Contents/Resources/mplab_ide/bin

where vx.xx represents the version.

MPLAB X IDE automatically adds the directory containing the make to its own path variable. If you want to build outside of the IDE, you must add the directory to the PATH environmental variable.

The Makefile in the MPLAB X IDE project directory can be called directly to build the default configuration:

Command – Type on a single line Description
$ make clean To remove all intermediate objects and final images
$ make To create the production image (Hex file)
$ make TYPE_IMAGE=DEBUG_RUN To create the debug image (COF/ELF file)

If the project has more than one configuration, then:

Command – Type on a single line Description
$ make -f Makefile
CONF=Configuration clean
To remove all intermediate objects and final images for configuration Configuration
$ make -f Makefile
CONF=Configuration
To create the production image (Hex file) for configuration Configuration
$ make -f Makefile
CONF=Configuration TYPE_IMAGE=DEBUG_RUN
To create the debug image (COF/ELF file) for configuration Configuration

The names of the images by default are (with respect to the MPLAB X IDE directory):

dist/$CONF_NAME/production/$PROJ_NAME.production.hex
dist/$CONF_NAME/debug/$PROJ_NAME.debug.cof (or elf)
© 2017 Microchip Technology, Inc.
Notice: ARM and Cortex are the registered trademarks of ARM Limited in the EU and other countries.
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.