makefile improvements

This commit is contained in:
Guenter Obiltschnig 2008-07-03 10:07:52 +00:00
parent 359ef99f85
commit 690c231a1a

View File

@ -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