2004-04-02 07:28:02 +00:00
|
|
|
# -*-makefile-*-
|
1997-09-16 01:07:48 +00:00
|
|
|
# common.make
|
|
|
|
#
|
|
|
|
# Set all of the common environment variables.
|
|
|
|
#
|
2001-11-22 14:26:45 +00:00
|
|
|
# Copyright (C) 1997, 2001 Free Software Foundation, Inc.
|
1997-09-16 01:07:48 +00:00
|
|
|
#
|
|
|
|
# Author: Scott Christley <scottc@net-community.com>
|
1997-10-06 03:58:06 +00:00
|
|
|
# Author: Ovidiu Predescu <ovidiu@net-community.com>
|
2001-11-22 14:26:45 +00:00
|
|
|
# Author: Nicola Pero <n.pero@mi.flashnet.it>
|
1997-09-16 01:07:48 +00:00
|
|
|
#
|
|
|
|
# This file is part of the GNUstep Makefile Package.
|
|
|
|
#
|
|
|
|
# This library is free software; you can redistribute it and/or
|
|
|
|
# modify it under the terms of the GNU General Public License
|
|
|
|
# as published by the Free Software Foundation; either version 2
|
|
|
|
# of the License, or (at your option) any later version.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public
|
|
|
|
# License along with this library; see the file COPYING.LIB.
|
|
|
|
# If not, write to the Free Software Foundation,
|
2005-05-22 03:20:14 +00:00
|
|
|
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
1997-09-16 01:07:48 +00:00
|
|
|
|
2001-07-10 14:30:08 +00:00
|
|
|
ifeq ($(COMMON_MAKE_LOADED),)
|
|
|
|
COMMON_MAKE_LOADED = yes
|
|
|
|
|
1997-09-25 19:34:14 +00:00
|
|
|
SHELL = /bin/sh
|
|
|
|
|
2001-01-16 19:28:50 +00:00
|
|
|
# GNUSTEP_BASE_INSTALL by default is `' - this is correct
|
2001-01-12 18:27:36 +00:00
|
|
|
|
2003-10-13 23:22:20 +00:00
|
|
|
# GNUSTEP_BUILD_DIR is the directory in which anything generated
|
|
|
|
# during the build will be placed. '.' means it's the same as the
|
|
|
|
# source directory; this case is the default/common and we optimize
|
|
|
|
# for it whenever possible.
|
|
|
|
ifeq ($(GNUSTEP_BUILD_DIR),)
|
|
|
|
GNUSTEP_BUILD_DIR = .
|
|
|
|
endif
|
|
|
|
|
1997-09-16 01:07:48 +00:00
|
|
|
#
|
1997-09-18 01:36:07 +00:00
|
|
|
# Scripts to run for parsing canonical names
|
1997-09-16 01:07:48 +00:00
|
|
|
#
|
2000-06-13 15:14:23 +00:00
|
|
|
CONFIG_GUESS_SCRIPT = $(GNUSTEP_MAKEFILES)/config.guess
|
|
|
|
CONFIG_SUB_SCRIPT = $(GNUSTEP_MAKEFILES)/config.sub
|
|
|
|
CONFIG_CPU_SCRIPT = $(GNUSTEP_MAKEFILES)/cpu.sh
|
|
|
|
CONFIG_VENDOR_SCRIPT = $(GNUSTEP_MAKEFILES)/vendor.sh
|
|
|
|
CONFIG_OS_SCRIPT = $(GNUSTEP_MAKEFILES)/os.sh
|
|
|
|
CLEAN_CPU_SCRIPT = $(GNUSTEP_MAKEFILES)/clean_cpu.sh
|
|
|
|
CLEAN_VENDOR_SCRIPT = $(GNUSTEP_MAKEFILES)/clean_vendor.sh
|
|
|
|
CLEAN_OS_SCRIPT = $(GNUSTEP_MAKEFILES)/clean_os.sh
|
2000-12-05 16:11:55 +00:00
|
|
|
ifeq ($(GNUSTEP_FLATTENED),)
|
|
|
|
WHICH_LIB_SCRIPT \
|
|
|
|
= $(GNUSTEP_MAKEFILES)/$(GNUSTEP_HOST_CPU)/$(GNUSTEP_HOST_OS)/which_lib
|
|
|
|
else
|
|
|
|
WHICH_LIB_SCRIPT = $(GNUSTEP_MAKEFILES)/which_lib
|
|
|
|
endif
|
2000-06-13 15:14:23 +00:00
|
|
|
LD_LIB_PATH_SCRIPT = $(GNUSTEP_MAKEFILES)/ld_lib_path.sh
|
1998-02-06 19:15:05 +00:00
|
|
|
TRANSFORM_PATHS_SCRIPT = $(GNUSTEP_MAKEFILES)/transform_paths.sh
|
2002-04-06 16:26:01 +00:00
|
|
|
REL_PATH_SCRIPT = $(GNUSTEP_MAKEFILES)/relative_path.sh
|
1997-10-02 23:05:46 +00:00
|
|
|
|
1998-02-09 22:43:47 +00:00
|
|
|
# Take the makefiles from the system root
|
|
|
|
ifeq ($(GNUSTEP_MAKEFILES),)
|
2003-04-28 02:29:49 +00:00
|
|
|
GNUSTEP_MAKEFILES = $(GNUSTEP_SYSTEM_ROOT)/Library/Makefiles
|
1998-02-09 22:43:47 +00:00
|
|
|
endif
|
|
|
|
|
2001-11-07 23:23:35 +00:00
|
|
|
#
|
|
|
|
# Determine the compilation host and target
|
|
|
|
#
|
|
|
|
include $(GNUSTEP_MAKEFILES)/names.make
|
|
|
|
|
|
|
|
ifeq ($(GNUSTEP_FLATTENED),)
|
|
|
|
GNUSTEP_HOST_DIR = $(GNUSTEP_HOST_CPU)/$(GNUSTEP_HOST_OS)
|
|
|
|
GNUSTEP_TARGET_DIR = $(GNUSTEP_TARGET_CPU)/$(GNUSTEP_TARGET_OS)
|
|
|
|
GNUSTEP_HOST_LDIR = $(GNUSTEP_HOST_DIR)/$(LIBRARY_COMBO)
|
|
|
|
GNUSTEP_TARGET_LDIR = $(GNUSTEP_TARGET_DIR)/$(LIBRARY_COMBO)
|
|
|
|
else
|
|
|
|
GNUSTEP_HOST_DIR = .
|
|
|
|
GNUSTEP_TARGET_DIR = .
|
|
|
|
GNUSTEP_HOST_LDIR = .
|
|
|
|
GNUSTEP_TARGET_LDIR = .
|
|
|
|
endif
|
|
|
|
|
|
|
|
#
|
|
|
|
# Get the config information
|
|
|
|
#
|
|
|
|
include $(GNUSTEP_MAKEFILES)/$(GNUSTEP_TARGET_DIR)/config.make
|
|
|
|
|
2002-01-22 00:17:52 +00:00
|
|
|
#
|
|
|
|
# Sanity checks - only performed at the first make invocation
|
|
|
|
#
|
|
|
|
ifeq ($(MAKELEVEL),0)
|
|
|
|
|
|
|
|
# Sanity check on GNUSTEP_*_ROOT. We want them all to be non-empty.
|
|
|
|
GNUSTEP_ERROR =
|
|
|
|
|
|
|
|
ifeq ($(GNUSTEP_USER_ROOT),)
|
|
|
|
GNUSTEP_ERROR=GNUSTEP_USER_ROOT
|
|
|
|
endif
|
|
|
|
ifeq ($(GNUSTEP_LOCAL_ROOT),)
|
|
|
|
GNUSTEP_ERROR=GNUSTEP_LOCAL_ROOT
|
|
|
|
endif
|
|
|
|
ifeq ($(GNUSTEP_NETWORK_ROOT),)
|
|
|
|
GNUSTEP_ERROR=GNUSTEP_NETWORK_ROOT
|
|
|
|
endif
|
|
|
|
ifeq ($(GNUSTEP_SYSTEM_ROOT),)
|
|
|
|
GNUSTEP_ERROR=GNUSTEP_SYSTEM_ROOT
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(GNUSTEP_ERROR),)
|
|
|
|
$(warning ERROR: Your $(GNUSTEP_ERROR) environment variable is empty !)
|
|
|
|
$(error Please try again after running ". $(GNUSTEP_MAKEFILES)/GNUstep.sh")
|
|
|
|
endif
|
|
|
|
|
2001-11-22 14:26:45 +00:00
|
|
|
# Sanity check on $PATH - NB: if PATH is wrong, we can't do certain things
|
|
|
|
# because we can't run the tools (not even using opentool as we can't even
|
2001-12-20 23:37:31 +00:00
|
|
|
# run opentool if PATH is wrong) - this is particularly bad for gui stuff
|
2001-11-06 20:25:56 +00:00
|
|
|
|
2002-01-22 00:17:52 +00:00
|
|
|
# Skip the check if we are on an Apple system. I was told that you can't
|
|
|
|
# source GNUstep.sh before running Apple's PB and that the only
|
|
|
|
# friendly solution is to disable the check.
|
2002-12-30 16:30:51 +00:00
|
|
|
ifneq ($(FOUNDATION_LIB), apple)
|
2001-12-20 23:37:31 +00:00
|
|
|
|
2002-01-22 00:17:52 +00:00
|
|
|
# NB - we can't trust PATH here because it's what we are trying to
|
|
|
|
# check ... but hopefully if we (common.make) have been found, we
|
|
|
|
# can trust that at least $(GNUSTEP_MAKEFILES) is set up correctly :-)
|
2001-11-07 23:23:35 +00:00
|
|
|
|
2002-01-22 00:17:52 +00:00
|
|
|
# We want to check that this path is in the PATH
|
|
|
|
SYS_TOOLS_PATH = $(GNUSTEP_SYSTEM_ROOT)/Tools
|
2001-11-06 20:25:56 +00:00
|
|
|
|
2002-03-11 14:49:21 +00:00
|
|
|
# But on cygwin we might need to first fix it up ...
|
2002-03-10 15:01:27 +00:00
|
|
|
ifeq ($(findstring cygwin, $(GNUSTEP_HOST_OS)), cygwin)
|
2002-03-10 13:28:15 +00:00
|
|
|
ifeq ($(shell echo "$(SYS_TOOLS_PATH)" | sed 's/^\([a-zA-Z]:.*\)//'),)
|
2002-03-10 14:49:58 +00:00
|
|
|
SYS_TOOLS_PATH := $(shell $(GNUSTEP_MAKEFILES)/fixpath.sh -u $(SYS_TOOLS_PATH))
|
2001-11-06 20:25:56 +00:00
|
|
|
endif
|
2002-01-22 00:17:52 +00:00
|
|
|
endif
|
2001-11-06 20:25:56 +00:00
|
|
|
|
2002-03-11 14:49:21 +00:00
|
|
|
# Under mingw paths are so confused this warning is not worthwhile
|
|
|
|
ifneq ($(findstring mingw, $(GNUSTEP_HOST_OS)), mingw)
|
|
|
|
ifeq ($(findstring $(SYS_TOOLS_PATH),$(PATH)),)
|
|
|
|
$(warning WARNING: Your PATH may not be set up correctly !)
|
|
|
|
$(warning Please try again after running ". $(GNUSTEP_MAKEFILES)/GNUstep.sh")
|
|
|
|
endif
|
2002-01-22 00:17:52 +00:00
|
|
|
endif
|
2001-11-06 20:25:56 +00:00
|
|
|
|
2002-12-30 16:30:51 +00:00
|
|
|
endif # code used when FOUNDATION_LIB != apple
|
2001-12-20 23:37:31 +00:00
|
|
|
|
2002-01-22 00:17:52 +00:00
|
|
|
endif # End of sanity checks run only at makelevel 0
|
2001-03-18 16:30:43 +00:00
|
|
|
|
2002-06-13 16:11:52 +00:00
|
|
|
#
|
|
|
|
# Get standard messages
|
|
|
|
#
|
|
|
|
include $(GNUSTEP_MAKEFILES)/messages.make
|
1997-09-18 01:36:07 +00:00
|
|
|
|
1997-09-16 01:07:48 +00:00
|
|
|
#
|
2001-01-29 19:33:07 +00:00
|
|
|
# Get flags/config options for core libraries
|
1997-09-16 01:07:48 +00:00
|
|
|
#
|
2001-01-29 19:33:07 +00:00
|
|
|
|
|
|
|
# First, work out precisely library combos etc
|
2001-12-08 17:01:14 +00:00
|
|
|
include $(GNUSTEP_MAKEFILES)/library-combo.make
|
2001-01-29 19:33:07 +00:00
|
|
|
# Then include custom makefiles with flags/config options
|
|
|
|
# This is meant to be used by the core libraries to override loading
|
|
|
|
# of the system makefiles from $(GNUSTEP_MAKEFILES)/Additional/*.make
|
2001-12-03 11:22:11 +00:00
|
|
|
# with their local copy (presumably more up-to-date)
|
2001-01-29 19:33:07 +00:00
|
|
|
ifneq ($(GNUSTEP_LOCAL_ADDITIONAL_MAKEFILES),)
|
|
|
|
include $(GNUSTEP_LOCAL_ADDITIONAL_MAKEFILES)
|
|
|
|
endif
|
|
|
|
# Then include makefiles with flags/config options installed by the
|
|
|
|
# libraries themselves
|
|
|
|
-include $(GNUSTEP_MAKEFILES)/Additional/*.make
|
1997-09-16 01:07:48 +00:00
|
|
|
|
1997-10-14 22:54:35 +00:00
|
|
|
#
|
1997-10-17 00:55:41 +00:00
|
|
|
# Determine target specific settings
|
1997-10-14 22:54:35 +00:00
|
|
|
#
|
1998-02-06 19:15:05 +00:00
|
|
|
include $(GNUSTEP_MAKEFILES)/target.make
|
1997-10-14 22:54:35 +00:00
|
|
|
|
1997-10-28 02:34:11 +00:00
|
|
|
#
|
|
|
|
# GNUSTEP_INSTALLATION_DIR is the directory where all the things go. If you
|
2002-01-22 00:17:52 +00:00
|
|
|
# don't specify it defaults to GNUSTEP_LOCAL_ROOT.
|
1997-10-28 02:34:11 +00:00
|
|
|
#
|
|
|
|
ifeq ($(GNUSTEP_INSTALLATION_DIR),)
|
2002-01-22 00:17:52 +00:00
|
|
|
GNUSTEP_INSTALLATION_DIR = $(GNUSTEP_LOCAL_ROOT)
|
1997-10-28 02:34:11 +00:00
|
|
|
endif
|
|
|
|
|
2002-10-17 16:44:26 +00:00
|
|
|
# Make it public and available to all submakes invocations
|
|
|
|
export GNUSTEP_INSTALLATION_DIR
|
|
|
|
|
1997-09-16 01:07:48 +00:00
|
|
|
#
|
|
|
|
# Variables specifying the installation directory paths
|
|
|
|
#
|
2002-02-28 11:09:49 +00:00
|
|
|
GNUSTEP_APPS = $(GNUSTEP_INSTALLATION_DIR)/Applications
|
2001-10-01 20:27:02 +00:00
|
|
|
GNUSTEP_TOOLS = $(GNUSTEP_INSTALLATION_DIR)/Tools
|
2003-04-28 02:29:49 +00:00
|
|
|
GNUSTEP_LIBRARY = $(GNUSTEP_INSTALLATION_DIR)/Library
|
2003-10-15 02:52:56 +00:00
|
|
|
GNUSTEP_SERVICES = $(GNUSTEP_LIBRARY)/Services
|
2003-07-29 11:56:20 +00:00
|
|
|
ifeq ($(GNUSTEP_FLATTENED),yes)
|
|
|
|
GNUSTEP_HEADERS = $(GNUSTEP_INSTALLATION_DIR)/Library/Headers
|
|
|
|
else
|
|
|
|
GNUSTEP_HEADERS = $(GNUSTEP_INSTALLATION_DIR)/Library/Headers/$(LIBRARY_COMBO)
|
|
|
|
endif
|
2003-10-15 02:52:56 +00:00
|
|
|
GNUSTEP_APPLICATION_SUPPORT = $(GNUSTEP_LIBRARY)/ApplicationSupport
|
|
|
|
GNUSTEP_BUNDLES = $(GNUSTEP_LIBRARY)/Bundles
|
|
|
|
GNUSTEP_FRAMEWORKS = $(GNUSTEP_LIBRARY)/Frameworks
|
2003-05-03 02:11:35 +00:00
|
|
|
GNUSTEP_PALETTES = $(GNUSTEP_LIBRARY)/ApplicationSupport/Palettes
|
2003-04-28 02:29:49 +00:00
|
|
|
GNUSTEP_LIBRARIES = $(GNUSTEP_INSTALLATION_DIR)/Library/Libraries
|
2003-10-15 02:52:56 +00:00
|
|
|
GNUSTEP_RESOURCES = $(GNUSTEP_LIBRARY)/Libraries/Resources
|
|
|
|
GNUSTEP_JAVA = $(GNUSTEP_LIBRARY)/Libraries/Java
|
|
|
|
GNUSTEP_DOCUMENTATION = $(GNUSTEP_LIBRARY)/Documentation
|
2001-10-01 20:27:02 +00:00
|
|
|
GNUSTEP_DOCUMENTATION_MAN = $(GNUSTEP_DOCUMENTATION)/man
|
|
|
|
GNUSTEP_DOCUMENTATION_INFO = $(GNUSTEP_DOCUMENTATION)/info
|
|
|
|
|
1998-01-09 22:05:03 +00:00
|
|
|
# The default name of the makefile to be used in recursive invocations of make
|
|
|
|
ifeq ($(MAKEFILE_NAME),)
|
|
|
|
MAKEFILE_NAME = GNUmakefile
|
|
|
|
endif
|
|
|
|
|
2002-03-18 17:07:02 +00:00
|
|
|
# Now prepare the library and header flags - we first prepare the list
|
2004-03-09 17:38:18 +00:00
|
|
|
# of directories (trying to avoid duplicates in the list), then
|
|
|
|
# optionally remove the empty ones, then prepend -I / -L to them.
|
2000-12-05 16:11:55 +00:00
|
|
|
ifeq ($(GNUSTEP_FLATTENED),)
|
2001-09-30 23:48:22 +00:00
|
|
|
|
2004-03-09 17:38:18 +00:00
|
|
|
# The following variables have to be evaluated after setting dir to
|
|
|
|
# something, such as GNUSTEP_USER_ROOT. When you evaluate them in
|
|
|
|
# that situation, they will generate paths according to the following
|
|
|
|
# definition. Later, we'll systematically replace dir with
|
|
|
|
# GNUSTEP_USER_ROOT, the GNUSTEP_LOCAL_ROOT, then
|
|
|
|
# GNUSTEP_NETWORK_ROOT, then GNUSTEP_SYSTEM_ROOT.
|
|
|
|
GS_HEADER_PATH = \
|
|
|
|
$(dir)/Library/Headers/$(LIBRARY_COMBO)/$(GNUSTEP_TARGET_DIR) \
|
|
|
|
$(dir)/Library/Headers/$(LIBRARY_COMBO)
|
2000-12-05 16:11:55 +00:00
|
|
|
|
2004-03-09 17:38:18 +00:00
|
|
|
GS_LIBRARY_PATH = \
|
|
|
|
$(dir)/Library/Libraries/$(GNUSTEP_TARGET_LDIR) \
|
|
|
|
$(dir)/Library/Libraries/$(GNUSTEP_TARGET_DIR)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
# In the flattened case, the paths to generate are considerably simpler.
|
|
|
|
|
|
|
|
GS_HEADER_PATH = $(dir)/Library/Headers
|
|
|
|
GS_LIBRARY_PATH = $(dir)/Library/Libraries
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
2004-04-02 07:28:02 +00:00
|
|
|
ifeq ($(FOUNDATION_LIB), apple)
|
|
|
|
GS_FRAMEWORK_PATH = $(dir)/Library/Frameworks
|
|
|
|
else
|
|
|
|
GS_FRAMEWORK_PATH =
|
|
|
|
endif
|
|
|
|
|
2004-03-09 17:38:18 +00:00
|
|
|
# First, we add paths based on GNUSTEP_USER_ROOT.
|
|
|
|
|
|
|
|
# Please note that the following causes GS_HEADER_PATH to be evaluated
|
|
|
|
# with the variable dir equal $(GNUSTEP_USER_ROOT), which gives the
|
|
|
|
# effect we wanted.
|
|
|
|
GNUSTEP_HEADERS_DIRS = $(foreach dir,$(GNUSTEP_USER_ROOT),$(GS_HEADER_PATH))
|
|
|
|
GNUSTEP_LIBRARIES_DIRS = $(foreach dir,$(GNUSTEP_USER_ROOT),$(GS_LIBRARY_PATH))
|
2004-04-02 07:28:02 +00:00
|
|
|
GNUSTEP_FRAMEWORKS_DIRS = $(foreach dir,$(GNUSTEP_USER_ROOT),$(GS_FRAMEWORK_PATH))
|
2004-03-09 17:38:18 +00:00
|
|
|
|
|
|
|
# Second, if GNUSTEP_LOCAL_ROOT is different from GNUSTEP_USER_ROOT
|
|
|
|
# (which has already been added), we add the paths based on
|
|
|
|
# GNUSTEP_LOCAL_ROOT too.
|
|
|
|
ifneq ($(GNUSTEP_LOCAL_ROOT), $(GNUSTEP_USER_ROOT))
|
|
|
|
GNUSTEP_HEADERS_DIRS += $(foreach dir,$(GNUSTEP_LOCAL_ROOT),$(GS_HEADER_PATH))
|
|
|
|
GNUSTEP_LIBRARIES_DIRS += $(foreach dir,$(GNUSTEP_LOCAL_ROOT),$(GS_LIBRARY_PATH))
|
2004-04-02 07:28:02 +00:00
|
|
|
GNUSTEP_FRAMEWORKS_DIRS += $(foreach dir,$(GNUSTEP_LOCAL_ROOT),$(GS_FRAMEWORK_PATH))
|
2004-03-09 17:38:18 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
# Third, if GNUSTEP_NETWORK_ROOT is different from GNUSTEP_USER_ROOT and
|
|
|
|
# GNUSTEP_LOCAL_ROOT (which have already been added), we add the paths
|
|
|
|
# based on GNUSTEP_NETWORK_ROOT too.
|
|
|
|
ifneq ($(GNUSTEP_NETWORK_ROOT), $(GNUSTEP_USER_ROOT))
|
|
|
|
ifneq ($(GNUSTEP_NETWORK_ROOT), $(GNUSTEP_LOCAL_ROOT))
|
|
|
|
GNUSTEP_HEADERS_DIRS += $(foreach dir,$(GNUSTEP_NETWORK_ROOT),$(GS_HEADER_PATH))
|
|
|
|
GNUSTEP_LIBRARIES_DIRS += $(foreach dir,$(GNUSTEP_NETWORK_ROOT),$(GS_LIBRARY_PATH))
|
2004-04-02 07:28:02 +00:00
|
|
|
GNUSTEP_FRAMEWORKS_DIRS += $(foreach dir,$(GNUSTEP_NETWORK_ROOT),$(GS_FRAMEWORK_PATH))
|
2004-03-09 17:38:18 +00:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
# Last, if GNUSTEP_SYSTEM_ROOT is different from GNUSTEP_USER_ROOT,
|
|
|
|
# GNUSTEP_LOCAL_ROOT and GNUSTEP_NETWORK_ROOT (which have already been
|
|
|
|
# added), we add the pathe paths based on GNUSTEP_SYSTEM_ROOT too.
|
|
|
|
ifneq ($(GNUSTEP_SYSTEM_ROOT), $(GNUSTEP_USER_ROOT))
|
|
|
|
ifneq ($(GNUSTEP_SYSTEM_ROOT), $(GNUSTEP_LOCAL_ROOT))
|
|
|
|
ifneq ($(GNUSTEP_SYSTEM_ROOT), $(GNUSTEP_NETWORK_ROOT))
|
|
|
|
GNUSTEP_HEADERS_DIRS += $(foreach dir,$(GNUSTEP_SYSTEM_ROOT),$(GS_HEADER_PATH))
|
|
|
|
GNUSTEP_LIBRARIES_DIRS += $(foreach dir,$(GNUSTEP_SYSTEM_ROOT),$(GS_LIBRARY_PATH))
|
2004-04-02 07:28:02 +00:00
|
|
|
GNUSTEP_FRAMEWORKS_DIRS += $(foreach dir,$(GNUSTEP_SYSTEM_ROOT),$(GS_FRAMEWORK_PATH))
|
2004-03-09 17:38:18 +00:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
endif
|
2003-01-09 18:05:41 +00:00
|
|
|
|
2002-03-18 17:07:02 +00:00
|
|
|
ifeq ($(REMOVE_EMPTY_DIRS),yes)
|
|
|
|
# This variable, when evaluated, gives $(dir) if dir is non-empty, and
|
|
|
|
# nothing if dir is empty.
|
|
|
|
remove_if_empty = $(dir $(word 1,$(wildcard $(dir)/*)))
|
|
|
|
|
|
|
|
# Build the GNUSTEP_HEADER_FLAGS by removing the empty dirs from
|
|
|
|
# GNUSTEP_HEADER_DIRS, then prepending -I to each of them
|
|
|
|
#
|
|
|
|
# Important - because this variable is defined with = and not :=, it
|
|
|
|
# is only evaluated when it is used. Which is good - it means we don't
|
|
|
|
# scan the directories and try to remove the empty one on each make
|
|
|
|
# invocation (eg, on 'make clean') - we only scan the dirs when we are using
|
|
|
|
# GNUSTEP_HEADERS_FLAGS to compile. Please make sure to keep this
|
|
|
|
# behaviour otherwise scanning the directories each time a makefile is
|
|
|
|
# read might slow down the package unnecessarily for operations like
|
|
|
|
# make clean, make distclean etc.
|
|
|
|
#
|
|
|
|
# Doing this filtering still gives a 5% to 10% slowdown in compilation times
|
|
|
|
# due to directory scanning, which is why is normally turned off by
|
|
|
|
# default - by default we put all directories in compilation commands.
|
|
|
|
GNUSTEP_HEADERS_FLAGS = \
|
|
|
|
$(addprefix -I,$(foreach dir,$(GNUSTEP_HEADERS_DIRS),$(remove_if_empty)))
|
|
|
|
GNUSTEP_LIBRARIES_FLAGS = \
|
|
|
|
$(addprefix -L,$(foreach dir,$(GNUSTEP_LIBRARIES_DIRS),$(remove_if_empty)))
|
2004-04-02 07:28:02 +00:00
|
|
|
GNUSTEP_FRAMEWORKS_FLAGS = \
|
2004-04-13 02:40:25 +00:00
|
|
|
$(addprefix -F,$(foreach dir,$(GNUSTEP_FRAMEWORKS_DIRS),$(remove_if_empty)))
|
2002-03-18 17:07:02 +00:00
|
|
|
else
|
|
|
|
# Default case, just add -I / -L
|
|
|
|
GNUSTEP_HEADERS_FLAGS = $(addprefix -I,$(GNUSTEP_HEADERS_DIRS))
|
|
|
|
GNUSTEP_LIBRARIES_FLAGS = $(addprefix -L,$(GNUSTEP_LIBRARIES_DIRS))
|
2004-04-02 07:28:02 +00:00
|
|
|
GNUSTEP_FRAMEWORKS_FLAGS = $(addprefix -F,$(GNUSTEP_FRAMEWORKS_DIRS))
|
2002-03-18 17:07:02 +00:00
|
|
|
endif
|
|
|
|
|
1997-10-30 19:06:58 +00:00
|
|
|
ifeq ($(FOUNDATION_LIB), fd)
|
2002-12-30 16:30:51 +00:00
|
|
|
|
|
|
|
# Map OBJC_RUNTIME_LIB values to OBJC_RUNTIME values as used by
|
|
|
|
# libFoundation. TODO/FIXME: Drop all this stuff and have
|
|
|
|
# libFoundation use OBJC_RUNTIME_LIB directly.
|
2003-07-29 11:56:20 +00:00
|
|
|
|
|
|
|
# TODO: Remove all this cruft. Standardize.
|
2002-12-30 16:30:51 +00:00
|
|
|
ifeq ($(OBJC_RUNTIME_LIB), nx)
|
|
|
|
OBJC_RUNTIME = NeXT
|
|
|
|
endif
|
|
|
|
ifeq ($(OBJC_RUNTIME_LIB), sun)
|
|
|
|
OBJC_RUNTIME = Sun
|
|
|
|
endif
|
|
|
|
ifeq ($(OBJC_RUNTIME_LIB), apple)
|
|
|
|
OBJC_RUNTIME = apple
|
|
|
|
endif
|
|
|
|
ifeq ($(OBJC_RUNTIME_LIB), gnu)
|
|
|
|
OBJC_RUNTIME = GNU
|
|
|
|
endif
|
|
|
|
ifeq ($(OBJC_RUNTIME_LIB), gnugc)
|
|
|
|
OBJC_RUNTIME = GNU
|
|
|
|
endif
|
2004-03-09 17:29:38 +00:00
|
|
|
|
|
|
|
# If all of the following really needed ? If the system is not
|
|
|
|
# flattened, multiple Foundation libraries are not permitted anyway,
|
|
|
|
# so libFoundation could just put his headers in Foundation/. If
|
|
|
|
# library combos are used, all headers are in a library-combo
|
|
|
|
# directory, so libFoundation could still put his headers in
|
|
|
|
# Foundation/ and no conflict should arise. As for the
|
|
|
|
# GNUSTEP_TARGET_DIR, maybe we should key all of our headers in a
|
|
|
|
# GNUSTEP_TARGET_LDIR directory (rather than just a LIBRARY_COMBO
|
|
|
|
# directory). But does it really matter in practice anyway ?
|
|
|
|
ifeq ($(GNUSTEP_FLATTENED),yes)
|
|
|
|
GNUSTEP_HEADERS_FND_DIRS = \
|
|
|
|
$(GNUSTEP_USER_ROOT)/Library/Headers/libFoundation \
|
|
|
|
$(GNUSTEP_LOCAL_ROOT)/Library/Headers/libFoundation \
|
|
|
|
$(GNUSTEP_NETWORK_ROOT)/Library/Headers/libFoundation \
|
|
|
|
$(GNUSTEP_SYSTEM_ROOT)/Library/Headers/libFoundation \
|
|
|
|
$(GNUSTEP_USER_ROOT)/Library/Headers/libFoundation/$(GNUSTEP_TARGET_DIR)/$(OBJC_RUNTIME) \
|
|
|
|
$(GNUSTEP_LOCAL_ROOT)/Library/Headers/libFoundation/$(GNUSTEP_TARGET_DIR)/$(OBJC_RUNTIME) \
|
|
|
|
$(GNUSTEP_NETWORK_ROOT)/Library/Headers/libFoundation/$(GNUSTEP_TARGET_DIR)/$(OBJC_RUNTIME) \
|
|
|
|
$(GNUSTEP_SYSTEM_ROOT)/Library/Headers/libFoundation/$(GNUSTEP_TARGET_DIR)/$(OBJC_RUNTIME)
|
|
|
|
else
|
|
|
|
GNUSTEP_HEADERS_FND_DIRS = \
|
|
|
|
$(GNUSTEP_USER_ROOT)/Library/Headers/$(LIBRARY_COMBO)/libFoundation \
|
|
|
|
$(GNUSTEP_LOCAL_ROOT)/Library/Headers/$(LIBRARY_COMBO)/libFoundation \
|
|
|
|
$(GNUSTEP_NETWORK_ROOT)/Library/Headers/$(LIBRARY_COMBO)/libFoundation \
|
|
|
|
$(GNUSTEP_SYSTEM_ROOT)/Library/Headers/$(LIBRARY_COMBO)/libFoundation \
|
|
|
|
$(GNUSTEP_USER_ROOT)/Library/Headers/$(LIBRARY_COMBO)/libFoundation/$(GNUSTEP_TARGET_DIR)/$(OBJC_RUNTIME) \
|
|
|
|
$(GNUSTEP_LOCAL_ROOT)/Library/Headers/$(LIBRARY_COMBO)/libFoundation/$(GNUSTEP_TARGET_DIR)/$(OBJC_RUNTIME) \
|
|
|
|
$(GNUSTEP_NETWORK_ROOT)/Library/Headers/$(LIBRARY_COMBO)/libFoundation/$(GNUSTEP_TARGET_DIR)/$(OBJC_RUNTIME) \
|
|
|
|
$(GNUSTEP_SYSTEM_ROOT)/Library/Headers/$(LIBRARY_COMBO)/libFoundation/$(GNUSTEP_TARGET_DIR)/$(OBJC_RUNTIME)
|
2002-03-18 17:07:02 +00:00
|
|
|
endif
|
|
|
|
|
2002-12-30 16:30:51 +00:00
|
|
|
ifeq ($(REMOVE_EMPTY_DIRS), yes)
|
2002-03-18 17:07:02 +00:00
|
|
|
# Build the GNUSTEP_HEADERS_FND_FLAG by removing the empty dirs
|
|
|
|
# from GNUSTEP_HEADERS_FND_DIRS, then prepending -I to each of them
|
|
|
|
GNUSTEP_HEADERS_FND_FLAG = \
|
|
|
|
$(addprefix -I,$(foreach dir,$(GNUSTEP_HEADERS_FND_DIRS),$(remove_if_empty)))
|
|
|
|
else
|
|
|
|
# default case - simply prepend -I
|
|
|
|
GNUSTEP_HEADERS_FND_FLAG = $(addprefix -I,$(GNUSTEP_HEADERS_FND_DIRS))
|
1997-10-30 19:06:58 +00:00
|
|
|
endif
|
1997-10-28 19:00:28 +00:00
|
|
|
|
2004-03-09 17:29:38 +00:00
|
|
|
# Just add the result of all this to the standard header flags.
|
|
|
|
GNUSTEP_HEADERS_FLAGS += $(GNUSTEP_HEADERS_FND_FLAG)
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
1997-09-18 01:36:07 +00:00
|
|
|
#
|
|
|
|
# Overridable compilation flags
|
|
|
|
#
|
2003-07-29 11:56:20 +00:00
|
|
|
# FIXME: We use -fno-strict-aliasing to prevent annoying gcc3.3
|
|
|
|
# compiler warnings. But we really need to investigate why the
|
|
|
|
# warning appear in the first place, if they are serious or not, and
|
|
|
|
# what can be done about it.
|
2004-02-18 16:55:11 +00:00
|
|
|
OBJCFLAGS = -fno-strict-aliasing
|
1997-09-26 01:16:38 +00:00
|
|
|
CFLAGS =
|
|
|
|
OBJ_DIR_PREFIX =
|
1997-09-18 01:36:07 +00:00
|
|
|
|
2004-06-22 23:56:41 +00:00
|
|
|
# If the compiler supports native ObjC exceptions and the user wants us to
|
|
|
|
# use them, turn them on!
|
|
|
|
ifeq ($(USE_OBJC_EXCEPTIONS), yes)
|
2004-06-19 11:09:53 +00:00
|
|
|
OBJCFLAGS += -fobjc-exceptions
|
|
|
|
endif
|
|
|
|
|
2002-09-12 13:59:04 +00:00
|
|
|
#
|
|
|
|
# Now decide whether to build shared objects or not. Nothing depending
|
|
|
|
# on the value of the shared variable is allowed before this point!
|
|
|
|
#
|
|
|
|
|
|
|
|
#
|
|
|
|
# Fixup bundles to be always built as shared even when shared=no is given
|
|
|
|
#
|
|
|
|
ifeq ($(shared), no)
|
|
|
|
ifeq ($(GNUSTEP_TYPE), bundle)
|
|
|
|
$(warning "Static bundles are meaningless! I am using shared=yes!")
|
|
|
|
override shared = yes
|
|
|
|
export shared
|
|
|
|
endif
|
2004-01-12 12:46:40 +00:00
|
|
|
ifeq ($(GNUSTEP_TYPE), framework)
|
|
|
|
$(warning "Static frameworks are meaningless! I am using shared=yes!")
|
|
|
|
override shared = yes
|
|
|
|
export shared
|
|
|
|
endif
|
2002-09-12 13:59:04 +00:00
|
|
|
endif
|
|
|
|
|
1997-09-26 01:16:38 +00:00
|
|
|
# Enable building shared libraries by default. If the user wants to build a
|
|
|
|
# static library, he/she has to specify shared=no explicitly.
|
|
|
|
ifeq ($(HAVE_SHARED_LIBS), yes)
|
2002-09-12 13:59:04 +00:00
|
|
|
# Unless shared=no has been purposedly set ...
|
|
|
|
ifneq ($(shared), no)
|
|
|
|
# ... set shared = yes
|
|
|
|
shared = yes
|
1997-09-26 01:16:38 +00:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(shared), yes)
|
2000-06-13 15:14:23 +00:00
|
|
|
LIB_LINK_CMD = $(SHARED_LIB_LINK_CMD)
|
|
|
|
OBJ_DIR_PREFIX += shared_
|
|
|
|
INTERNAL_OBJCFLAGS += $(SHARED_CFLAGS)
|
|
|
|
INTERNAL_CFLAGS += $(SHARED_CFLAGS)
|
2002-10-30 12:42:22 +00:00
|
|
|
AFTER_INSTALL_LIBRARY_CMD = $(AFTER_INSTALL_SHARED_LIB_CMD)
|
1997-09-26 01:16:38 +00:00
|
|
|
else
|
2000-06-13 15:14:23 +00:00
|
|
|
LIB_LINK_CMD = $(STATIC_LIB_LINK_CMD)
|
|
|
|
OBJ_DIR_PREFIX += static_
|
2002-10-30 12:42:22 +00:00
|
|
|
AFTER_INSTALL_LIBRARY_CMD = $(AFTER_INSTALL_STATIC_LIB_CMD)
|
2000-06-13 15:14:23 +00:00
|
|
|
LIBRARY_NAME_SUFFIX := s$(LIBRARY_NAME_SUFFIX)
|
1997-09-26 01:16:38 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(profile), yes)
|
2000-12-05 16:11:55 +00:00
|
|
|
ADDITIONAL_FLAGS += -pg
|
|
|
|
ifeq ($(LD), $(CC))
|
2003-09-29 16:46:50 +00:00
|
|
|
INTERNAL_LDFLAGS += -pg
|
2000-12-05 16:11:55 +00:00
|
|
|
endif
|
|
|
|
OBJ_DIR_PREFIX += profile_
|
|
|
|
LIBRARY_NAME_SUFFIX := p$(LIBRARY_NAME_SUFFIX)
|
1997-09-26 01:16:38 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(debug), yes)
|
2000-12-05 16:11:55 +00:00
|
|
|
OPTFLAG := $(filter-out -O%, $(OPTFLAG))
|
|
|
|
ADDITIONAL_FLAGS += -g -Wall -DDEBUG -fno-omit-frame-pointer
|
2001-11-21 15:37:55 +00:00
|
|
|
INTERNAL_JAVACFLAGS += -g -deprecation
|
2000-12-05 16:11:55 +00:00
|
|
|
OBJ_DIR_PREFIX += debug_
|
1997-10-07 23:27:51 +00:00
|
|
|
LIBRARY_NAME_SUFFIX := d$(LIBRARY_NAME_SUFFIX)
|
2001-11-21 15:37:55 +00:00
|
|
|
else
|
|
|
|
INTERNAL_JAVACFLAGS += -O
|
1997-09-26 01:16:38 +00:00
|
|
|
endif
|
|
|
|
|
1999-11-10 01:56:23 +00:00
|
|
|
OBJ_DIR_PREFIX += obj
|
|
|
|
|
1999-11-07 14:37:45 +00:00
|
|
|
ifeq ($(warn), no)
|
2000-12-05 16:11:55 +00:00
|
|
|
ADDITIONAL_FLAGS += -UGSWARN
|
1999-11-07 14:37:45 +00:00
|
|
|
else
|
2000-12-05 16:11:55 +00:00
|
|
|
ADDITIONAL_FLAGS += -DGSWARN
|
1999-11-07 14:37:45 +00:00
|
|
|
endif
|
1997-09-26 01:16:38 +00:00
|
|
|
|
2001-12-13 04:10:48 +00:00
|
|
|
ifeq ($(diagnose), no)
|
|
|
|
ADDITIONAL_FLAGS += -UGSDIAGNOSE
|
|
|
|
else
|
|
|
|
ADDITIONAL_FLAGS += -DGSDIAGNOSE
|
|
|
|
endif
|
|
|
|
|
1997-10-07 23:27:51 +00:00
|
|
|
ifneq ($(LIBRARY_NAME_SUFFIX),)
|
2000-12-05 16:11:55 +00:00
|
|
|
LIBRARY_NAME_SUFFIX := _$(LIBRARY_NAME_SUFFIX)
|
1997-10-07 23:27:51 +00:00
|
|
|
endif
|
|
|
|
|
2001-04-13 19:49:16 +00:00
|
|
|
AUXILIARY_CPPFLAGS += $(GNUSTEP_DEFINE) \
|
2001-11-22 14:26:45 +00:00
|
|
|
$(FND_DEFINE) $(GUI_DEFINE) $(BACKEND_DEFINE) \
|
2002-05-10 08:47:58 +00:00
|
|
|
$(RUNTIME_DEFINE) $(FOUNDATION_LIBRARY_DEFINE)
|
1999-03-02 08:58:30 +00:00
|
|
|
|
1997-09-26 01:16:38 +00:00
|
|
|
INTERNAL_OBJCFLAGS += $(ADDITIONAL_FLAGS) $(OPTFLAG) $(OBJCFLAGS) \
|
|
|
|
$(RUNTIME_FLAG)
|
2003-10-21 02:25:44 +00:00
|
|
|
INTERNAL_CFLAGS += $(ADDITIONAL_FLAGS) $(OPTFLAG)
|
1997-09-26 01:16:38 +00:00
|
|
|
|
2001-03-14 01:00:23 +00:00
|
|
|
# trick needed to replace a space with nothing
|
|
|
|
empty:=
|
|
|
|
space:= $(empty) $(empty)
|
|
|
|
GNUSTEP_OBJ_PREFIX = $(subst $(space),,$(OBJ_DIR_PREFIX))
|
1997-10-28 02:34:11 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Support building of Multiple Architecture Binaries (MAB). The object files
|
|
|
|
# directory will be something like shared_obj/ix86_m68k_sun/
|
|
|
|
#
|
|
|
|
ifeq ($(arch),)
|
2000-12-05 16:11:55 +00:00
|
|
|
ARCH_OBJ_DIR = $(GNUSTEP_TARGET_DIR)
|
1997-10-28 02:34:11 +00:00
|
|
|
else
|
2000-12-05 16:11:55 +00:00
|
|
|
ARCH_OBJ_DIR = \
|
1997-10-28 02:34:11 +00:00
|
|
|
$(shell echo $(CLEANED_ARCH) | sed -e 's/ /_/g')/$(GNUSTEP_TARGET_OS)
|
|
|
|
endif
|
|
|
|
|
2000-12-05 16:11:55 +00:00
|
|
|
ifeq ($(GNUSTEP_FLATTENED),)
|
2003-10-13 23:22:20 +00:00
|
|
|
GNUSTEP_OBJ_DIR_NAME = $(GNUSTEP_OBJ_PREFIX)/$(ARCH_OBJ_DIR)/$(LIBRARY_COMBO)
|
2000-12-05 16:11:55 +00:00
|
|
|
else
|
2003-10-13 23:22:20 +00:00
|
|
|
GNUSTEP_OBJ_DIR_NAME = $(GNUSTEP_OBJ_PREFIX)
|
2000-12-05 16:11:55 +00:00
|
|
|
endif
|
1998-04-06 03:01:59 +00:00
|
|
|
|
2003-10-13 23:22:20 +00:00
|
|
|
GNUSTEP_OBJ_DIR = $(GNUSTEP_BUILD_DIR)/$(GNUSTEP_OBJ_DIR_NAME)
|
|
|
|
|
1999-02-19 21:47:15 +00:00
|
|
|
#
|
|
|
|
# Common variables for subprojects
|
2000-06-13 15:14:23 +00:00
|
|
|
#
|
1999-02-19 21:47:15 +00:00
|
|
|
SUBPROJECT_PRODUCT = subproject$(OEXT)
|
1998-05-28 06:56:11 +00:00
|
|
|
|
2000-06-21 11:25:41 +00:00
|
|
|
#
|
2000-08-07 22:06:04 +00:00
|
|
|
# Set JAVA_HOME if not set.
|
|
|
|
#
|
|
|
|
ifeq ($(JAVA_HOME),)
|
|
|
|
# Else, try JDK_HOME
|
|
|
|
ifeq ($(JDK_HOME),)
|
|
|
|
# Else, try by finding the path of javac and removing 'bin/javac' from it
|
|
|
|
ifeq ($(JAVAC),)
|
2000-09-25 16:44:59 +00:00
|
|
|
JAVA_HOME = $(shell which javac | sed "s/bin\/javac//g")
|
2000-08-07 22:06:04 +00:00
|
|
|
else # $(JAVAC) != ""
|
|
|
|
JAVA_HOME = $(shell which $(JAVAC) | sed "s/bin\/javac//g")
|
|
|
|
endif
|
|
|
|
else # $(JDK_HOME) != ""
|
|
|
|
JAVA_HOME = $(JDK_HOME)
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
#
|
2002-10-16 23:00:43 +00:00
|
|
|
# The java compiler.
|
2000-06-21 11:25:41 +00:00
|
|
|
#
|
|
|
|
ifeq ($(JAVAC),)
|
2000-08-07 22:06:04 +00:00
|
|
|
JAVAC = $(JAVA_HOME)/bin/javac
|
2000-06-21 11:25:41 +00:00
|
|
|
endif
|
1999-10-30 07:11:34 +00:00
|
|
|
|
2000-06-22 16:54:17 +00:00
|
|
|
#
|
2002-10-16 23:00:43 +00:00
|
|
|
# The java header compiler.
|
2000-06-22 16:54:17 +00:00
|
|
|
#
|
|
|
|
ifeq ($(JAVAH),)
|
2000-08-07 22:06:04 +00:00
|
|
|
JAVAH = $(JAVA_HOME)/bin/javah
|
2000-06-22 16:54:17 +00:00
|
|
|
endif
|
|
|
|
|
2002-01-30 19:51:21 +00:00
|
|
|
#
|
|
|
|
# Common variables - default values
|
|
|
|
#
|
|
|
|
# Because this file is included at the beginning of the user's
|
|
|
|
# GNUmakefile, the user can override these variables by setting them
|
|
|
|
# in the GNUmakefile.
|
|
|
|
BUNDLE_EXTENSION = .bundle
|
2002-01-31 17:58:29 +00:00
|
|
|
ifeq ($(profile), yes)
|
|
|
|
APP_EXTENSION = profile
|
|
|
|
else
|
|
|
|
ifeq ($(debug), yes)
|
|
|
|
APP_EXTENSION = debug
|
|
|
|
else
|
|
|
|
APP_EXTENSION = app
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
2002-01-30 19:51:21 +00:00
|
|
|
|
2002-01-30 20:04:36 +00:00
|
|
|
# We want total control over GNUSTEP_INSTANCE.
|
|
|
|
# GNUSTEP_INSTANCE determines wheter it's a Master or an Instance
|
|
|
|
# invocation. Whenever we run a submake, we want it to be a Master
|
|
|
|
# invocation, unless we specifically set it to run as an Instance
|
|
|
|
# invocation by adding the GNUSTEP_INSTANCE=xxx flag. Tell make not
|
|
|
|
# to mess with our games by passing this variable to submakes himself
|
|
|
|
unexport GNUSTEP_INSTANCE
|
|
|
|
unexport GNUSTEP_TYPE
|
2002-01-30 17:50:46 +00:00
|
|
|
|
2001-07-10 14:30:08 +00:00
|
|
|
endif # COMMON_MAKE_LOADED
|