2010-02-12 08:43:42 +00:00
|
|
|
# -*-makefile-*-
|
2002-01-30 17:01:50 +00:00
|
|
|
# rules.make
|
|
|
|
#
|
|
|
|
# Makefile rules for the Instance invocation.
|
|
|
|
#
|
|
|
|
# Copyright (C) 1997, 2001, 2002 Free Software Foundation, Inc.
|
|
|
|
#
|
|
|
|
# Author: Scott Christley <scottc@net-community.com>
|
|
|
|
# Author: Ovidiu Predescu <ovidiu@net-community.com>
|
|
|
|
# Author: Nicola Pero <nicola@brainstorm.co.uk>
|
|
|
|
#
|
|
|
|
# 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
|
2007-10-30 14:18:41 +00:00
|
|
|
# as published by the Free Software Foundation; either version 3
|
2002-01-30 17:01:50 +00:00
|
|
|
# of the License, or (at your option) any later version.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public
|
2007-07-13 10:11:48 +00:00
|
|
|
# License along with this library; see the file COPYING.
|
2002-01-30 17:01:50 +00:00
|
|
|
# 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.
|
2002-01-30 17:01:50 +00:00
|
|
|
|
2002-02-28 13:09:11 +00:00
|
|
|
|
|
|
|
# Every project should have its internal-xxx-all depend first on
|
|
|
|
# before-$(GNUSTEP_INSTANCE)-all, and last on
|
|
|
|
# after-$(GNUSTEP_INSTANCE)-all. We declare them here, empty, so that
|
|
|
|
# the user can add them if he wants, but if he doesn't, make doesn't
|
|
|
|
# complain about missing targets.
|
|
|
|
|
2002-03-19 13:06:56 +00:00
|
|
|
# NB: internal-$(GNUSTEP_TYPE)-all_ should not be declared .PHONY
|
|
|
|
# here, because it's not implemented here. (example of how could go
|
|
|
|
# wrong otherwise: if say internal-clibrary-all_ depends on
|
|
|
|
# internal-library-all_, both of them should be declared .PHONY, while
|
|
|
|
# here we would only declare one of them .PHONY, so it should be done
|
|
|
|
# by the project specific makefile fragments).
|
|
|
|
.PHONY: \
|
2007-01-16 03:17:13 +00:00
|
|
|
internal-precompile-headers \
|
2002-03-19 13:06:56 +00:00
|
|
|
before-$(GNUSTEP_INSTANCE)-all after-$(GNUSTEP_INSTANCE)-all \
|
|
|
|
internal-$(GNUSTEP_TYPE)-all \
|
2014-12-21 07:16:04 +00:00
|
|
|
before-$(GNUSTEP_INSTANCE)-jar after-$(GNUSTEP_INSTANCE)-jar \
|
|
|
|
internal-$(GNUSTEP_TYPE)-jar \
|
2002-03-19 13:06:56 +00:00
|
|
|
before-$(GNUSTEP_INSTANCE)-install after-$(GNUSTEP_INSTANCE)-install \
|
|
|
|
internal-$(GNUSTEP_TYPE)-install \
|
|
|
|
before-$(GNUSTEP_INSTANCE)-uninstall after-$(GNUSTEP_INSTANCE)-uninstall \
|
|
|
|
internal-$(GNUSTEP_TYPE)-uninstall
|
2002-02-28 14:38:36 +00:00
|
|
|
|
2002-10-31 13:58:38 +00:00
|
|
|
# By adding the line
|
|
|
|
# xxx_COPY_INTO_DIR = ../Vanity.framework/Resources
|
|
|
|
# to you GNUmakefile, you cause the after-xxx-all:: stage of
|
|
|
|
# compilation of xxx to copy the created stuff into the *local*
|
|
|
|
# directory ../Vanity.framework/Resources (this path should be
|
|
|
|
# relative). It also disables installation of xxx.
|
|
|
|
#
|
|
|
|
# This is normally used, for example, to bundle a tool into a
|
|
|
|
# framework. You compile the framework, then the tool, then you can
|
|
|
|
# request the tool to be copied into the framework, becoming part of
|
|
|
|
# the framework (it is installed with the framework etc).
|
|
|
|
#
|
|
|
|
COPY_INTO_DIR = $(strip $($(GNUSTEP_INSTANCE)_COPY_INTO_DIR))
|
|
|
|
|
|
|
|
# If COPY_INTO_DIR is non-empty, we'll execute below an additional
|
|
|
|
# target at the end of compilation:
|
|
|
|
# internal-$(GNUSTEP_TYPE)-copy_into_dir
|
|
|
|
|
|
|
|
# Centrally disable standard installation if COPY_INTO_DIR is non-empty.
|
|
|
|
ifneq ($(COPY_INTO_DIR),)
|
|
|
|
$(GNUSTEP_INSTANCE)_STANDARD_INSTALL = no
|
|
|
|
endif
|
|
|
|
|
2002-02-28 13:09:11 +00:00
|
|
|
before-$(GNUSTEP_INSTANCE)-all::
|
|
|
|
|
|
|
|
after-$(GNUSTEP_INSTANCE)-all::
|
|
|
|
|
2002-03-19 13:06:56 +00:00
|
|
|
# Automatically run before-$(GNUSTEP_INSTANCE)-all before building,
|
|
|
|
# and after-$(GNUSTEP_INSTANCE)-all after building.
|
|
|
|
# The project-type specific makefile instance fragment only needs to provide
|
|
|
|
# the internal-$(GNUSTEP_TYPE)-all_ rule.
|
2002-10-31 13:58:38 +00:00
|
|
|
|
|
|
|
ifeq ($(COPY_INTO_DIR),)
|
2007-01-16 02:04:51 +00:00
|
|
|
internal-$(GNUSTEP_TYPE)-all:: internal-precompile-headers \
|
|
|
|
before-$(GNUSTEP_INSTANCE)-all \
|
2002-03-19 13:06:56 +00:00
|
|
|
internal-$(GNUSTEP_TYPE)-all_ \
|
|
|
|
after-$(GNUSTEP_INSTANCE)-all
|
2002-10-31 13:58:38 +00:00
|
|
|
else
|
2007-01-16 02:04:51 +00:00
|
|
|
internal-$(GNUSTEP_TYPE)-all:: internal-precompile-headers \
|
|
|
|
before-$(GNUSTEP_INSTANCE)-all \
|
2002-10-31 13:58:38 +00:00
|
|
|
internal-$(GNUSTEP_TYPE)-all_ \
|
|
|
|
after-$(GNUSTEP_INSTANCE)-all \
|
|
|
|
internal-$(GNUSTEP_TYPE)-copy_into_dir
|
|
|
|
# To copy into a dir, we always have to first make sure the dir exists :-)
|
|
|
|
$(COPY_INTO_DIR):
|
2003-05-27 10:19:06 +00:00
|
|
|
$(ECHO_CREATING)$(MKDIRS) $@$(END_ECHO)
|
2002-10-31 13:58:38 +00:00
|
|
|
|
|
|
|
# The specific project-type makefiles will add more commands.
|
|
|
|
internal-$(GNUSTEP_TYPE)-copy_into_dir:: $(COPY_INTO_DIR)
|
|
|
|
endif
|
2002-03-19 13:06:56 +00:00
|
|
|
|
2014-12-21 07:16:04 +00:00
|
|
|
before-$(GNUSTEP_INSTANCE)-jar::
|
|
|
|
|
|
|
|
after-$(GNUSTEP_INSTANCE)-jar::
|
|
|
|
|
2002-03-19 13:06:56 +00:00
|
|
|
before-$(GNUSTEP_INSTANCE)-install::
|
|
|
|
|
|
|
|
after-$(GNUSTEP_INSTANCE)-install::
|
|
|
|
|
2002-05-21 16:13:22 +00:00
|
|
|
before-$(GNUSTEP_INSTANCE)-uninstall::
|
|
|
|
|
|
|
|
after-$(GNUSTEP_INSTANCE)-uninstall::
|
|
|
|
|
|
|
|
# By adding the line
|
|
|
|
# xxxx_STANDARD_INSTALL = no
|
|
|
|
# to your GNUmakefile, you can disable the standard installation code
|
|
|
|
# for a certain GNUSTEP_INSTANCE. This can be useful if you are
|
|
|
|
# installing manually in some other way (or for some other reason you
|
|
|
|
# don't want installation to be performed ever) and don't want the
|
|
|
|
# standard installation to be performed. Please note that
|
|
|
|
# before-xxx-install and after-xxx-install are still executed, so if
|
|
|
|
# you want, you can add your code in those targets to perform your
|
|
|
|
# custom installation.
|
|
|
|
|
|
|
|
ifeq ($($(GNUSTEP_INSTANCE)_STANDARD_INSTALL),no)
|
|
|
|
|
2002-03-19 13:06:56 +00:00
|
|
|
internal-$(GNUSTEP_TYPE)-install:: before-$(GNUSTEP_INSTANCE)-install \
|
|
|
|
after-$(GNUSTEP_INSTANCE)-install
|
2002-05-21 16:13:22 +00:00
|
|
|
@echo "Skipping standard installation of $(GNUSTEP_INSTANCE) as requested by makefile"
|
2002-03-19 13:06:56 +00:00
|
|
|
|
2002-05-21 16:13:22 +00:00
|
|
|
internal-$(GNUSTEP_TYPE)-uninstall:: before-$(GNUSTEP_INSTANCE)-uninstall \
|
|
|
|
after-$(GNUSTEP_INSTANCE)-uninstall
|
|
|
|
@echo "Skipping standard uninstallation of $(GNUSTEP_INSTANCE) as requested by makefile"
|
2002-03-19 13:06:56 +00:00
|
|
|
|
2002-05-21 16:13:22 +00:00
|
|
|
else
|
|
|
|
|
2009-01-29 00:21:36 +00:00
|
|
|
# By adding an xxx_INSTALL_DIRS variable you can request additional
|
|
|
|
# installation directories to be created before the first installation
|
|
|
|
# target is executed. You can also have general
|
|
|
|
# ADDITIONAL_INSTALL_DIRS directories that are always created before
|
|
|
|
# install is executed; this is done top-level in the Master
|
|
|
|
# invocation.
|
|
|
|
$($(GNUSTEP_INSTANCE)_INSTALL_DIRS):
|
2003-09-03 10:01:24 +00:00
|
|
|
$(ECHO_CREATING)$(MKINSTALLDIRS) $@$(END_ECHO)
|
|
|
|
|
2009-01-29 00:21:36 +00:00
|
|
|
internal-$(GNUSTEP_TYPE)-install:: $($(GNUSTEP_INSTANCE)_INSTALL_DIRS) \
|
2003-09-03 10:01:24 +00:00
|
|
|
before-$(GNUSTEP_INSTANCE)-install \
|
2002-05-21 16:13:22 +00:00
|
|
|
internal-$(GNUSTEP_TYPE)-install_ \
|
|
|
|
after-$(GNUSTEP_INSTANCE)-install
|
2002-03-19 13:06:56 +00:00
|
|
|
|
2009-01-29 00:21:36 +00:00
|
|
|
# Here we remove the xxx_INSTALL_DIRS of this specific instance. The
|
|
|
|
# global ADDITIONAL_INSTALL_DIRS are removed in the top-level Master
|
|
|
|
# invocation. If we were to remove all of ADDITIONAL_INSTALL_DIRS
|
|
|
|
# here, we'd be doing that at every single uninstall target.
|
2002-03-19 13:06:56 +00:00
|
|
|
internal-$(GNUSTEP_TYPE)-uninstall:: before-$(GNUSTEP_INSTANCE)-uninstall \
|
|
|
|
internal-$(GNUSTEP_TYPE)-uninstall_ \
|
|
|
|
after-$(GNUSTEP_INSTANCE)-uninstall
|
2009-01-29 00:21:36 +00:00
|
|
|
ifneq ($($(GNUSTEP_INSTANCE)_INSTALL_DIRS),)
|
|
|
|
-$(ECHO_NOTHING)for dir in $($(GNUSTEP_INSTANCE)_INSTALL_DIRS); do \
|
|
|
|
rmdir $$dir ; \
|
|
|
|
done$(END_ECHO)
|
|
|
|
endif
|
2002-03-19 13:06:56 +00:00
|
|
|
|
2002-05-21 16:13:22 +00:00
|
|
|
endif
|
2002-03-19 13:06:56 +00:00
|
|
|
|
|
|
|
# before-$(GNUSTEP_INSTANCE)-clean and similar for after and distclean
|
|
|
|
# are not supported -- they wouldn't be executed most of the times, since
|
|
|
|
# most of the times we don't perform an Instance invocation at all on
|
|
|
|
# make clean or make distclean.
|
|
|
|
|
2002-01-30 17:25:53 +00:00
|
|
|
#
|
|
|
|
# The list of Objective-C source files to be compiled
|
|
|
|
# are in the OBJC_FILES variable.
|
|
|
|
#
|
|
|
|
# The list of C source files to be compiled
|
|
|
|
# are in the C_FILES variable.
|
|
|
|
#
|
|
|
|
# The list of C++ source files to be compiled
|
|
|
|
# are in the CC_FILES variable.
|
|
|
|
#
|
2005-10-06 02:10:50 +00:00
|
|
|
# The list of Objective-C++ source files to be compiled
|
|
|
|
# are in the OBJCC_FILES variable.
|
|
|
|
#
|
2002-01-30 17:25:53 +00:00
|
|
|
# The list of PSWRAP source files to be compiled
|
|
|
|
# are in the PSWRAP_FILES variable.
|
|
|
|
#
|
|
|
|
# The list of JAVA source files to be compiled
|
|
|
|
# are in the JAVA_FILES variable.
|
|
|
|
#
|
|
|
|
# The list of JAVA source files from which to generate jni headers
|
|
|
|
# are in the JAVA_JNI_FILES variable.
|
|
|
|
#
|
2007-01-16 02:04:51 +00:00
|
|
|
# The list of WINDRES source files to be compiled
|
2005-07-14 16:20:07 +00:00
|
|
|
# are in the WINDRES_FILES variable.
|
|
|
|
#
|
2002-01-30 17:25:53 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Please note the subtle difference:
|
|
|
|
#
|
|
|
|
# At `user' level (ie, in the user's GNUmakefile),
|
2010-02-12 09:19:25 +00:00
|
|
|
# the SUBPROJECTS variable is reserved for use with aggregate.make
|
|
|
|
# (this will be renamed to AGGREGATE_PROJECTS in a future version of
|
|
|
|
# gnustep-make); the xxx_SUBPROJECTS variable is reserved for use with
|
|
|
|
# subproject.make.
|
2002-01-30 17:25:53 +00:00
|
|
|
#
|
|
|
|
# This separation *must* be enforced strictly, because nothing prevents
|
|
|
|
# a GNUmakefile from including both aggregate.make and subproject.make!
|
|
|
|
#
|
|
|
|
|
2002-01-30 20:50:39 +00:00
|
|
|
ifneq ($($(GNUSTEP_INSTANCE)_SUBPROJECTS),)
|
|
|
|
SUBPROJECT_OBJ_FILES = $(foreach d, $($(GNUSTEP_INSTANCE)_SUBPROJECTS), \
|
2003-10-13 23:25:23 +00:00
|
|
|
$(addprefix $(GNUSTEP_BUILD_DIR)/$(d)/, $(GNUSTEP_OBJ_DIR_NAME)/$(SUBPROJECT_PRODUCT)))
|
2002-01-30 17:25:53 +00:00
|
|
|
endif
|
|
|
|
|
2008-07-22 15:32:35 +00:00
|
|
|
OBJC_OBJS = $(patsubst %.m,%.m$(OEXT),$($(GNUSTEP_INSTANCE)_OBJC_FILES))
|
2010-02-12 09:19:25 +00:00
|
|
|
OBJC_OBJ_FILES = $(addprefix $(GNUSTEP_OBJ_INSTANCE_DIR)/,$(OBJC_OBJS))
|
2002-01-30 17:25:53 +00:00
|
|
|
|
2008-07-22 15:32:35 +00:00
|
|
|
OBJCC_OBJS = $(patsubst %.mm,%.mm$(OEXT),$($(GNUSTEP_INSTANCE)_OBJCC_FILES))
|
2010-02-12 09:19:25 +00:00
|
|
|
OBJCC_OBJ_FILES = $(addprefix $(GNUSTEP_OBJ_INSTANCE_DIR)/,$(OBJCC_OBJS))
|
2005-10-06 02:10:50 +00:00
|
|
|
|
2002-01-30 20:50:39 +00:00
|
|
|
JAVA_OBJS = $(patsubst %.java,%.class,$($(GNUSTEP_INSTANCE)_JAVA_FILES))
|
2002-01-30 17:25:53 +00:00
|
|
|
JAVA_OBJ_FILES = $(JAVA_OBJS)
|
|
|
|
|
2002-02-08 14:41:09 +00:00
|
|
|
JAVA_JNI_OBJS = $(patsubst %.java,%.h,$($(GNUSTEP_INSTANCE)_JAVA_JNI_FILES))
|
2002-01-30 17:25:53 +00:00
|
|
|
JAVA_JNI_OBJ_FILES = $(JAVA_JNI_OBJS)
|
|
|
|
|
2002-01-30 20:50:39 +00:00
|
|
|
PSWRAP_C_FILES = $(patsubst %.psw,%.c,$($(GNUSTEP_INSTANCE)_PSWRAP_FILES))
|
|
|
|
PSWRAP_H_FILES = $(patsubst %.psw,%.h,$($(GNUSTEP_INSTANCE)_PSWRAP_FILES))
|
2008-07-22 15:32:35 +00:00
|
|
|
PSWRAP_OBJS = $(patsubst %.psw,%.c$(OEXT),$($(GNUSTEP_INSTANCE)_PSWRAP_FILES))
|
2010-02-12 09:19:25 +00:00
|
|
|
PSWRAP_OBJ_FILES = $(addprefix $(GNUSTEP_OBJ_INSTANCE_DIR)/,$(PSWRAP_OBJS))
|
2002-01-30 17:25:53 +00:00
|
|
|
|
2008-07-22 15:32:35 +00:00
|
|
|
C_OBJS = $(patsubst %.c,%.c$(OEXT),$($(GNUSTEP_INSTANCE)_C_FILES))
|
2010-02-12 09:19:25 +00:00
|
|
|
C_OBJ_FILES = $(PSWRAP_OBJ_FILES) $(addprefix $(GNUSTEP_OBJ_INSTANCE_DIR)/,$(C_OBJS))
|
2002-01-30 17:25:53 +00:00
|
|
|
|
|
|
|
# C++ files might end in .C, .cc, .cpp, .cxx, .cp so we replace multiple times
|
2008-07-22 15:32:35 +00:00
|
|
|
CC_OBJS = $(patsubst %.cc,%.cc$(OEXT),\
|
|
|
|
$(patsubst %.C,%.C$(OEXT),\
|
|
|
|
$(patsubst %.cp,%.cp$(OEXT),\
|
|
|
|
$(patsubst %.cpp,%.cpp$(OEXT),\
|
|
|
|
$(patsubst %.cxx,%.cxx$(OEXT),$($(GNUSTEP_INSTANCE)_CC_FILES))))))
|
2010-02-12 09:19:25 +00:00
|
|
|
CC_OBJ_FILES = $(addprefix $(GNUSTEP_OBJ_INSTANCE_DIR)/,$(CC_OBJS))
|
2002-01-30 17:25:53 +00:00
|
|
|
|
2005-07-14 16:20:07 +00:00
|
|
|
ifeq ($(findstring mingw32, $(GNUSTEP_TARGET_OS)), mingw32)
|
2008-07-22 15:32:35 +00:00
|
|
|
WINDRES_OBJS = $(patsubst %.rc,%.rc$(OEXT),$($(GNUSTEP_INSTANCE)_WINDRES_FILES))
|
2010-02-12 09:19:25 +00:00
|
|
|
WINDRES_OBJ_FILES = $(addprefix $(GNUSTEP_OBJ_INSTANCE_DIR)/,$(WINDRES_OBJS))
|
2005-07-14 16:20:07 +00:00
|
|
|
else
|
|
|
|
WINDRES_OBJ_FILES =
|
|
|
|
endif
|
|
|
|
|
2002-01-30 20:50:39 +00:00
|
|
|
OBJ_FILES = $($(GNUSTEP_INSTANCE)_OBJ_FILES)
|
|
|
|
|
2002-01-30 17:25:53 +00:00
|
|
|
# OBJ_FILES_TO_LINK is the set of all .o files which will be linked
|
|
|
|
# into the result - please note that you can add to OBJ_FILES_TO_LINK
|
|
|
|
# by defining manually some special xxx_OBJ_FILES for your
|
2002-05-23 11:26:10 +00:00
|
|
|
# tool/app/whatever. Strip the variable so that by comparing
|
|
|
|
# OBJ_FILES_TO_LINK to '' we know if there is a link stage to be
|
|
|
|
# performed at all (useful for example in bundles which can contain an
|
|
|
|
# object file, or not).
|
2005-10-06 02:10:50 +00:00
|
|
|
OBJ_FILES_TO_LINK = $(strip $(C_OBJ_FILES) $(OBJC_OBJ_FILES) $(CC_OBJ_FILES) $(OBJCC_OBJ_FILES) $(WINDRES_OBJ_FILES) $(SUBPROJECT_OBJ_FILES) $(OBJ_FILES))
|
2002-01-30 17:25:53 +00:00
|
|
|
|
2010-02-12 09:19:25 +00:00
|
|
|
# This is the subset of OBJ_FILES_TO_LINK that includes all the files
|
|
|
|
# that we compile ourselves. Since we compile them ourselves, we are
|
|
|
|
# responsible for creating the directories in which they are stored.
|
|
|
|
# We exclude SUBPROJECT_OBJ_FILES since we are not responsible for
|
|
|
|
# creating subproject's directories, and OBJ_FILES since again these
|
|
|
|
# are obj files already available / built using some other process
|
|
|
|
# over which we have no control, so we are not responsible for
|
|
|
|
# creating the directories for them.
|
|
|
|
OBJ_FILES_TO_LINK_THAT_WE_CREATE = $(strip $(C_OBJ_FILES) $(OBJC_OBJ_FILES) $(CC_OBJ_FILES) $(OBJCC_OBJ_FILES) $(WINDRES_OBJ_FILES))
|
|
|
|
|
2009-10-10 17:33:02 +00:00
|
|
|
# OBJ_DIRS_TO_CREATE is the set of all directories that contain
|
|
|
|
# OBJ_FILES_TO_LINK. For example, if you want to compile
|
2010-02-12 09:19:25 +00:00
|
|
|
# ./Source/File.m, you'd generate a obj/Tool/Source/File.o file, and
|
|
|
|
# we first need to create the directory obj/Tool/Source.
|
|
|
|
# Tool/Source/File.m would be in OBJC_FILES, obj/Tool/Source/File.o
|
|
|
|
# would be in OBJ_FILES_TO_LINK_WE_CREATE, and obj/Tool/Source would
|
|
|
|
# be in OBJ_DIRS_TO_CREATE.
|
2009-10-10 17:33:02 +00:00
|
|
|
#
|
|
|
|
# Explanation: $(dir ...) is used to extract the directory; $(sort
|
|
|
|
# ...) is used to remove duplicates; $(filter-out ...) is used to
|
2010-02-12 09:19:25 +00:00
|
|
|
# remove $(GNUSTEP_OBJ_INSTANCE_DIR) which would always
|
|
|
|
# appear and is already covered by default.
|
|
|
|
OBJ_DIRS_TO_CREATE = $(filter-out $(GNUSTEP_OBJ_INSTANCE_DIR)/,$(sort $(dir $(OBJ_FILES_TO_LINK_THAT_WE_CREATE))))
|
|
|
|
|
|
|
|
# Note that when doing a parallel build, we build instances in
|
|
|
|
# parallel. To prevent race conditions in building the directories or
|
|
|
|
# compiling the files, each instance has its own build directory to
|
|
|
|
# store its own object files, completely separate from the other
|
|
|
|
# instances. The GNUSTEP_OBJ_DIR is built during the Master
|
|
|
|
# invocation (so no concurrency issues there); each instance then
|
|
|
|
# builds its own GNUSTEP_OBJ_DIR/GNUSTEP_INSTANCE/ subdirectory and
|
|
|
|
# puts its object file in there.
|
2009-10-10 17:33:02 +00:00
|
|
|
$(OBJ_DIRS_TO_CREATE):
|
2010-02-11 11:11:29 +00:00
|
|
|
$(ECHO_CREATING)cd $(GNUSTEP_BUILD_DIR); $(MKDIRS) $@$(END_ECHO)
|
2010-02-12 09:19:25 +00:00
|
|
|
|
|
|
|
# The rule to create the objects file directory for this specific
|
|
|
|
# instance.
|
|
|
|
$(GNUSTEP_OBJ_INSTANCE_DIR):
|
|
|
|
$(ECHO_NOTHING)cd $(GNUSTEP_BUILD_DIR); \
|
|
|
|
$(MKDIRS) ./$(GNUSTEP_OBJ_INSTANCE_DIR_NAME)/$(END_ECHO)
|
2009-10-10 17:33:02 +00:00
|
|
|
|
2008-03-03 23:24:48 +00:00
|
|
|
# If C++ or ObjC++ are involved, we use the C++ compiler instead of
|
2009-03-24 23:08:59 +00:00
|
|
|
# the C/ObjC one to link; this happens automatically when compiling
|
|
|
|
# C++ or ObjC++ files, but we also want it to happen when linking,
|
|
|
|
# because we want g++ to be used instead of gcc to link. All the
|
|
|
|
# linking commands use $(LD) to link; this is set by default to
|
|
|
|
# be the same as $(CC). If C++ or ObjC++ is involved, we want
|
|
|
|
# to replace that one with the C++ compiler. Hence the following.
|
2008-03-03 23:24:48 +00:00
|
|
|
ifneq ($(CC_OBJ_FILES)$(OBJCC_OBJ_FILES),)
|
2009-03-24 23:08:59 +00:00
|
|
|
LD = $(CXX)
|
2008-03-03 23:24:48 +00:00
|
|
|
endif
|
|
|
|
|
2002-01-30 17:25:53 +00:00
|
|
|
ifeq ($(AUTO_DEPENDENCIES),yes)
|
|
|
|
ifneq ($(strip $(OBJ_FILES_TO_LINK)),)
|
|
|
|
-include $(addsuffix .d, $(basename $(OBJ_FILES_TO_LINK)))
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2007-01-16 02:04:51 +00:00
|
|
|
# The following is for precompiled headers, only executed if GCC
|
|
|
|
# supports them.
|
2007-01-16 17:40:33 +00:00
|
|
|
ifeq ($(GCC_WITH_PRECOMPILED_HEADERS),yes)
|
2007-01-16 02:04:51 +00:00
|
|
|
#
|
|
|
|
# The following are useful to speed up compilation by using
|
|
|
|
# precompiled headers. If GCC_WITH_PRECOMPILED_HEADERS is '', then
|
|
|
|
# these variables do nothing. If GCC_WITH_PRECOMPILED_HEADERS is yes,
|
|
|
|
# then these variables cause all the listed headers to be precompiled
|
|
|
|
# with the specified compiler before the compilation of the main files
|
|
|
|
# starts; the precompiled files will be put in the
|
|
|
|
# GNUSTEP_OBJ_DIR/PrecompiledHeaders/{language} directory, and
|
|
|
|
# -I$GNUSTEP_OBJ_DIR/PrecompiledHeaders/{language} -Winvalid-pch will
|
|
|
|
# automatically be added to the command line to make sure they are
|
|
|
|
# used.
|
|
|
|
#
|
|
|
|
# The list of C header files to be precompiled is in the
|
|
|
|
# C_PRECOMPILED_HEADERS variable
|
|
|
|
#
|
|
|
|
# The list of Objective-C header files to be precompiled is in the
|
|
|
|
# OBJC_PRECOMPILED_HEADERS variable
|
|
|
|
#
|
|
|
|
# The list of C++ header files to be precompiled is in the
|
|
|
|
# CC_PRECOMPILED_HEADERS variable
|
|
|
|
#
|
|
|
|
# The list of Objective-C++ header files to be precompiled is in the
|
|
|
|
# OBJCC_PRECOMPILED_HEADERS variable
|
|
|
|
#
|
|
|
|
|
2010-04-24 09:42:53 +00:00
|
|
|
C_PRECOMPILED_OBJS = $(patsubst %,%.gch,$($(GNUSTEP_INSTANCE)_C_PRECOMPILED_HEADERS))
|
2010-02-12 09:19:25 +00:00
|
|
|
C_PRECOMPILED_OBJ_FILES = $(addprefix $(GNUSTEP_OBJ_INSTANCE_DIR)/PrecompiledHeaders/C/,$(C_PRECOMPILED_OBJS))
|
2007-01-16 02:04:51 +00:00
|
|
|
|
2010-04-24 09:42:53 +00:00
|
|
|
OBJC_PRECOMPILED_OBJS = $(patsubst %,%.gch,$($(GNUSTEP_INSTANCE)_OBJC_PRECOMPILED_HEADERS))
|
2010-02-12 09:19:25 +00:00
|
|
|
OBJC_PRECOMPILED_OBJ_FILES = $(addprefix $(GNUSTEP_OBJ_INSTANCE_DIR)/PrecompiledHeaders/ObjC/,$(OBJC_PRECOMPILED_OBJS))
|
2007-01-16 02:04:51 +00:00
|
|
|
|
2010-04-24 09:42:53 +00:00
|
|
|
CC_PRECOMPILED_OBJS = $(patsubst %,%.gch,$($(GNUSTEP_INSTANCE)_CC_PRECOMPILED_HEADERS))
|
2010-02-12 09:19:25 +00:00
|
|
|
CC_PRECOMPILED_OBJ_FILES = $(addprefix $(GNUSTEP_OBJ_INSTANCE_DIR)/PrecompiledHeaders/CC/,$(CC_PRECOMPILED_OBJS))
|
2007-01-16 02:04:51 +00:00
|
|
|
|
2010-04-24 09:42:53 +00:00
|
|
|
OBJCC_PRECOMPILED_OBJS = $(patsubst %,%.gch,$($(GNUSTEP_INSTANCE)_OBJCC_PRECOMPILED_HEADERS))
|
2010-02-12 09:19:25 +00:00
|
|
|
OBJCC_PRECOMPILED_OBJ_FILES = $(addprefix $(GNUSTEP_OBJ_INSTANCE_DIR)/PrecompiledHeaders/ObjCC/,$(OBJCC_PRECOMPILED_OBJS))
|
2007-01-16 02:04:51 +00:00
|
|
|
|
|
|
|
# If any of those variables is not empty
|
|
|
|
ifneq ($(C_PRECOMPILED_OBJ_FILES)$(OBJC_PRECOMPILED_OBJ_FILES)$(CC_PRECOMPILED_OBJ_FILES)$(OBJCC_PRECOMPILED_OBJ_FILES),)
|
|
|
|
# Then we need to build the files before everything else!
|
|
|
|
internal-precompile-headers: $(C_PRECOMPILED_OBJ_FILES)\
|
|
|
|
$(OBJC_PRECOMPILED_OBJ_FILES)\
|
|
|
|
$(CC_PRECOMPILED_OBJ_FILES)\
|
|
|
|
$(OBJCC_PRECOMPILED_OBJ_FILES)
|
|
|
|
|
2007-01-22 01:33:39 +00:00
|
|
|
# We put all the PrecompiledHeaders/xx/ dirs in xx_PRECOMPILED_HEADERS_INCLUDE_FLAGS,
|
|
|
|
# which will be put before any other header include (this is what we want, as we
|
|
|
|
# want a precompiled header, if available, to be used in preference
|
|
|
|
# to the non-precompiled header, no matter where the non-precompiled
|
|
|
|
# header is).
|
2007-01-16 02:04:51 +00:00
|
|
|
ifneq ($(C_PRECOMPILED_OBJ_FILES),)
|
2010-02-12 09:19:25 +00:00
|
|
|
C_PRECOMPILED_HEADERS_INCLUDE_FLAGS += -I$(GNUSTEP_OBJ_INSTANCE_DIR)/PrecompiledHeaders/C
|
2007-01-16 02:04:51 +00:00
|
|
|
endif
|
|
|
|
ifneq ($(OBJC_PRECOMPILED_OBJ_FILES),)
|
2010-02-12 09:19:25 +00:00
|
|
|
OBJC_PRECOMPILED_HEADERS_INCLUDE_FLAGS += -I$(GNUSTEP_OBJ_INSTANCE_DIR)/PrecompiledHeaders/ObjC
|
2007-01-16 02:04:51 +00:00
|
|
|
endif
|
|
|
|
ifneq ($(CC_PRECOMPILED_OBJ_FILES),)
|
2010-02-12 09:19:25 +00:00
|
|
|
CC_PRECOMPILED_HEADERS_INCLUDE_FLAGS += -I$(GNUSTEP_OBJ_INSTANCE_DIR)/PrecompiledHeaders/CC
|
2007-01-16 02:04:51 +00:00
|
|
|
endif
|
|
|
|
ifneq ($(OBJCC_PRECOMPILED_OBJ_FILES),)
|
2010-02-12 09:19:25 +00:00
|
|
|
OBJCC_PRECOMPILED_HEADERS_INCLUDE_FLAGS += -I$(GNUSTEP_OBJ_INSTANCE_DIR)/PrecompiledHeaders/ObjCC
|
2007-01-16 02:04:51 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
else
|
|
|
|
internal-precompile-headers:
|
|
|
|
endif
|
|
|
|
|
|
|
|
# End of precompiled headers code
|
|
|
|
else
|
|
|
|
internal-precompile-headers:
|
|
|
|
endif
|
2002-01-30 17:01:50 +00:00
|
|
|
|
2002-03-07 16:20:00 +00:00
|
|
|
##
|
|
|
|
## Library and related special flags.
|
|
|
|
##
|
|
|
|
BUNDLE_LIBS += $($(GNUSTEP_INSTANCE)_BUNDLE_LIBS)
|
|
|
|
|
|
|
|
ADDITIONAL_INCLUDE_DIRS += $($(GNUSTEP_INSTANCE)_INCLUDE_DIRS)
|
|
|
|
|
|
|
|
ADDITIONAL_GUI_LIBS += $($(GNUSTEP_INSTANCE)_GUI_LIBS)
|
|
|
|
|
|
|
|
ADDITIONAL_TOOL_LIBS += $($(GNUSTEP_INSTANCE)_TOOL_LIBS)
|
|
|
|
|
|
|
|
ADDITIONAL_OBJC_LIBS += $($(GNUSTEP_INSTANCE)_OBJC_LIBS)
|
|
|
|
|
|
|
|
ADDITIONAL_LIBRARY_LIBS += $($(GNUSTEP_INSTANCE)_LIBS) \
|
|
|
|
$($(GNUSTEP_INSTANCE)_LIBRARY_LIBS)
|
|
|
|
|
2003-10-19 14:22:43 +00:00
|
|
|
ADDITIONAL_NATIVE_LIBS += $($(GNUSTEP_INSTANCE)_NATIVE_LIBS)
|
|
|
|
|
2002-03-07 16:20:00 +00:00
|
|
|
ADDITIONAL_LIB_DIRS += $($(GNUSTEP_INSTANCE)_LIB_DIRS)
|
|
|
|
|
2002-10-25 16:30:47 +00:00
|
|
|
ADDITIONAL_CPPFLAGS += $($(GNUSTEP_INSTANCE)_CPPFLAGS)
|
|
|
|
|
|
|
|
ADDITIONAL_CFLAGS += $($(GNUSTEP_INSTANCE)_CFLAGS)
|
|
|
|
|
|
|
|
ADDITIONAL_OBJCFLAGS += $($(GNUSTEP_INSTANCE)_OBJCFLAGS)
|
|
|
|
|
|
|
|
ADDITIONAL_CCFLAGS += $($(GNUSTEP_INSTANCE)_CCFLAGS)
|
|
|
|
|
2005-10-06 02:10:50 +00:00
|
|
|
ADDITIONAL_OBJCCFLAGS += $($(GNUSTEP_INSTANCE)_OBJCCFLAGS)
|
|
|
|
|
2002-03-07 16:20:00 +00:00
|
|
|
ADDITIONAL_LDFLAGS += $($(GNUSTEP_INSTANCE)_LDFLAGS)
|
|
|
|
|
|
|
|
ADDITIONAL_CLASSPATH += $($(GNUSTEP_INSTANCE)_CLASSPATH)
|
|
|
|
|
|
|
|
LIBRARIES_DEPEND_UPON += $($(GNUSTEP_INSTANCE)_LIBRARIES_DEPEND_UPON)
|
2003-10-19 14:22:43 +00:00
|
|
|
|
2008-02-19 10:49:20 +00:00
|
|
|
# You can control whether you want to link against the gui library
|
|
|
|
# by using one of the two commands --
|
2008-02-19 14:15:08 +00:00
|
|
|
#
|
2008-03-11 01:06:50 +00:00
|
|
|
# xxx_NEEDS_GUI = yes
|
|
|
|
# xxx_NEEDS_GUI = no
|
2008-02-19 10:49:20 +00:00
|
|
|
# (where 'xxx' is the name of your application/bundle/etc.)
|
|
|
|
#
|
2008-02-19 14:15:08 +00:00
|
|
|
# You can also change it for all applications/bundles/etc by doing
|
|
|
|
#
|
2008-03-11 01:06:50 +00:00
|
|
|
# NEEDS_GUI = yes (or no)
|
2008-02-19 14:15:08 +00:00
|
|
|
#
|
|
|
|
# If you don't specify anything, the default for the project type will
|
2008-03-11 01:06:50 +00:00
|
|
|
# be used (this is the NEEDS_GUI = yes/no that is at the top of all
|
2008-02-19 14:15:08 +00:00
|
|
|
# project types).
|
2008-02-19 10:49:20 +00:00
|
|
|
#
|
|
|
|
# If the project type doesn't specify anything (eg, doesn't need
|
|
|
|
# linking to ObjC libraries, or it is buggy/old or it is from a
|
|
|
|
# third-party and hasn't been updated yet) then the default is NO.
|
|
|
|
|
2008-02-19 14:15:08 +00:00
|
|
|
INTERNAL_NEEDS_GUI = $($(GNUSTEP_INSTANCE)_NEEDS_GUI)
|
2008-02-19 10:49:20 +00:00
|
|
|
|
2008-02-19 14:15:08 +00:00
|
|
|
ifeq ($(INTERNAL_NEEDS_GUI),)
|
2008-02-19 10:49:20 +00:00
|
|
|
|
2008-02-19 14:15:08 +00:00
|
|
|
INTERNAL_NEEDS_GUI = $(NEEDS_GUI)
|
2008-02-19 10:49:20 +00:00
|
|
|
|
2008-02-19 14:15:08 +00:00
|
|
|
ifeq ($(INTERNAL_NEEDS_GUI),)
|
2008-03-11 01:06:50 +00:00
|
|
|
INTERNAL_NEEDS_GUI = no
|
2008-02-19 10:49:20 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
2008-03-11 01:06:50 +00:00
|
|
|
# Recognize 'YES' as well as 'yes'
|
|
|
|
ifeq ($(INTERNAL_NEEDS_GUI),YES)
|
|
|
|
INTERNAL_NEEDS_GUI = yes
|
|
|
|
endif
|
|
|
|
|
2008-02-19 10:49:20 +00:00
|
|
|
# Now we prepare a variable, ALL_LIBS, containing the list of all LIBS
|
|
|
|
# that should be used when linking. This is different depending on
|
|
|
|
# whether we need to link against the gui library or not.
|
2008-03-11 01:06:50 +00:00
|
|
|
ifeq ($(INTERNAL_NEEDS_GUI), yes)
|
2008-02-19 10:49:20 +00:00
|
|
|
# Please note that you usually need to add ALL_LIB_DIRS before
|
|
|
|
# ALL_LIBS when linking. It's kept separate because sometimes (eg,
|
|
|
|
# bundles) we only use ALL_LIB_DIRS and not ALL_LIBS (not sure how
|
|
|
|
# useful ALL_LIB_DIRS would be without ALL_LIBS, anyway touching flags
|
|
|
|
# is dangerous as things might stop compiling for some people who
|
|
|
|
# were relying on the old behaviour)
|
|
|
|
ALL_LIBS = \
|
|
|
|
$(ADDITIONAL_GUI_LIBS) $(AUXILIARY_GUI_LIBS) $(GUI_LIBS) \
|
|
|
|
$(BACKEND_LIBS) $(ADDITIONAL_TOOL_LIBS) $(AUXILIARY_TOOL_LIBS) \
|
|
|
|
$(FND_LIBS) $(ADDITIONAL_OBJC_LIBS) $(AUXILIARY_OBJC_LIBS) $(OBJC_LIBS) \
|
|
|
|
$(SYSTEM_LIBS) $(TARGET_SYSTEM_LIBS)
|
|
|
|
else
|
|
|
|
ALL_LIBS = \
|
|
|
|
$(ADDITIONAL_TOOL_LIBS) $(AUXILIARY_TOOL_LIBS) \
|
|
|
|
$(FND_LIBS) $(ADDITIONAL_OBJC_LIBS) $(AUXILIARY_OBJC_LIBS) $(OBJC_LIBS) \
|
|
|
|
$(SYSTEM_LIBS) $(TARGET_SYSTEM_LIBS)
|
|
|
|
endif
|
|
|
|
|
2010-08-21 09:20:40 +00:00
|
|
|
#
|
|
|
|
# Determine the languages used by this instance. This is used in
|
|
|
|
# various places (bundles, resource sets, make_strings) where language
|
|
|
|
# resources are managed.
|
|
|
|
#
|
|
|
|
LANGUAGES = $(strip $($(GNUSTEP_INSTANCE)_LANGUAGES))
|
|
|
|
|
|
|
|
ifeq ($(LANGUAGES),)
|
|
|
|
LANGUAGES = English
|
|
|
|
endif
|
2013-12-27 16:23:08 +00:00
|
|
|
|
|
|
|
# You can have a single xxxInfo.plist for both GNUstep and Apple.
|
|
|
|
# Often enough, you can just put in it all fields required by both
|
|
|
|
# GNUstep and Apple; if there is a conflict, you can provide
|
|
|
|
# axxxInfo.cplist (please note the suffix!) - that file is
|
|
|
|
# automatically run through the C preprocessor to generate a
|
|
|
|
# xxxInfo.plist file from it. The preprocessor will define GNUSTEP
|
|
|
|
# when using gnustep-base, APPLE when using Apple FoundationKit, NEXT
|
|
|
|
# when using NeXT/OPENStep FoundationKit, and UNKNOWN when using
|
|
|
|
# something else, so you can use
|
|
|
|
# #ifdef GNUSTEP
|
|
|
|
# ... some plist code for GNUstep ...
|
|
|
|
# #else
|
|
|
|
# ... some plist code for Apple ...
|
|
|
|
# #endif
|
|
|
|
# to have your .cplist use different code for each.
|
|
|
|
#
|
|
|
|
|
|
|
|
# Our problem is that we'd like to always depend on xxxInfo.plist if
|
|
|
|
# it's there, and not depend on it if it's not there - which we solve
|
|
|
|
# by expanding $(wildcard $(GNUSTEP_INSTANCE)Info.plist)
|
|
|
|
GNUSTEP_PLIST_DEPEND = $(wildcard $(GNUSTEP_INSTANCE)Info.plist)
|
|
|
|
|
|
|
|
# older versions of XCode use the form Info-xxx.plist
|
|
|
|
ifeq ($(GNUSTEP_PLIST_DEPEND),)
|
|
|
|
GNUSTEP_PLIST_DEPEND = $(wildcard Info-$(GNUSTEP_INSTANCE).plist)
|
|
|
|
endif
|
|
|
|
|
|
|
|
# Newer versions of XCode use the form xxx-Info.plist
|
|
|
|
ifeq ($(GNUSTEP_PLIST_DEPEND),)
|
|
|
|
GNUSTEP_PLIST_DEPEND = $(wildcard $(GNUSTEP_INSTANCE)-Info.plist)
|
|
|
|
endif
|
|
|
|
|
|
|
|
# As a special case, if xxxInfo.cplist is there, in this case as well
|
|
|
|
# we'd like to depend on xxxInfo.plist.
|
|
|
|
ifeq ($(GNUSTEP_PLIST_DEPEND),)
|
|
|
|
# xxxInfo.plist is not there. Check if xxxInfo.cplist is there, and
|
|
|
|
# if so, convert it to xxxInfo.plist and add it to the dependencies.
|
|
|
|
GNUSTEP_PLIST_DEPEND = $(patsubst %.cplist,%.plist,$(wildcard $(GNUSTEP_INSTANCE)Info.cplist))
|
|
|
|
endif
|