4 # Determine the host and target systems
6 # Copyright (C) 1997 Free Software Foundation, Inc.
8 # Author: Scott Christley <scottc@net-community.com>
11 # This file is part of the GNUstep Makefile Package.
13 # This library is free software; you can redistribute it and/or
14 # modify it under the terms of the GNU General Public License
15 # as published by the Free Software Foundation; either version 2
16 # of the License, or (at your option) any later version.
18 # You should have received a copy of the GNU General Public
19 # License along with this library; see the file COPYING.LIB.
20 # If not, write to the Free Software Foundation,
21 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23 # Run config.guess to guess the host
25 ifeq ($(GNUSTEP_HOST),)
26 GNUSTEP_HOST_GUESS := $(shell (cd /tmp; $(CONFIG_GUESS_SCRIPT)))
27 GNUSTEP_HOST := $(shell (cd /tmp; $(CONFIG_SUB_SCRIPT) $(GNUSTEP_HOST_GUESS)))
29 GNUSTEP_HOST_CPU := $(shell (cd /tmp; $(CONFIG_CPU_SCRIPT) $(GNUSTEP_HOST)))
30 GNUSTEP_HOST_VENDOR := $(shell (cd /tmp; $(CONFIG_VENDOR_SCRIPT) $(GNUSTEP_HOST)))
31 GNUSTEP_HOST_OS := $(shell (cd /tmp; $(CONFIG_OS_SCRIPT) $(GNUSTEP_HOST)))
33 GNUSTEP_HOST_CPU := $(shell (cd /tmp; $(CLEAN_CPU_SCRIPT) $(GNUSTEP_HOST_CPU)))
34 GNUSTEP_HOST_VENDOR := $(shell (cd /tmp; $(CLEAN_VENDOR_SCRIPT) $(GNUSTEP_HOST_VENDOR)))
35 GNUSTEP_HOST_OS := $(shell (cd /tmp; $(CLEAN_OS_SCRIPT) $(GNUSTEP_HOST_OS)))
39 # The user can specify a `target' variable when running make
42 ifeq ($(strip $(target)),)
44 # The host is the default target
45 GNUSTEP_TARGET := $(GNUSTEP_HOST)
46 GNUSTEP_TARGET_CPU := $(GNUSTEP_HOST_CPU)
47 GNUSTEP_TARGET_VENDOR := $(GNUSTEP_HOST_VENDOR)
48 GNUSTEP_TARGET_OS := $(GNUSTEP_HOST_OS)
53 # Parse the target variable
56 GNUSTEP_TARGET := $(shell (cd /tmp; $(CONFIG_SUB_SCRIPT) $(target)))
58 GNUSTEP_TARGET_CPU := $(shell (cd /tmp; $(CONFIG_CPU_SCRIPT) $(GNUSTEP_TARGET)))
59 GNUSTEP_TARGET_VENDOR := $(shell (cd /tmp; $(CONFIG_VENDOR_SCRIPT) $(GNUSTEP_TARGET)))
60 GNUSTEP_TARGET_OS := $(shell (cd /tmp; $(CONFIG_OS_SCRIPT) $(GNUSTEP_TARGET)))
62 GNUSTEP_TARGET_CPU := $(shell (cd /tmp; $(CLEAN_CPU_SCRIPT) $(GNUSTEP_TARGET_CPU)))
63 GNUSTEP_TARGET_VENDOR := $(shell (cd /tmp; $(CLEAN_VENDOR_SCRIPT) $(GNUSTEP_TARGET_VENDOR)))
64 GNUSTEP_TARGET_OS := $(shell (cd /tmp; $(CLEAN_OS_SCRIPT) $(GNUSTEP_TARGET_OS)))
69 export CLEANED_ARCH = $(foreach a, $(arch), $(shell (cd /tmp; $(CLEAN_CPU_SCRIPT) $(a))))