[Openais] last call for patches before 0.83 is published

Angus Salkeld ahsalkeld at gmail.com
Fri Sep 28 19:13:16 PDT 2007


Hi Andrew

I am using gnu make and this is what "make info" has to say about it:

As `make' reads various makefiles, including any obtained from the
`MAKEFILES' variable, the command line, the default files, or from
`include' directives, their names will be automatically appended to the
`MAKEFILE_LIST' variable.  They are added right before `make' begins to
parse them.

Of course if you are not using gnu make this is not going to help you.

Here is a patch that should sort this out.
1) it checks for the existence of MAKEFILE_LIST first.
2) it uses the lastword function (in case the top level makefile is ever
included from another makefile)

Please let me know if this solves your problem.

P.S: can you
-tell me what make (and version) you are using?
-if you don't get the warning that "MAKEFILE_LIST is not defined..."
 can add this line near the top of the file so I can see what
MAKEFILE_LIST is set to?
$(warning MAKEFILE_LIST is $(MAKEFILE_LIST))

Thanks
-Angus

---

 Makefile |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 3be5ea3..b8e8e53 100644
--- a/Makefile
+++ b/Makefile
@@ -34,9 +34,15 @@ ifneq ($(O),)
 # cleanup the path (make it absolute)
 builddir:=3D$(abspath $(O))/
 endif
-srcdir:=3D$(dir $(realpath $(MAKEFILE_LIST)))

-include $(srcdir)/Makefile.inc
+ifndef MAKEFILE_LIST
+srcdir:=3D$(realpath .)/
+$(warning MAKEFILE_LIST is not defined, setting srcdir to $(srcdir))
+else
+srcdir:=3D$(dir $(realpath $(lastword $(MAKEFILE_LIST))))
+endif
+
+include $(srcdir)Makefile.inc

 SBINDIR=3D$(PREFIX)/sbin
 INCLUDEDIR=3D$(PREFIX)/include/openais

-------------- next part --------------
A non-text attachment was scrubbed...
Name: mk-list.patch
Type: text/x-patch
Size: 736 bytes
Desc: not available
Url : http://lists.linux-foundation.org/pipermail/openais/attachments/20070=
929/e1f48ea5/mk-list.bin


More information about the Openais mailing list