[Top][All Lists]

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

some (trivial) observations on multi-arch builds

From: Robert P. J. Day
Subject: some (trivial) observations on multi-arch builds
Date: Fri, 12 May 2006 09:28:29 -0400 (EDT)

  if you'll indulge me, a few simple observations on multi-arch builds
that i just want to clarify so i'm sure i understand it thoroughly.

  as i read it, the whole point of designing a multi-arch build is to
take an "original" makefile (that was written with the assumption that
it would be invoked in the source directory) and extend it so it can
be invoked elsewhere (the build directory).  as paul explains it here:

this is done by, for the most part, just adding a "wrapper" around the
original makefile.  as i read it, the goal is to have to hack that
original makefile as little as possible.

  now, with the use of vpath, this works just fine as long as your
references to things in the source directory come in the way of rule
dependencies, so vpath will happily do the work in tracking those
objects down for you.  however, if you can't represent something as a
rule dependency, you still might have to explicitly refer to the
source directory.

  for example, let's say the source directory has a local "include/"
directory and gcc was originally invoked with "-I./include".  that
will work fine if you're running in the source directory itself but
will fail badly elsewhere.  in a case like that, it seems clear that
your rule commands might need to incorporate a reference to ${SRCDIR}
because vpath won't help you with things like compiler options.

  as a simpler example, let's say i just wanted to collect a list of
all of the source files in the directory.  originally, i might have
just written:

  SRCS := $(wildcard *.c)

now, however, i have to be careful to write something like:

  SRCS := $(wildcard ${SRCDIR}/*.c)

none of this is really deep, it's just stuff that i don't think was
explained emphatically enough.  in addition to knowing what using
"vpath" can do, i think it's just as important to emphasize what it
*can't* do so people know how they still have to adjust their
makefiles so they can be invoked remotely.



reply via email to

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