# MPLAB X IDE code clean & build

#### cmartinez

Joined Jan 17, 2007
7,764
I've been working with MPLAB X IDE v5.35 for a while now, and have finally gotten used to its, let's say unusual, environment.

I haven't upgraded it to a more recent version because this was the last version that includes the MPASM assembler. I intend to eventually upgrade to the new assembler in the near future, but that's another story.

Anyway, I have two questions:
1. What's the difference between "building" a project, and "cleaning and building" it? ... and I mean other than hygienic.
2. I'm having some trouble debugging a subroutine that is supposed to match a string received through the serial port (and stored in ram) against one received through the UART. Is there a way to simulate the procedure?

#### Ya’akov

Joined Jan 27, 2019
6,263
“Clean“ is like “make clean” when using a makefile. It removes all the output from a previous build so it won’t reuse files that were generated by it.

Sorry to say I can be of no help on your second question.

#### atferrari

Joined Jan 6, 2004
4,647
For each micro you should check what peripheral may be simulated. I never did peripheral simulations.

MCHP insists on doing "simulations" on real hardware situation.

#### nsaspook

Joined Aug 27, 2009
10,104
Make and makefiles are extremely useful in larger software projects with lots of files. I often keep individual function build dates embedded (during the build process that uses 'Make') in the C headers for various device modules used in a project to track software modifications.

C:
// main.c
static const char *build_date = __DATE__, *build_time = __TIME__;

// bmx160.c
static const char *build_date = __DATE__, *build_time = __TIME__;
// code
void bmx160_version(void)
{
printf("\r--- BMX160 Driver Version  %s %s %s ---\r\n", BMX160_DRIVER, build_date, build_time);
}

// mcp2210.c
static const char *build_date = __DATE__, *build_time = __TIME__;
Each data-time is a static const var that gets set during that source file recompile.

Just Build:

Build Clean:

Last edited:

#### MIS42N

Joined Jan 25, 2013
20
Some PIC processors, compile for debugging, program the processor with say a PICkit3, then run the code on the processor in real time with check points, memory maps, etc. I didn't know how to get the right timing for UARTS in the simulator, then I found I could do it live so didn't look further.