Code::Blocks

Developer forums (C::B DEVELOPMENT STRICTLY!) => Plugins development => Topic started by: m00 on December 28, 2005, 07:34:10 pm

Title: An option to clean a non-project, just a file?
Post by: m00 on December 28, 2005, 07:34:10 pm
When I wanted to open or create a new file, not a project. I would like to know if it is possible to clean when I use the "Compile current file"? Clean to remove the binary and *.o files.

foo <-- delete (clean)
foo.c
foo.o <-- delete (clean)

Thanks.
Title: Re: An option to clean a non-project, just a file?
Post by: rickg22 on December 28, 2005, 07:58:38 pm
Please submit a feature request at our sourceforge page. Thank you :)
Title: Re: An option to clean a non-project, just a file?
Post by: m00 on December 28, 2005, 09:31:59 pm
Ok, it means that this feature is not in C::B yet and I will submitting a request. Thanks.
Title: Re: An option to clean a non-project, just a file?
Post by: grv575 on December 28, 2005, 10:16:36 pm
Isn't that extra clutter for the menus?

Shouldn't the default behavior of compile current file instead be changed to first remove file.o and then compile?  It's only 1 file so no gain from build management (incremental compilation) and I'm sure if file.o exists and the user hit compile they are expecting to recompile, not get a message saying project is up to date (usually).  Maybe then change the name to build current file or...?

What are people thoughts on this one (know full well this could be 'holy war' type preference but just curious about what the behavior most people agree on)?
Title: Re: An option to clean a non-project, just a file?
Post by: mandrav on December 28, 2005, 10:36:09 pm
Revision 1610 implements "Build", "Build and run", "Run", "Rebuild" and "Clean" compiler actions for single files (without project).
Title: Re: An option to clean a non-project, just a file?
Post by: m00 on December 28, 2005, 10:57:36 pm
Revision 1610 implements "Build", "Build and run", "Run", "Rebuild" and "Clean" compiler actions for single files (without project).
Your awsome, thanks!  :D
Title: Re: An option to clean a non-project, just a file?
Post by: grv575 on December 28, 2005, 11:11:26 pm
so aren't build & compile current file redundant now?
Title: Re: An option to clean a non-project, just a file?
Post by: mandrav on December 29, 2005, 01:23:49 am
so aren't build & compile current file redundant now?

No. For single files (w/o project) they behave the same, true. But for projects, "Build" builds the project while "Compile file" just compiles the active file (i.e. generates an object file from it).
Title: Re: An option to clean a non-project, just a file?
Post by: takeshi miya on December 29, 2005, 01:39:31 am
I think grv575 is refering to the case of single files (w/o project), wouldn't be wise to disable either Build or Compile file, if they do the same action (to remove redundance I suppose).
Title: Re: An option to clean a non-project, just a file?
Post by: grv575 on December 29, 2005, 02:57:01 am
Well not a big deal.  Makes the most sense as it is I think since if you disable one then the meaning of rebuild etc for a single file becomes confusing.