Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: David Brown Newsgroups: comp.lang.c Subject: Re: How to compile several C files Date: Wed, 08 Feb 2017 11:29:46 +0100 Organization: A noiseless patient Spider Lines: 58 Message-ID: References: <87a89yca76.fsf@bsb.me.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Injection-Date: Wed, 8 Feb 2017 10:27:59 -0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="aac8a8afec3dd03b3e63b75c4406aa2d"; logging-data="2630"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19e0zXAaVxvuss0U4bwhqlfL08Wc+Av5Sc=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 In-Reply-To: Cancel-Lock: sha1:8PPGR9cG+cC57gqwK+MiZEyJYiI= Xref: csiph.com comp.lang.c:103441 On 08/02/17 10:43, Ian Collins wrote: > On 02/ 8/17 10:28 PM, David Brown wrote: >> On 08/02/17 05:35, Ian Collins wrote: >>> On 02/ 8/17 04:42 AM, Richard Heathfield wrote: >>>> On 07/02/17 15:06, Ben Bacarisse wrote: >>>>> Once I have two files, I write a makefile. >>>> >>>> I'm slightly lazier than that. Once I have /one/ file, I write a >>>> makefile. >>> >>> I'm lazier still so I get my IDE to generate a makefile :) >>> >> >> My experience is that IDE's are really slow at making their makefiles. >> If you've got an Eclipse project with a few directories and a bunch of >> C, C++ and H files in them, then doing a "rebuild" after changing a >> header file means Eclipse will first grind through all the C and C++ >> files doing (approximately) "gcc -MM" to figure out the dependencies to >> generate the makefile. Then it will do the full compilation on the >> files that actually need to be re-compiled. And while "gcc -MM" is a >> good deal faster than a normal compile, it adds up when the IDE does it >> for /all/ the project files. > > One reason I prefer NetBeans to Eclipse! It generates nice, simple > makefiles without any fuss. > >> My makefile generates the dependency files when it needs to - and >> re-generates them when it needs to. So for quick re-builds after small >> changes, it is much faster than Eclipse's built-in project management. > > As do NetBeans makefiles. > >> My brief experience with MSVS was no better here. But perhaps netbeans >> or other IDEs are not as inefficient as Eclipse in this regard. > > Yep. > >> I also prefer a proper makefile because it is then independent from the >> IDE. If I need to re-open an old project (and my record is close to 20 >> years old) I have the compiler at hand, but I really hate having to >> install some ancient IDE just to do the build. It is also far easier to >> make a fix via ssh from a mobile phone when building is done my "make" >> and not "Tools | Build" in an IDE! > > With NetBeans, you can do just that. > I will maybe try it sometime. The advantage of Eclipse for me is that every microcontroller vendor uses Eclipse except Atmel AVR (which is MSVS based) and Microchip (which use NetBeans). So when I want the vendor's debugger support, register viewing, and other goodies, it is all Eclipse. (I wonder if Microchip will redo AVR Studio as NetBeans now that they own Atmel? That would be nice - anything is better than a Windows-only solution.)