help-make
[Top][All Lists]
Advanced

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

Re: Multiple Builds From Same Source


From: Paul Smith
Subject: Re: Multiple Builds From Same Source
Date: Tue, 21 May 2013 09:50:26 -0400

On Tue, 2013-05-21 at 01:36 +0000, cramerj wrote:
> I am trying to build a 32-bit and 64-bit library using the same source
> with just one invocation of Make.  Unfortunately, I can't seem to
> figure out how to tell Make to delete the intermediate files before
> trying to build the second library.

You can't do that.  Make expects to build every target exactly one time.
There is no facility to create a target, then later delete it and
recreate it.

You have two options: first, and most common, you can create the object
files for the different targets in different directories or with
different suffixes (foo.i386.o and foo.x86_64.o) so they don't conflict.
Second, you can use recursive make where you first invoke a make to
build the i386 objects, then run make to build the x86_64 objects.

Personally I think the latter option, or the one you're using now, is
dangerous.  What if a .o file happens to be in the directory already?
How do you know whether it's the right target or not?

Better to be explicit about it using separate paths for separate
targets.




reply via email to

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