help-make
[Top][All Lists]
Advanced

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

Re: targets built to an "output" directory.


From: Ian Dunbar
Subject: Re: targets built to an "output" directory.
Date: Sat, 18 Sep 2004 12:07:02 +0900

> > default: ${OUTDIR}/arch/a.txt.conf.lang
>
> When you change OUTDIR, you're changing the location where make is going
> to look for the prerequisite.  When OUTDIR=., the file needs to be in
> "./conf/lang/arch/a.txt".  When OUTDIR=build, the file needs to be in
> "build/conf/lang/arch/a.txt".  These are the prerequisites so the files
> need to be generated by some other rule in the makefile or you need to
> have both copies of these files available to begin with before you can
> get the default target to work properly.

The pre-requisite doesn't exist in either case, so I don't really see how it
can cause failure in one case, and success in another.

I am not trying to make more than one "OUTDIR" in any invocation of make, so
it doesn't need more than one pre-requisite at a time, and I think I have
rules to make the pre-requisite from the initial file, or am I missing
something?

At the start I have one file existing: "src/a.txt.conf.lang.arch" and one
phony target "default" that requires "${OUTDIR}/conf/lang/arch/a.txt" to be
made.

I have rules to make:

${OUTDIR}/arch/a.txt.conf.lang from a.txt.conf.lang.arch (which can be got
so long as src is in VPATH)
${OUTDIR}/lang/arch/a.txt.conf from arch/a.txt.conf.lang (which can be made
from the previous rule so long as ${OUTDIR} is in VPATH)
${OUTDIR}/conf/lang/arch/a.txt from lang/arch/a.txt.conf (which can be made
from the previous rule so long as ${OUTDIR} is in VPATH)
default: whose prerequisites are satisfied if the previous rule is made.

>From what I see I have a chain of rules going from default to the
pre-existing file, so make should be able make it. And make does make it, so
long as OUTDIR=.

Either I have misunderstood the use of VPATH, the use of variables in
pattern rules, or I am missing something else obvious.

Best regards,
Ian


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.764 / Virus Database: 511 - Release Date: 2004/09/15




reply via email to

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