From 690c231a1a833b4e37842e8c5839376b168727d6 Mon Sep 17 00:00:00 2001 From: Guenter Obiltschnig Date: Thu, 3 Jul 2008 10:07:52 +0000 Subject: [PATCH] makefile improvements --- build/rules/global | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/build/rules/global b/build/rules/global index 01ff69243..63f94c73b 100644 --- a/build/rules/global +++ b/build/rules/global @@ -43,6 +43,27 @@ POCO_BUILD = $(PROJECT_BASE) endif export POCO_BUILD +# +# POCO_BASE/POCO_BUILD/cwd sanity checks +# +# Ensure that the current working directory is either +# under $POCO_BASE or under $POCO_PROJECT +# Also, if we're building under $POCO_BASE, disarm +# $PROJECT_BASE +# +cwd = $(shell pwd) +inpoco = $(shell echo | awk '{print index("$(cwd)","$(POCO_BASE)")}') +inproj = $(shell echo | awk '{print index("$(cwd)","$(PROJECT_BASE)")}') + +ifeq ($(inpoco),1) +PROJECT_BASE = $(POCO_BASE) +else +ifeq ($(inproj),1) +else +$(error Current working directory not under $$POCO_PROJECT) +endif +endif + # # Determine OS # @@ -54,6 +75,7 @@ endif ifeq ($(findstring MINGW,$(POCO_HOST_OSNAME)),MINGW) POCO_HOST_OSNAME = MinGW endif +POCO_HOST_OSARCH = $(subst /,-,$(shell uname -m | tr ' ' _)) # Begin Sun platforms