Makefile and the clean target

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Not applicable
Hello,
where can I change the Makefile template so that if the "clean" target is called also the listing files *.lst are deleted?
0 Likes
18 Replies
Not applicable
Hi,

As you know it is not supported in DAVE 3.1.10. Perhaps you can change the ‘generated’ make file and try only “clean” without build...

Best regards,
Sophia
0 Likes
Not applicable
sophia wrote:
Hi,

As you know it is not supported in DAVE 3.1.10. Perhaps you can change the ‘generated’ make file and try only “clean” without build...

Best regards,
Sophia



Even the new DAVE 4 does not really clean the project. Especially the list files are voluminous. It should be easy for your developers to change the makefile template
and send out a patch for it.
0 Likes
Not applicable
Hi,

Sorry, I don't understand what you mean "Even the new DAVE 4 does not really clean the project."?
Currently in DAVE v4, the Debug folder will be completely emptied after execution of "Clean Project".

Best regards,
Sophia
0 Likes
Not applicable
sophia wrote:
Hi,

Sorry, I don't understand what you mean "Even the new DAVE 4 does not really clean the project."?
Currently in DAVE v4, the Debug folder will be completely emptied after execution of "Clean Project".

Best regards,
Sophia


Hello Sofia
it meands exactly what it states, "DAVE 4 does not really clean the project."
If you call clean, some but not all generated files are removed

The clean target calls rm-rf specifically on *.o files , *.d files and in the project root also elf hex etc. but NOT *.lst in subdirectotries.
Do a small project with the XMC lib, call clean and looka afterwords into Release/Libraries/XMCLib/src and you will see a lot of large files.
0 Likes
Not applicable
Hi,

What type of project did you choose to create when use XMC Lib? Is it "Simple Main project"?

Best regards,
Sophia
0 Likes
User8819
Level 4
Level 4
Hi Heinz,

try to put clean rule in "makefile.targets" file which should be located in project folder.

rum
0 Likes
Not applicable
sophia wrote:
Hi,

What type of project did you choose to create when use XMC Lib? Is it "Simple Main project"?

Best regards,
Sophia


Yes, it is
0 Likes
Not applicable
rum wrote:
Hi Heinz,

try to put clean rule in "makefile.targets" file which should be located in project folder.

rum


sorry, I can not find the file makefile.targets

I see that in makefile the line
-include ../makefile.targets
loads this file, but can not find it.

And if, can I change it?
0 Likes
User8819
Level 4
Level 4
ciao Heinz form CAN,

you must create this file ! Better, create also "makefile.defs" and put your clean rule there.

rum
0 Likes
Not applicable
Heinz wrote:
Yes, it is


Hi,

If you use the Simple Main project type, both Debug and Release folder will be emptied after executing Clean Project command.

Best regards,
Sophia
0 Likes
Not applicable
rum wrote:
ciao Heinz form CAN,

you must create this file ! Better, create also "makefile.defs" and put your clean rule there.

rum



I wrote a new file makefile.targets with a "clean:" target. And indeed it is called instead of the default "clean" target.
Is there a way to extend the default "clean"
like

clean: oldclean
rm dir/files*.lst

Where did you got the information about makefile.targets and makefiles.def from?
0 Likes
Not applicable
rum wrote:
ciao Heinz form CAN,

you must create this file ! Better, create also "makefile.defs" and put your clean rule there.

rum


I did, now the clean rule in this file is called, but not the old "standard" target clean:
Do you know how I can extend the standard clean, that mean executing the old rules and add new rules?

Where did you get the information about all the files from? Is there any information on the Infineon web site, or is it a common Eclipse make behavior?
0 Likes
Not applicable
sophia wrote:
Hi,

If you use the Simple Main project type, both Debug and Release folder will be emptied after executing Clean Project command.

Best regards,
Sophia



I disagree Sophia
0 Likes
User8819
Level 4
Level 4
Hi Heinz,

It is eclipse. You can add your own rules in "init, defs, targets". Write your own clean and put there what you need. Inside Project properties, C/C++ buid, behavior you can configure what gets called by make.

There may be more all: rules, this is I tested. Maybe there can be also more clean: rules, but I am not sure about this.

rum
0 Likes
Not applicable
Thank you rum
0 Likes
Not applicable
Heinz wrote:
I disagree Sophia


Hi,

It is what I see. I don't know why you have seen differently?
To make sure we are in the same page, would you pls provide a snapshot of your project Debug and Release folders before and after executing Clean Project command?

Best regards,
Sophia
0 Likes
lock attach
Attachments are accessible only for community members.
Not applicable
@Sophia
I Did it only for the Debug directory

By the way, the files Upload program does not accept a file without an file name extension.
I had to rename files_after_clean to files_after_clean.txt
Is this a feature?
0 Likes
Not applicable
Wouldn't it not be easier to remove the whole Debug directory in case of cleaning the "Debug Build Configuration" ?

Heinz
0 Likes