On Wed, 2 Jun 2010 03:16:12 -0400 Mike Frysinger <vap...@gentoo.org> wrote:
> On Monday, May 31, 2010 15:12:46 Michał Górny wrote: > > There are many simple applications which come without neither a > > sophisticated build system or even a tiny Makefile. In some cases, > > such applications aren't even packages as tarball -- a single, > > compressed source file is published instead. > > > > In case of these applications, ebuilds inherit > > toolchain-funcs.eclass to retrieve compiler information > > (tc-getCC/tc-getCXX) and call compiler manually, passing > > appropriate flags. > > use emake then and leverage make's implicit rules. The implicit make rules are less universal and -- in the fact -- pretty poor. They're strictly make-dependant, which reduces the amount of control over their behavior. In my opinion, if we should ever use such behavior, it should be rather technical implementation of the functions I'm proposing instead of inline use. POSIX (man 1p make) defines only simple rule for C files: $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< I wasn't able to find a rule for C++ files. GNU Make seems a little better but it's documentation is blurry. Although it supports both C and C++, and pretty wide set of variables, it's still less than solution proposed by me. And it's only 'de-facto standard', which isn't guaranteed to be kept unchanged in the future. Namely, advantages of my solution over directly calling emake is: 1) direct control over how compiler will be called == better portability, 2) possibility of using any output filename (with emake we'd have to rename), 3) possibility of clearly using multiple input files, 4) possibility of using any input file suffix, 5) clear separation between user-specified and ebuild-specified flags (yes, I'm aware of '+=' GNU make extension). And after all, starting a make jobserver for a single compiler process doesn't seem really useful. > sys-apps/unscd is a pretty straight forward example. In my opinion it's rather a poor example. It's the simplest case possible -- single file, no additional flags, no libs. -- Best regards, Michał Górny <http://mgorny.alt.pl> <xmpp:mgo...@jabber.ru>
signature.asc
Description: PGP signature