automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Making _SOURCES not default to .c extension


From: Alexandre Duret-Lutz
Subject: Re: Making _SOURCES not default to .c extension
Date: Sat, 14 Jun 2003 20:57:39 +0200
User-agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3 (gnu/linux)

>>> "Ryan" == Ryan Kereliuk <address@hidden> writes:

 Ryan> When I create a list of test programs in check_PROGRAMS, automake
 Ryan> generates a rule for each entry, foo, where that entry depends on
 Ryan> foo_SOURCES which defaults to foo.c.  This is pretty good because
 Ryan> I don't have to explicitly say foo_SOURCES = foo.c for each of the
 Ryan> zillion test programs to be compiled.  I'd like it to default to
 Ryan> foo.cxx on this project, however, because everything is in C++.
 Ryan> What's the best way of accomplishing this?  It would be nicer perhaps
 Ryan> if each defaulted foo_SOURCES had a right hand side of foo.$(SRCEXT)
 Ryan> instead to let the user override $(SRCEXT) and have reasonable
 Ryan> defaults derived from AC_LANG or, as a last resort, plain .c.

I think this would be a useful feature, although I'm not sure we
can derive anything from configure.ac.  That configure.ac checks
for C++ doesn't imply all programs in the project will be in
C++.  As explained in the doc, so far the default has been left
to C for backward compatibility.

However having a variable such as SRCEXT sounds sufficient.
Such a variable could be set locally in each Makefile or
globally AC_SUBST'ed.  The important point is that Automake must
know the value of this variable when it runs, so it can output
build rules for the right language.

 Ryan> (If it turns out there's no good way to do what I want and people
 Ryan> like the idea presented, I don't mind hacking it in.)

Here is where to start:
  http://sources.redhat.com/automake/contribute.html 

-- 
Alexandre Duret-Lutz





reply via email to

[Prev in Thread] Current Thread [Next in Thread]