[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Moving from manual Makefiles to Automake
From: |
Ralf Wildenhues |
Subject: |
Re: Moving from manual Makefiles to Automake |
Date: |
Wed, 9 Nov 2005 14:15:12 +0100 |
User-agent: |
Mutt/1.5.11 |
* Paulo Jorge Matos wrote on Wed, Nov 09, 2005 at 11:26:32AM CET:
> On 09/11/05, Ralf Wildenhues <address@hidden> wrote:
> >
> > I don't understand quite how you do this. If you want to use fewer
> > Makefiles than directories, consider using Automake's subdir-objects
> > option and look at recent discussion on this list about it, and the
> > documentation. (There may be an issue with you setting VPATH manually,
> > too; also covered here recently.)
>
> Oh well,
> The problem is I don't have a project per directory. This consists in
> only one project which in the src dir is distributed by various dirs
> like:
> src
> |-- include
> This is easy for my group to distribute its work and coordinate patches.
You can include Makefile.am snippets in other Makefile.am's as well, if
that helps you.
> > > make[3]: Warning: File `.deps/vbhimplvsids.Po' has modification time
> > > 2e+02 s in the future
> >
> > Is your source on a networked file system (NFS, ...)? Then please look
> > to synchronize the time of server and client. NTP is very good for
> > this.
>
> Well, this is indeed in NFS. I really can't see how to solve this
> since the server is not administered by myself. I'll most probably
> have to try and sync the clock with the server manually or ignore the
> warnings.
Tell the admins responsible for the machines to sync the clocks.
It's quite important for reliable operation of `make', otherwise
weird failures may occur, because parts have not been updated the
way they should have.
> > For this, you can use
> > "-DBUILDDATE=\"`date +'%Y-%b-%d %R'`\""
> > Note that some (uncommon) compilers or compiler wrappers will be too
> > stupid to parse your command line correctly. You could put the
> > definition into a generated header file, though (or add it to config.h,
> > if it suffices for you to have this information updated at configure
> > time, not at make time).
>
> How could I add it automaticly to config.h?
At configure time: put this in configure.ac:
build_time=`date +'%Y-%b-%d %R'`
AC_DEFINE_UNQUOTED([BUILDTIME], ["$build_time"], [build time])
Note that a rerunning of configure will then obviously change config.h,
and thus cause all objects to be recompiled whose source includes
config.h. Not the greatest solution. I guess you could also instead
create a file buildtime.h.in with the line
#define BUILDTIME @BUILDTIME@
and add
AC_SUBST([BUILDTIME], ["\"`date +'%Y-%b-%d %R'`\""])
AC_CONFIG_FILES([buildtime.h])
to configure.ac.
There was a thread about a similar topic here recently.
Cheers,
Ralf