automake
[Top][All Lists]
Advanced

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

Re: "dynamic" makefile


From: Ralf Wildenhues
Subject: Re: "dynamic" makefile
Date: Thu, 30 Nov 2006 15:45:52 +0100
User-agent: Mutt/1.5.13 (2006-11-01)

* Sylvestre Ledru wrote on Thu, Nov 30, 2006 at 03:02:21PM CET:
> 
> I would like to generate a Makefile which will work with source files
> provided in the command line (parameters) instead of providing them into
> the Makefile.am.
[...]
> I would like to be able to produce this kind of line from a Makefile.am 
> but instead of providing "src/hashtable_localization.c", it will use
> parameters provided by the user. (ie $1)
> 
> I want to do this because I want to provide to the user of my
> application the possibility to edit C/fortran files, compile, link and
> load them from the application without touching configure.* or Makefile*

I don't think this is possible in general.  If the list of files the
user can choose is a subset of a pre-defined set of source file names,
you can stuff all of those in some EXTRA_foo_SOURCES variable.

Otherwise, all you can get is the inference rules.  I.e.,
  make foo.o

will look for foo.c (and maybe foo.f, foo.cpp...) and if found use the
corresponding .c.o (or .f.o, .cpp.o, ...) rule if you have enabled the
inference rule.  (Automake outputs them as soon as you list some source
file with that extension in a *_SOURCES variable; an EXTRA_*_SOURCES as
above would probably come in handy again).  But this won't get you the
benefit of dependency-tracking of included files.  And you'd still have
to write a rule for linking (but you can just write one manually and
make it depend upon a macro name which the user overrides).

Hope that helps.

Cheers,
Ralf




reply via email to

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