[Top][All Lists]

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

Re: cross compile: distinct object files, how?

From: Ralf Wildenhues
Subject: Re: cross compile: distinct object files, how?
Date: Tue, 14 Apr 2009 19:52:40 +0200
User-agent: Mutt/1.5.18 (2008-05-17)

Hello Christian,

* Christian Rössel wrote on Tue, Apr 14, 2009 at 03:20:35PM CEST:
> I have a cross-compile situation where I want to compile sources of a
> subdirectory for the host system as well as for the build system. I pass
> --host, --build and CC_FOR_BUILD to configure. Then I have two
> in distinct subdirectories, one has the statement
> CC=$(CC_FOR_BUILD), the other just uses CC. The rest is identical.
> These two reference the same target_SOURCES, but I need to
> have distinct object files. In my setup the Makefile that comes first
> creates the object files (in the directory of the sources) and the other
> Makefile just uses them, hm, not what I intended.
> How can I create distinct object files? Is there a way to specify a
> "object-file-directory"? I know that if I specify (the noop)
> target_CFLAGS=$(AM_CFLAGS) in one the object files get
> prefixed. I also can symlink the sources. But is there a better
> solution?

You could also just not use the subdir-objects option in both of the
directories.  This option can be enabled on a per-directory basis.
I haven't tested it, but I think you need to disable it in both of them
so that 'make' will not be confused by an object file lying around in
the same directory as the source, and a suffix rule nearby.

> Maybe by modifying OBJEXT and .SUFFIXES?

I think that would only be asking for more trouble.

BTW, how do you ensure configure tests are correct for both compilers
without running two configure scripts, or running one of them twice?


reply via email to

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