bug-make
[Top][All Lists]
Advanced

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

wishlist item: namespaces for include


From: Britton Kerin
Subject: wishlist item: namespaces for include
Date: Wed, 12 Dec 2007 17:19:50 -0900

 
I would like to be able to tell make to automatically prefix all rules
and variables
that come from an include'ed makefile with a namespace prefix.  So maybe
this syntax:

namespace foo_ include module_foo/Makefile

The Makefile in foo might have targets build, test, and install, and a
variable
INSTALL_PREFIX.  In the include'ing makefile, these would be available
as
foo_build, foo_test, foo_install, and foo_INSTALL_PREFIX, respectively.

Motivation:

I guess you guys have seen 'Recursive Make Considered Harmful'.  It
would be nice to 
include makefiles in module directories rather than recursive calls.  It
would save
a lot of typing and the associated confusing repetition in the sources.

There are essentially two ways to record the module interdependency
information:
keep the info with the modules, or keep it in a central place (in the
directory
containing the modules for example).  namespace would make things easier
either way.
In the intelligent peers approach, if bar needed foo to be tested before
building,
you might end up with this:

     namespace foo include ../foo/Makefile

     build: foo_test
             commands_to_build_bar

In the central repository approach, you might have

     namespace foo include foo/Makefile
     namespace bar include bar/Makefile

     bar_build: foo_test

In this simple case one could of course make a target foo_test_stamp or
the like and
make a recursive call to make, but as the module interdependencies get
thicker and
less generic this approach gets irritating, and its already harder and
more repetitive.

I have some time at the moment and could work on implementing this if
there is any 
interest and it wouldn't be a waste for some other reason.

Britton






reply via email to

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