automake
[Top][All Lists]
Advanced

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

Re: Moving from manual Makefiles to Automake


From: Paulo Jorge Matos
Subject: Re: Moving from manual Makefiles to Automake
Date: Wed, 9 Nov 2005 10:26:32 +0000

On 09/11/05, Ralf Wildenhues <address@hidden> wrote:
> Hi Paulo,
>

Hi,

> * Paulo Jorge Matos wrote on Wed, Nov 09, 2005 at 10:02:53AM CET:
> >
> > On a current C++ project I'm using Autoconf and Automake.
> > To solve the big subdir tree inside src I used VPATHs in my
> > Makefile.am, if there's another way please say so.
>
> 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
 |-- utils
 |-- low_level
 |-- gui
 |-- etc etc..

This is easy for my group to distribute its work and coordinate patches.

> > The current problem is due to the fact that using automake with bison
> > and flex is giving me headaches.
> *snip*
>
> Two issues I can see here:
>
> > make[3]: Entering directory `/home/pocm/software/extsat/src'
> > 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.

> > if g++ -DHAVE_CONFIG_H -I. -I. -I..    -I./include -ansi -std=c++98
> > -pedantic -Wall -DBUILDDATE=`date +'%Y-%b-%d %R'` -g -O2 -MT
> > msat-parser.o -MD -MP -MF ".deps/msat-parser.Tpo" -c -o msat-parser.o
> > msat-parser.cc; \
> > then mv -f ".deps/msat-parser.Tpo" ".deps/msat-parser.Po"; else rm -f
> > ".deps/msat-parser.Tpo"; exit 1; fi
> > g++: cannot specify -o with -c or -S and multiple compilations
>
> The problem is this:
>   -DBUILDDATE=`date +'%Y-%b-%d %R'`
>
> The date expands to more than one word, the shell splits it and then g++
> sets BUILDDATE to 2005-Nov-09, and sees 8:59 as source file name, and
> complains.
>

AH, my god... I've been around this problem for hours and so that's
it! Never though that would be the problem. eh ! :D

> To get around the shell expansion, you can use quotes:
>   "-DBUILDDATE=`date +'%Y-%b-%d %R'`"
>
> But probably you'll rather want this in a C string, right?  Then you
> also need a set of quotes for the compiler, so that BUILDDDATE will
> expand to
>   "2005-Nov-09 8:59"
> instead of
>   2005-Nov-09 8:59
>
> For this, you can use
>   "-DBUILDDATE=\"`date +'%Y-%b-%d %R'`\""
>

OK, thanks a lot!

> 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?

> Cheers,
> Ralf
>

Cheers,

--
Paulo Jorge Matos - pocm at sat inesc-id pt
Web: http://sat.inesc-id.pt/~pocm
Computer and Software Engineering
INESC-ID - SAT Group




reply via email to

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