Building a Project Outside of MPLAB® X IDE

Last modified by Microchip on 2024/06/24 06:32

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

  • Windows® 64-Bit OS - C:\Program Files\Microchip\MPLABX\vx.xx\gnuBins\GnuWin32\bin
  • Linux® 32/64 OS - /opt/microchip/mplabx/vx.xx/mplab_ide/bin
  • macOS® - /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 lineDescription
$ make cleanTo remove all intermediate objects and final images
$ makeTo create the production image (HEX file)
$ make TYPE_IMAGE=DEBUG_RUNTo create the debug image (ELF file)

If the project has more than one configuration, then:

Command – Type on a single lineDescription
$ make -f Makefile
CONF=Configuration clean
To remove all intermediate objects and final images for configuration
$ make -f Makefile
CONF=Configuration
To create the production image (HEX file) for configuration
$ make -f Makefile
CONF=Configuration TYPE_IMAGE=DEBUG_RUN
To create the debug image (ELF file) for 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.elf