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,
|
|
|
|
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
|
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
|
|
|
|
|
1997-09-23 01:27:32 +00:00
|
|
|
# Default version
|
2000-06-13 15:14:23 +00:00
|
|
|
MAJOR_VERSION = 1
|
|
|
|
MINOR_VERSION = 0
|
|
|
|
SUBMINOR_VERSION = 0
|
|
|
|
VERSION = ${MAJOR_VERSION}.${MINOR_VERSION}.${SUBMINOR_VERSION}
|
1997-09-23 01:27:32 +00:00
|
|
|
|
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
|
|
|
|
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),)
|
|
|
|
GNUSTEP_MAKEFILES = $(GNUSTEP_SYSTEM_ROOT)/Makefiles
|
|
|
|
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.
|
|
|
|
ifneq ($(FOUNDATION_LIB),nx)
|
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-01-22 00:17:52 +00:00
|
|
|
endif # code used when FOUNDATION_LIB != nx
|
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
|
|
|
|
GNUSTEP_SERVICES = $(GNUSTEP_INSTALLATION_DIR)/Library/Services
|
|
|
|
GNUSTEP_HEADERS = $(GNUSTEP_INSTALLATION_DIR)/Headers
|
|
|
|
GNUSTEP_BUNDLES = $(GNUSTEP_INSTALLATION_DIR)/Library/Bundles
|
|
|
|
GNUSTEP_FRAMEWORKS = $(GNUSTEP_INSTALLATION_DIR)/Library/Frameworks
|
|
|
|
GNUSTEP_PALETTES = $(GNUSTEP_INSTALLATION_DIR)/Developer/Palettes
|
|
|
|
GNUSTEP_LIBRARIES = $(GNUSTEP_INSTALLATION_DIR)/Libraries
|
|
|
|
GNUSTEP_RESOURCES = $(GNUSTEP_INSTALLATION_DIR)/Libraries/Resources
|
|
|
|
GNUSTEP_JAVA = $(GNUSTEP_INSTALLATION_DIR)/Libraries/Java
|
|
|
|
GNUSTEP_DOCUMENTATION = $(GNUSTEP_INSTALLATION_DIR)/Documentation
|
|
|
|
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
|
|
|
|
# of directories, 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
|
|
|
|
2002-03-18 17:07:02 +00:00
|
|
|
GNUSTEP_HEADERS_DIRS = \
|
|
|
|
$(GNUSTEP_USER_ROOT)/Headers/$(GNUSTEP_TARGET_DIR) \
|
|
|
|
$(GNUSTEP_USER_ROOT)/Headers \
|
|
|
|
$(GNUSTEP_LOCAL_ROOT)/Headers/$(GNUSTEP_TARGET_DIR) \
|
|
|
|
$(GNUSTEP_LOCAL_ROOT)/Headers \
|
|
|
|
$(GNUSTEP_NETWORK_ROOT)/Headers/$(GNUSTEP_TARGET_DIR) \
|
|
|
|
$(GNUSTEP_NETWORK_ROOT)/Headers \
|
|
|
|
$(GNUSTEP_SYSTEM_ROOT)/Headers/$(GNUSTEP_TARGET_DIR) \
|
|
|
|
$(GNUSTEP_SYSTEM_ROOT)/Headers
|
|
|
|
|
|
|
|
GNUSTEP_LIBRARIES_DIRS = \
|
|
|
|
$(GNUSTEP_USER_ROOT)/Libraries/$(GNUSTEP_TARGET_LDIR) \
|
|
|
|
$(GNUSTEP_USER_ROOT)/Libraries/$(GNUSTEP_TARGET_DIR) \
|
|
|
|
$(GNUSTEP_LOCAL_ROOT)/Libraries/$(GNUSTEP_TARGET_LDIR) \
|
|
|
|
$(GNUSTEP_LOCAL_ROOT)/Libraries/$(GNUSTEP_TARGET_DIR) \
|
|
|
|
$(GNUSTEP_NETWORK_ROOT)/Libraries/$(GNUSTEP_TARGET_LDIR) \
|
|
|
|
$(GNUSTEP_NETWORK_ROOT)/Libraries/$(GNUSTEP_TARGET_DIR) \
|
|
|
|
$(GNUSTEP_SYSTEM_ROOT)/Libraries/$(GNUSTEP_TARGET_LDIR) \
|
|
|
|
$(GNUSTEP_SYSTEM_ROOT)/Libraries/$(GNUSTEP_TARGET_DIR)
|
2001-10-01 00:47:38 +00:00
|
|
|
|
2002-01-20 03:55:38 +00:00
|
|
|
else # GNUSTEP_FLATTENED
|
2000-12-05 16:11:55 +00:00
|
|
|
|
2002-03-18 17:07:02 +00:00
|
|
|
GNUSTEP_HEADERS_DIRS = \
|
|
|
|
$(GNUSTEP_USER_ROOT)/Headers \
|
|
|
|
$(GNUSTEP_LOCAL_ROOT)/Headers \
|
|
|
|
$(GNUSTEP_NETWORK_ROOT)/Headers \
|
|
|
|
$(GNUSTEP_SYSTEM_ROOT)/Headers
|
2001-10-01 01:21:04 +00:00
|
|
|
|
2002-03-18 17:07:02 +00:00
|
|
|
GNUSTEP_LIBRARIES_DIRS = \
|
|
|
|
$(GNUSTEP_USER_ROOT)/Libraries \
|
|
|
|
$(GNUSTEP_LOCAL_ROOT)/Libraries \
|
|
|
|
$(GNUSTEP_NETWORK_ROOT)/Libraries \
|
|
|
|
$(GNUSTEP_SYSTEM_ROOT)/Libraries
|
2001-10-01 01:21:04 +00:00
|
|
|
|
2002-01-20 03:55:38 +00:00
|
|
|
endif # GNUSTEP_FLATTENED
|
2000-12-05 16:11:55 +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)))
|
|
|
|
else
|
|
|
|
# Default case, just add -I / -L
|
|
|
|
GNUSTEP_HEADERS_FLAGS = $(addprefix -I,$(GNUSTEP_HEADERS_DIRS))
|
|
|
|
GNUSTEP_LIBRARIES_FLAGS = $(addprefix -L,$(GNUSTEP_LIBRARIES_DIRS))
|
|
|
|
endif
|
|
|
|
|
1997-09-16 01:07:48 +00:00
|
|
|
#
|
1997-09-18 01:36:07 +00:00
|
|
|
# Determine Foundation header subdirectory based upon library combo
|
1997-09-16 01:07:48 +00:00
|
|
|
#
|
2002-03-18 17:07:02 +00:00
|
|
|
GNUSTEP_HEADERS_FND_DIRS = \
|
|
|
|
$(GNUSTEP_USER_ROOT)/Headers/$(GNUSTEP_FND_DIR) \
|
|
|
|
$(GNUSTEP_LOCAL_ROOT)/Headers/$(GNUSTEP_FND_DIR) \
|
|
|
|
$(GNUSTEP_NETWORK_ROOT)/Headers/$(GNUSTEP_FND_DIR) \
|
|
|
|
$(GNUSTEP_SYSTEM_ROOT)/Headers/$(GNUSTEP_FND_DIR)
|
1997-10-30 19:06:58 +00:00
|
|
|
|
|
|
|
ifeq ($(FOUNDATION_LIB), fd)
|
2002-03-18 17:07:02 +00:00
|
|
|
GNUSTEP_HEADERS_FND_DIRS += \
|
|
|
|
$(GNUSTEP_USER_ROOT)/Headers/$(GNUSTEP_FND_DIR)/$(GNUSTEP_TARGET_DIR)/$(OBJC_RUNTIME) \
|
|
|
|
$(GNUSTEP_LOCAL_ROOT)/Headers/$(GNUSTEP_FND_DIR)/$(GNUSTEP_TARGET_DIR)/$(OBJC_RUNTIME) \
|
|
|
|
$(GNUSTEP_NETWORK_ROOT)/Headers/$(GNUSTEP_FND_DIR)/$(GNUSTEP_TARGET_DIR)/$(OBJC_RUNTIME) \
|
|
|
|
$(GNUSTEP_SYSTEM_ROOT)/Headers/$(GNUSTEP_FND_DIR)/$(GNUSTEP_TARGET_DIR)/$(OBJC_RUNTIME)
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(REMOVE_EMPTY_DIRS),yes)
|
|
|
|
# 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
|
|
|
|
1997-09-18 01:36:07 +00:00
|
|
|
#
|
|
|
|
# Overridable compilation flags
|
|
|
|
#
|
2002-02-27 13:41:45 +00:00
|
|
|
OBJCFLAGS = $(OBJC_NO_IMPORT_FLAGS)
|
1997-09-26 01:16:38 +00:00
|
|
|
CFLAGS =
|
|
|
|
OBJ_DIR_PREFIX =
|
1997-09-18 01:36:07 +00:00
|
|
|
|
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
|
|
|
|
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))
|
|
|
|
LDFLAGS += -pg
|
|
|
|
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)
|
|
|
|
INTERNAL_CFLAGS += $(ADDITIONAL_FLAGS) $(CFLAGS) $(OPTFLAG) $(RUNTIME_FLAG)
|
|
|
|
INTERNAL_LDFLAGS += $(LDFLAGS)
|
|
|
|
|
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),)
|
|
|
|
GNUSTEP_OBJ_DIR = $(GNUSTEP_OBJ_PREFIX)/$(ARCH_OBJ_DIR)/$(LIBRARY_COMBO)
|
|
|
|
else
|
|
|
|
GNUSTEP_OBJ_DIR = $(GNUSTEP_OBJ_PREFIX)
|
|
|
|
endif
|
1998-04-06 03:01:59 +00:00
|
|
|
|
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
|
|
|
|
|
1998-05-28 06:56:11 +00:00
|
|
|
## Local variables:
|
|
|
|
## mode: makefile
|
|
|
|
## End:
|