[ale] Including Makefile

DJ-Pfulio DJPfulio at jdpfu.com
Sun Feb 5 05:10:39 EST 2017


It has been 15 yrs since I did any non-trivla Makefiles.

We always had 1 Makefile.inc for each C++ project, but every directory
had its on Makefile.  We would chdir into each subdirectory and build
using the Makefile there (higher level Makefile did this), not a
recursive include.  Did some fairly large projects that way - 4-teir
stuff.  Builds for 12 different platforms controlled by gmake (including
Windows).

We didn't use symlinks - at the time, Windows didn't support that.

Might not help you.

On 02/04/2017 06:32 PM, Chris Fowler wrote:
> For this tree I that idea introduces some issues because binutils, gcc,
> and avr-libc need to be build in a work tree out of the src.  To solve
> that the Makefile in the I000../src directory needs to pass its location
> to make when it enters each sub dir and builds.
> 
> include ../Makefile.inc in those files becomes include
> ${SRC_DIR}/Makefile.inc
> 
> If src/Makefile has 'include ../Makefile.inc' like I originally wanted
> to do there would be a problem.  Somehow within the Makefile.inc I need
> to know what directory that inc file is really in.
> 
> 
> ------------------------------------------------------------------------
> 
>     *From: *"Chris Fowler" <cfowler at outpostsentinel.com>
>     *To: *ale at ale.org
>     *Sent: *Saturday, February 4, 2017 6:10:28 PM
>     *Subject: *[ale] Including Makefile
> 
>     I'm including a Makefile in a Makefile via ../../../../
>      ../Makefile.inc, but I want to "cascade" them.  Here is a same tree:
> 
> 
>     build_root
>        I0000025
>          src
>             binutils-2.25
> 
> 
>     One option is to simply use links.  In binutil's Makefile I could add
>     include ../Makefile.inc
> 
>     In src:
>     ln -sf ../Makefile.inc Makefile.inc
> 
>     I can do that in src'c parent of I0000025.  This is easiest.
> 
>     I thought If I used a Makefile.inc in each directory that only had
>     'include ../Makefile.inc'  I could then modify that inc as needed to
>     add stuff that pertains to the children of that directory.  The
>     obvious issue of make in binutils would always be in binutils and
>     ../Makefile.inc would loop because it does not change directory when
>     including.  Of course it looped and I get "too many open files".  
> 
>     Is there a way I can do the files instead of links like I want to?  
>  


More information about the Ale mailing list