# ============================================================== # Copyright (c) 2001 Tim Barbour. # All Rights Reserved. # This make library may be used and distributed under the terms # of the GNU LGPL, as published by the Free Software Foundation. # See the file COPYING for details. # ============================================================== # $Id: find_target_platforms.mk,v 1.4 2001/12/11 04:08:22 trb Exp $ #------------------------------------------------------------------------------------------------------- # text requires: DEFAULT_TARGET_PLATFORMS TARGET_PLATFORMS #------------------------------------------------------------------------------------------------------- # refers to: INAPPROPRIATE_TARGET_PLATFORMS ONLY_TARGET_PLATFORMS #------------------------------------------------------------------------------------------------------- # provides variables: target_platforms #------------------------------------------------------------------------------------------------------- # there must always be at least one target_platform ifneq ($(strip $(DEFAULT_TARGET_PLATFORMS)),) default_target_platforms = $(DEFAULT_TARGET_PLATFORMS) else default_target_platforms = host endif ifneq ($(strip $(TARGET_PLATFORMS)),) target_platforms0 = $(TARGET_PLATFORMS) else target_platforms0 = $(default_target_platforms) endif # we support a shorthand name ("host") for the host platform target_platforms1 = $(patsubst host,$(host_platform),$(target_platforms0)) ifeq ($(strip $(INAPPROPRIATE_TARGET_PLATFORMS)),) target_platforms2 = $(target_platforms1) else target_platforms2 = $(shell echo "$(target_platforms1)" | $(TR) ' ' '\n' | $(GREP) -v $(INAPPROPRIATE_TARGET_PLATFORMS) | $(TR) ' ' '\n') endif ifeq ($(strip $(ONLY_TARGET_PLATFORMS_CONTAINING)),) target_platforms := $(target_platforms2) else target_platforms := $(shell echo "$(target_platforms2)" | $(TR) ' ' '\n' | $(GREP) -i $(ONLY_TARGET_PLATFORMS_CONTAINING) | $(TR) ' ' '\n') endif