Makefile Creation

Makefiles are created by the MPLAB® X IDE as needed when compiler options change or when files are added or removed. In addition, the Makefiles can be created outside of the IDE using the utility prjMakefilesGenerator. This utility is a batch file (for Windows® OS) or a shell script (for Linux® OS and Mac® OS X®). This utility allows you to recreate the Makefiles using the same information the IDE uses which is stored in the $PROJECT_DIR/nbproject/configurations.xml file for a given MPLAB X IDE project. The first section explains how to create the Makefiles outside of the IDE. Then the rest of the document describes how to modify the behavior of the Makefiles without having to regenerate them for further customization. This latter section of the document applies to the Makefiles created by the IDE or by prjMakefilesGenerator (which should be identical).

The main Makefile file is called $PROJECT_DIR/Makefile. It is created when the IDE creates the project and can be modified by the user. There are some targets such as .build-pre, that can be implemented by the user. This file is never regenerated. The rest of the Makefiles are all regenerated by the IDE or prjMakefilesGenerator. They are of the format: $PROJECT_DIR/nbproject/Makefile*.mk

We recommend that you do not commit these nbproject/Makefile* files into revision control. Instead use the IDE or prjMakefilesGenerator to reproduce them as needed. For more information, see Version Control.

© 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.