From 902d1a549a2f8a927d1ec78097787b1d5bb5cdf8 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 28 Oct 2011 16:35:26 +0200 Subject: Fix makefile detection logic We have to handle situations where bootstrap.make is included directly. --- build/bootstrap.make | 8 +++++--- makefile | 1 - 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/build/bootstrap.make b/build/bootstrap.make index f40850f..4891152 100644 --- a/build/bootstrap.make +++ b/build/bootstrap.make @@ -3,8 +3,6 @@ # copyright : Copyright (c) 2004-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file - - # First time bootstrap.make is read # ifndef %makefile% @@ -61,10 +59,14 @@ export MAKE # also it will be consistent. # -# By convention, the makefile name is the third last word from the end. +# By convention, the makefile name is the second or third last word from +# the end. If it is the third, then the second one should be end with +# bootstrap.make # %makefile% := $(subst $(lastword $(MAKEFILE_LIST)),,$(MAKEFILE_LIST)) +ifneq ($(filter %bootstrap.make,$(lastword $(%makefile%))),) %makefile% := $(subst $(lastword $(%makefile%)),,$(%makefile%)) +endif %makefile% := $(abspath $(lastword $(%makefile%))) %makefile_realpath% := $(realpath $(%makefile%)) diff --git a/makefile b/makefile index 9339ca0..33c8f66 100644 --- a/makefile +++ b/makefile @@ -20,7 +20,6 @@ help: @echo "corresponding directories." @echo - # Install. # .PHONY: install $(out_base)/.install -- cgit v1.1