Recursive make and variations on the theme

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

 



Jeff King wrote:

> The problem is that no single make was
> allowed to see the whole dependency tree.
>
> I know GNU make does have some magic for communicating between recursive
> makes. Does it handle this situation?
>
> You can fix this with a rule like "only invoke recursive makes on
> directories _below_ you, never above or to the side". But then you can't
> run "make" from inside cmds/.

In that story, commands/Makefile would make commands/built-in.a and
various commands/foo.o.  The toplevel makefile would pass "make -C
commands" a long list of targets to build, presumably deduced from
$(MAKECMDGOALS).  Not pleasant, I agree.

>>      - keep careful track of what directory "make" was run from; [*]
>> [...]
>>     [*] is a little hazy and sounds hackish.
>
> Yeah, you have to be careful with paths.

It could be pretty simple by maintaining a $(prefix_) variable
representing the path from the cwd to the directory containing the
makefile.  Might try it out.

> I think a more sane way would
> be a single top-level Makefile that [...] contains everything

That sounds best to me in the short term, too.

> A dummy Makefile in each subdir that cd's to the toplevel and runs a
> specific target. So from the top-level, "make" would build everything,
> "make lib" would build stuff in the lib directory, and the Makefile in
> lib/ would just do "cd .. && make lib".

Yes, reasonable.

Ciao,
Jonathan
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]