[Top][All Lists]

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

Re: how to make _DEPENDENCIES appear earlier in prerequisite

From: n.g.
Subject: Re: how to make _DEPENDENCIES appear earlier in prerequisite
Date: Wed, 16 Nov 2005 05:07:46 +0800

for example, in gnome/ORBit2, there something like this

  bin_PROGRAMS = foo
  foo_SOURCES = foo.c bar.h

where `bar.h' is only available at compile time, it is produced by one
program called `idl-compiler', the command to produce `bar.h' is:

  idl-compiler bar.idl

automake dont know how to compile a .idl file, so i want to define
primary for use to compile idl file, just as what to do to other
source files, so i can write in something like this:

  idl_IDLFILES = bar.idl
  idl_COMPILER = idl-compiler
  noinst_bin_PROGRAMES = idl-compiler
  bar_idl_IDLCFLAGS = --show-errors
  idl_compiler_SOURCES = a.c b.c ...

if automake wouldn't process these, then i have do it myself, but i
want to find $(bar_idl_IDLCFLAGS) given the name `bar.idl',
currently i wrote
  cname = $(subst -,_,$(1))
  $(call cname,bar.idl)
but many character are refused by automake in a variable name, like
[[.-+]], which are also valid in filename, cname may get longer if all
characters have to be replaced by '_',
and comes the need of a automake function `canonnical_name'

usually , compile an idl file will produce 4 files, any one of which
may not be produced, specified by an command line argument ,
independent to others.
i used timestamp, but seems that i didn't notice something.

`info Automake "Multiple Outputs"' is very helpful,
thanks a lot.

On 11/16/05, Ralf Wildenhues <address@hidden> wrote:
> * n.g. wrote on Mon, Nov 14, 2005 at 11:46:07AM CET:
> >
> > it seems that if something appeared in the same place in a Makefile,
> > they are not ordered. ex. if they are both dependencies of a target.
> Yes, in general.  There are some exceptions to this rule.
> > currently, the problem is solved by using BUILT_SOURCES and/or manual
> > rules for sources. as you mentioned.
> Or manual specification of the interdependencies.
> > if automake accept userdefined rule to be act as builtin primaries,
> > it will be a wonderful thing.
> >
> > or if automake populate the macro it used to canonicalize macro names
> > for user use is not bad too.
> Please be more specific.  For example, I can write
> bin_PROGRAMS = foo
> foo_DEPENDENCIES = bla bar
> $(foo_DEPENDENCIES): blo
>         $do_something
> and that will work.  Be sure to read
>   info Automake "Multiple Outputs"
> of a recent(!) Automake version, though.
> If this scheme is not applicable to your problem, you should be more
> specific in which primaries you use.
> Cheers,
> Ralf

Tomorrow will be a good day :-)


reply via email to

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