Search code examples
makefilemicrocontrollerpicmplabxc8

[Microchip][Mplab X IDE v5.35] Makefile-default.mk has some problem when build source


【Environment】

OS: Windows 64bit

Software: Mplab X IDE v5.35

Compiler: XC8 (v2.10)

【Step】

Menu -> Production -> Build Main Project

【phenomenon】

Build failed.

make1: *** [nbproject/Makefile-default.mk:107: build/default/production/main.p1] Error -1073741515

make2: *** [nbproject/Makefile-default.mk:91: .build-conf] Error 2

make: *** [nbproject/Makefile-impl.mk:39: .build-impl] Error 2

Here is my screen capture. mplab5.35 build failed screen

【Supplement】

In the same thing (just use [mplab X IDE v3.55]) build sucess.

Here is Makefile-default.mk

Here is Makefile-impl.mk

【Question】

What happen in mplab5.35? Must I install other library?

Thanks you!!


Solution

  • Makefiles in MPLAB can occationally have various issues between IDE version.

    See if you can regenerate your makefiles. If you look at MPLAB® X IDEUser’s Guide in Appendix "B.4 CREATING MAKEFILES OUTSIDE OF MPLAB X IDE" (DS50002027D-page 284)

    http://ww1.microchip.com/downloads/en/devicedoc/50002027d.pdf

    You can see that MPLAB X when creating a new project will call prjMakefileGenerator.bat from it's platform tool binary folder. For example in my windows system this batch file is located in C:\Program Files (x86)\Microchip\MPLABX\v5.35\mplab_platform\bin\prjMakefilesGenerator.bat, which I call in the project folder to regenerate all the makefiles except for $PROJECT_DIR/Makefile. Usually I call it as C:\Program Files (x86)\Microchip\MPLABX\v5.35\mplab_platform\bin\prjMakefilesGenerator.bat . in the project folder where . is the path (pointing to the current folder).

    This should hopefully fix most problems relating to generated makefile differences between MPLAB X IDE versions.

    B.4.2 The prjMakefilesGenerator utility is found at:

    • Windows: $inst_mplabx\mplab_ide\bin\prjMakefilesGenerator.bat
    • Linux OS: $inst_mplabx/mplab_ide/bin/prjMakefilesGenerator.sh
    • Mac OS X: $inst_mplabx/mplab_ide.app/Contents/Resources/mplab_ide/bin/prjMakefilesGenerator.sh