How to Clean a project with Multiple configuration at once...

Author
ec_nisarg
New Member
  • Total Posts : 25
  • Reward points : 0
  • Joined: 2012/03/13 01:57:51
  • Location: 0
  • Status: offline
2019/01/10 22:12:03 (permalink)
0

How to Clean a project with Multiple configuration at once...

Hi all,
I have a Project which have 7 configuration in it.
I can clean each separately by selecting each configuration as active.
Is there any way to clean all configuration at once?
 
I know that we used to run a bat file in MPLAB 8. is there such a way with MPLAB X too?
#1

5 Replies Related Threads

    Ken_Pergola
    Super Member
    • Total Posts : 2140
    • Reward points : 0
    • Joined: 2003/11/07 12:48:48
    • Status: offline
    Re: How to Clean a project with Multiple configuration at once... 2019/01/11 00:03:13 (permalink)
    +2 (2)
    ec_nisarg
    ...Is there any way to clean all configuration at once?...



    Hello Ec_nisarg,
     
    This should do the trick for you:
     
    From MPLAB X IDE User's Guide:
    To remove all target files for all configurations
    1. Change directory to $PROJECT_DIR.
    2. make clobber
     
    The nice thing about it is it's a "hammer". If the number of MPLAB X IDE project configurations grows or shrinks over the lifecycle of your project the 'make clobber' will take care of them all in one fell swoop.
     
    Here is an example on a Windows 10 machine:
     

     
    c:\USB_Boot\usb_boot.X>"c:\Program Files (x86)\Microchip\MPLABX\v5.10\gnuBins\GnuWin32\bin"\make clobber
    c:/Program Files (x86)/Microchip/MPLABX/v5.10/gnuBins/GnuWin32/bin/make SUBPROJECTS= CONF=default clean
    make[1]: Entering directory 'c:/USB_Boot/usb_boot.X'
    c:/Program Files (x86)/Microchip/MPLABX/v5.10/gnuBins/GnuWin32/bin/make -f nbproject/Makefile-default.mk SUBPROJECTS= .clean-conf
    make[2]: Entering directory 'c:/USB_Boot/usb_boot.X'
    rm -f  -r build/default
    rm -f  -r dist/default
    make[2]: Leaving directory 'c:/USB_Boot/usb_boot.X'
    make[1]: Leaving directory 'c:/USB_Boot/usb_boot.X'

    c:\USB_Boot\usb_boot.X>
     
     

     
    In the above example, after I changed the directory to the MPLAB X IDE project folder I executed this single line at the command prompt:
     
    "c:\Program Files (x86)\Microchip\MPLABX\v5.10\gnuBins\GnuWin32\bin\make" clobber

     
     
     
    Best regards,
     
    Ken
     
     
     
     
     
    post edited by Ken_Pergola - 2019/01/11 00:07:45
    #2
    Ken_Pergola
    Super Member
    • Total Posts : 2140
    • Reward points : 0
    • Joined: 2003/11/07 12:48:48
    • Status: offline
    Re: How to Clean a project with Multiple configuration at once... 2019/01/11 00:55:14 (permalink)
    +1 (1)
    - If the generated make files are missing you will need to regenerate them before invoking 'make clobber'.
    - This example will regenerate the make files for all project configurations
     
    Here's a starting point to play with:
    - Check the MPLAB X IDE User's Guide for more details.
    - You can automate building all your configurations outside of MPLAB X IDE -- when it is shut down -- just needs to be installed on you system.
     
    @echo off
    setlocal

    REM Your personal settings:
     
    REM ==================================
     
    set MPLAB_X_IDE_VERSION=v5.10
    set PATH_TO_MPLAB_X_PROJECT_NAME="C:\USB_Boot\usb_boot.X"
     
    REM ==================================
     

    set Path=%ProgramFiles(x86)%\Microchip\MPLABX\%MPLAB_X_IDE_VERSION%\gnuBins\GnuWin32\bin;%ProgramFiles(x86)%\Microchip\MPLABX\%MPLAB_X_IDE_VERSION%\mplab_platform\bin;%PATH%

    echo.
    echo Regenerating MPLAB X IDE project make files ...
    echo.

    CALL prjMakeFilesGenerator.bat -v %PATH_TO_MPLAB_X_PROJECT_NAME%

    IF %ERRORLEVEL% NEQ 0 (
        echo Regeneration of make files failed.
    ) ELSE (
        echo Regeneration of make files was successful.
    )

    echo.
    echo Attempting 'make clobber' ...
    make clobber

    IF %ERRORLEVEL% NEQ 0 (
        echo.
        echo Clobber failed.
    ) ELSE (
        echo.
        echo Clobber was successful.
    )

    #3
    Jim Nickerson
    User 452
    • Total Posts : 5680
    • Reward points : 0
    • Joined: 2003/11/07 12:35:10
    • Location: San Diego, CA
    • Status: online
    Re: How to Clean a project with Multiple configuration at once... 2019/01/11 07:58:38 (permalink)
    +1 (1)
    In MpLab X 5.10 I make use of Production, Batch Build Main Project … 
    I tick the configurations I want and click clean
    Or do I misunderstand the problem ?
    #4
    Ken_Pergola
    Super Member
    • Total Posts : 2140
    • Reward points : 0
    • Joined: 2003/11/07 12:48:48
    • Status: offline
    Re: How to Clean a project with Multiple configuration at once... 2019/01/12 14:20:46 (permalink)
    +1 (1)
    JANickerson
    ...Or do I misunderstand the problem ?...



    Hi Jim,
     
    No it was me that created the confusion -- I "fell asleep at the wheel" and totally forgot about the MPLAB X IDE GUI option to do this as you have mentioned. Thank you for chiming in and contributing -- appreciated!
     
    @ec_nisarg,
    So you have two options on the table:
    1) The way to accomplish this with MPLAB X IDE itself (as Jim Nickerson previously mentioned) which has been available in MPLAB X IDE for ages.
     
    2) The way to accomplish this outside of MPLAB X IDE with on any PC OS using scripts.
     
    Best regards,
     
    Ken
    #5
    Jim Nickerson
    User 452
    • Total Posts : 5680
    • Reward points : 0
    • Joined: 2003/11/07 12:35:10
    • Location: San Diego, CA
    • Status: online
    Re: How to Clean a project with Multiple configuration at once... 2019/01/13 09:03:22 (permalink)
    0
    Ken,
    I do like your script
    #6
    Jump to:
    © 2019 APG vNext Commercial Version 4.5