[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: how to do recursive "subsystem" make properly?
From: |
Paul Smith |
Subject: |
RE: how to do recursive "subsystem" make properly? |
Date: |
Tue, 3 Nov 2009 18:59:20 -0500 |
On Tue, 2009-11-03 at 15:32 -0800, Mark Galeck (CW) wrote:
> top makefile is
>
> foobar: subdir/sentinel
> echo making foobar
> touch foobar
> subdir/sentinel:
> make -C subdir
>
> subdir makefile is
>
> all:
> # touch sentinel
Well, since you have the touch commented out it will never do anything.
Also, be sure to ALWAYS use the variable $(MAKE), never just "make",
when running sub-makes
> Well, what am I doing wrong - because, with this foobar always gets
> rebuilt. Probably because make attempted to remake subdir/sentinel as
> "target", and even though that file did not get updated, make
> remembers that it remade the target.
The sentinel file has to be created: it has to exist. A non-existent
file is always considered out of date. If it exists but then is not
updated, THEN it is not considered out of date.
> Also, order-only don't work for me either:
>
> Top makefile is
>
> foobar: | subsystem
> echo making foobar
> touch foobar
> subsystem:
> make -C subdir
Here foobar has to depend on the thing that is getting built
(subsystem/subfile), so the foobar knows when it's out of date.
You want this:
foobar: subsystem/subfile
echo making foobar
touch $@
subdsystem/subfile: | subsystem
.PHONY: subsystem
subsystem:
$(MAKE) -C $@
Then keep your subsystem makefile the same:
> all: subfile
> subfile:
> touch subfile
>
> This time, foobar never gets rebuilt.
- how to do recursive "subsystem" make properly?, Mark Galeck (CW), 2009/11/03
- Re: how to do recursive "subsystem" make properly?, John Calcote, 2009/11/03
- RE: how to do recursive "subsystem" make properly?, Mark Galeck (CW), 2009/11/03
- RE: how to do recursive "subsystem" make properly?, Paul Smith, 2009/11/03
- RE: how to do recursive "subsystem" make properly?, Mark Galeck (CW), 2009/11/03
- RE: how to do recursive "subsystem" make properly?, Paul Smith, 2009/11/03
- RE: how to do recursive "subsystem" make properly?, Mark Galeck (CW), 2009/11/03
- RE: how to do recursive "subsystem" make properly?, Mark Galeck (CW), 2009/11/03
- RE: how to do recursive "subsystem" make properly?,
Paul Smith <=
- RE: how to do recursive "subsystem" make properly?, Mark Galeck (CW), 2009/11/03
- RE: how to do recursive "subsystem" make properly?, Mark Galeck (CW), 2009/11/03
- Re: how to do recursive "subsystem" make properly?, Bart Robinson, 2009/11/03
- Re: how to do recursive "subsystem" make properly?, Christophe LYON, 2009/11/09
- RE: how to do recursive "subsystem" make properly?, Mark Galeck (CW), 2009/11/09
- Re: how to do recursive "subsystem" make properly?, Paul Smith, 2009/11/09
- Re: how to do recursive "subsystem" make properly?, Christophe LYON, 2009/11/10
- Re: how to do recursive "subsystem" make properly?, Bart Robinson, 2009/11/10
- Re: how to do recursive "subsystem" make properly?, Stephan Beal, 2009/11/03