autoconf
[Top][All Lists]
Advanced

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

Re: Generated Makefiles for multiple platforms


From: BRM
Subject: Re: Generated Makefiles for multiple platforms
Date: Sun, 18 Dec 2005 13:15:20 -0800 (PST)

After reading through all the wisdom that has been
given to me by this list, I have modified my test
project to (a) generate all the Makefiles statically:

AC_OUTPUT(Makefile, os/Makefile, os/linux/Makefile,
os/mingw32/Makefile, etc.)

I also added some AM_CONDITIONALs for each supported
OS to my configure.ac like the following:

AM_CONDITIONAL([TARGET_LINUX],[test ¨$target_os¨ =
¨linux¨])

However, I am still having a few issues that I can´t
figure out. Namely - ´make´ doesn´t want to recurse if
I have the following in my os/Makefile.am:

if TARGET_LINUX
   COMILE_OS = ¨linux¨
endif
...
SUBDIRS = $(COMPILE_OS)

It will recurse if I change it to the following:

SUBDIRS = @target_os@

Which is the proper way to do it? Is there something
else I need to do to get it to recurse properly?

I am also having trouble getting make to build the
object file inside of the os/@target_cpu@ directory.
If I do get it to recurse in, it returns with a
´all-am nothing to do´ type message without having
build the os.o file. I have tried doing things like
the following:

hello_world_SOURCES = os.c

SOURCES = os.c

os_SOURCES = os.c

however, in the case of ´SOURCES = os.c' is just
doesn´t do anything. In the other two, it complains
with the following:

variable ´hello_world_SOURCES´ defined but no program
or library has ´hello_world´ as canonic name (possible
typo).

I am having trouble finding programs that use
autotools in this manner, as most may recurse, but
then define a program (not an object file) to be
compiled. I would to have each subdirectory compiling
the object files, and then link them together in the
top-level directory. Is this even possible?

If someone knows of a project that does this that I
can get ahold of, I would be glad to use that as a
project to learn from.

TIA,

Ben

--- Braden McDaniel <address@hidden> wrote:

> On Thu, 2005-12-15 at 06:26 -0800, BRM wrote:
> > --- Braden McDaniel <address@hidden> wrote:
> > > On Wed, 2005-12-14 at 08:31 -0800, BRM wrote:
> > > > I originally sent this to the Automake list
> since
> > I
> > > > figured it was an issue with Automake,
> however, I
> > have
> > > > not seen any response to it yet. So, any help
> is
> > very
> > > > greatly appreciated.
> > > You're trying to do work that autoconf wants to
> do
> > > for you.
> > > Your build directories are
> > > configuration-specific--which can include
> > > platform-specific aspects. To configure for a
> > > platform (or even a
> > > particular configuration of a platform): create
> a
> > > directory, change to
> > > it, and run your configure script there.
> > 
> > Normally, that may be true.
> 
> It is always true. That is how autoconf works.
> 
> >  However, the project I am
> > working on will need different directories for
> > different platforms and possibly (not positive
> yet)
> > different cpu´s because of vast differences in
> code.
> > Parts of the project will be providing GUI
> interfaces,
> > and at present it is planned to use WIN32 API´s on
> > Windows, while using something else on Linux/Unix
> as I
> > haven´t gotten a library like Qt approved yet (and
> I
> > don´t know if I´ll be able to). Is there a better
> way
> > still, to solve this problem? I´m all ears.
> 
> That's fine. It doesn't mean you need to generate
> makefiles
> conditionally. Generate the same set of makefiles
> all the time; let
> configure take care of exactly what they contain
> (and thus what gets
> built).
> 
> -- 
> Braden McDaniel                           e-mail:
> <address@hidden>
> <http://endoframe.com>                    Jabber:
> <address@hidden>
> 
> 





reply via email to

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