Page 1 of 1

Makefile rule

Posted: Wed Nov 11, 2015 5:20 pm
by tfAteba
Hi Giovanni,

I use vim to edit my files, so it create me backup files such as main.c~ for example.
I saw that when running the command make clean, those file are not deleted.
Can we add a rule to the makefile to do that?

Thanks,

Theo.

Re: Makefile rule

Posted: Wed Nov 11, 2015 5:59 pm
by Giovanni
Hi,

I prefer for the makefile to delete only what it generated during a build, people could want to keep their backups.

You could add a new rule fullclean to your Makefile after the inclusion of rules.mk.

Giovanni

Re: Makefile rule

Posted: Wed Nov 11, 2015 9:16 pm
by tfAteba
Hi,

Ok, I understand ;). I will do that. I will also add the rule to flash my bord, like make program. So I don't have to write it every time I want to flash my MCU.

Thanks,

Theo.

Re: Makefile rule

Posted: Thu Nov 12, 2015 8:46 pm
by barthess
@Theodore ATEBA
As Giovanni said it is not make's task. I use version control facilities for such job ("git clean -xdf" in my case).
SVN also able to clean working copy but I can not remember exact command.

Re: Makefile rule

Posted: Thu Nov 12, 2015 9:51 pm
by tfAteba
Hi Barthess,

Good alternative to the Makefile rule to clean the working directory.
I'm used to Git so I can use this possibility. I don't know SVN but don't worry ;).

Thanks for the clue.

Theo