This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
I am doing C++ development with my own external Makefile. When netbeans uses that Makefile to build it will build a bunch of libraries, one main executable, and many regression test executables. I want to be able to right click on a single file and tell it to build just that file. Right now I can only build the entire project. How about allowing a configuration where I can say do run this: "make $(BASE_FILENAME).o" where $(BASE_FILENAME) is some predefined variable that netbeans will pass in the currently selected file. This way I could right click on the file and select build on just it. Netbeans would simply call my Makefile with "make FileName.o". I also want to be able to right click on a file that has a main in it and tell Netbeans to run that. I have many executables (regression tests). I want to select a breakpoint and then right click on a file that has a main in it and tell netbeans to debug that file.
Reassigning to cnd for further evaluation.
There are at least two more users who requested this.
It is great if it is possible to compile and run a single file in a C/C++ project. It will help if a project contains more than one executable file
*** Bug 190030 has been marked as a duplicate of this bug. ***
Also look at #190030 for some ideas of how it should be done.
would be a good addition for Studio too
I've got one more request for this on a a NetBeans forum today.
Implemented Compile and Run actions for project less files: http://hg.netbeans.org/cnd-main/rev/1b8f3293fdb5 http://hg.netbeans.org/cnd-main/rev/a772ef0a0f29
Integrated into 'main-golden', will be available in build *201205250002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/1b8f3293fdb5 User: Alexander Simon <alexvsimon@netbeans.org> Log: fixing Bug #157324 In C++ make it easy to build and run a single file.
Integrated into 'main-golden', will be available in build *201206090001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/81c446ea4f0e User: Alexander Simon <alexvsimon@netbeans.org> Log: fixing Bug #157324 In C++ make it easy to build and run a single file - disable run&debug action
Some how it is started and something is implemented, but this is not "resolved" yet. Ok, may be it is good, as there is a need to have a customizable action for a single file compile command. It may be implemented as a project/file property (with usual inheritance rules) that is defaulted to "Automatic" (means what has been implemented by Alexander), and also suggest "make %.o" option, and may be some other popular options, as well as custom command that supports certain macros for source and object files.
Just got an idea how to make the feature even more usable. So as we are told how to build the whole thing (make, scons, cmake, build.sh) at the first invocation of single file build we can suggest something meaningful and ask user for confirmation. Then we memorize what user selected and use it in subsequent runs.