2002-11-06 10:59:19 +00:00
|
|
|
# -*-makefile-*-
|
2002-02-22 12:49:08 +00:00
|
|
|
# Instance/tool.make
|
|
|
|
#
|
|
|
|
# Instance Makefile rules to build GNUstep-based command line tools.
|
|
|
|
#
|
|
|
|
# Copyright (C) 1997, 2001 Free Software Foundation, Inc.
|
|
|
|
#
|
|
|
|
# Author: Scott Christley <scottc@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-11-07 18:56:37 +00:00
|
|
|
# as published by the Free Software Foundation; either version 3
|
2002-02-22 12:49:08 +00:00
|
|
|
# of the License, or (at your option) any later version.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public
|
2007-11-07 18:56:37 +00:00
|
|
|
# License along with this library; see the file COPYING.
|
2002-02-22 12:49:08 +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-02-22 12:49:08 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# The name of the tools is in the TOOL_NAME variable.
|
|
|
|
#
|
|
|
|
# xxx We need to prefix the target name when cross-compiling
|
|
|
|
#
|
|
|
|
|
|
|
|
ifeq ($(RULES_MAKE_LOADED),)
|
|
|
|
include $(GNUSTEP_MAKEFILES)/rules.make
|
|
|
|
endif
|
|
|
|
|
2002-03-19 13:06:56 +00:00
|
|
|
.PHONY: internal-tool-all_ \
|
|
|
|
internal-tool-install_ \
|
|
|
|
internal-tool-uninstall_ \
|
2002-10-31 21:01:17 +00:00
|
|
|
internal-tool-copy_into_dir
|
2002-02-22 12:49:08 +00:00
|
|
|
|
2002-09-26 00:29:51 +00:00
|
|
|
# This is the directory where the tools get installed. If you don't specify a
|
|
|
|
# directory they will get installed in the GNUstep Local Root.
|
2004-01-16 17:04:48 +00:00
|
|
|
ifneq ($($(GNUSTEP_INSTANCE)_INSTALL_DIR),)
|
2004-10-18 15:32:39 +00:00
|
|
|
TOOL_INSTALL_DIR = $($(GNUSTEP_INSTANCE)_INSTALL_DIR)
|
2004-01-16 17:04:48 +00:00
|
|
|
endif
|
|
|
|
|
2002-09-26 00:29:51 +00:00
|
|
|
ifeq ($(TOOL_INSTALL_DIR),)
|
|
|
|
TOOL_INSTALL_DIR = $(GNUSTEP_TOOLS)
|
|
|
|
endif
|
|
|
|
|
2002-12-20 15:25:10 +00:00
|
|
|
# This is the 'final' directory in which we copy the tool executable, including
|
|
|
|
# the target and library-combo paths. You can override it in special occasions
|
|
|
|
# (eg, installing an executable into a web server's cgi dir).
|
|
|
|
ifeq ($(FINAL_TOOL_INSTALL_DIR),)
|
|
|
|
FINAL_TOOL_INSTALL_DIR = $(TOOL_INSTALL_DIR)/$(GNUSTEP_TARGET_LDIR)
|
|
|
|
endif
|
|
|
|
|
2002-02-22 12:49:08 +00:00
|
|
|
ALL_TOOL_LIBS = \
|
|
|
|
$(ALL_LIB_DIRS) \
|
|
|
|
$(ADDITIONAL_TOOL_LIBS) $(AUXILIARY_TOOL_LIBS) $(FND_LIBS) \
|
2005-08-08 15:04:07 +00:00
|
|
|
$(ADDITIONAL_OBJC_LIBS) $(AUXILIARY_OBJC_LIBS) $(OBJC_LIBS) \
|
2006-09-08 11:19:09 +00:00
|
|
|
$(TARGET_SYSTEM_LIBS)
|
2002-02-22 12:49:08 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Compilation targets
|
|
|
|
#
|
2002-03-19 13:06:56 +00:00
|
|
|
internal-tool-all_:: $(GNUSTEP_OBJ_DIR) \
|
|
|
|
$(GNUSTEP_OBJ_DIR)/$(GNUSTEP_INSTANCE)$(EXEEXT)
|
2002-02-22 12:49:08 +00:00
|
|
|
|
2002-02-22 13:12:00 +00:00
|
|
|
$(GNUSTEP_OBJ_DIR)/$(GNUSTEP_INSTANCE)$(EXEEXT): $(OBJ_FILES_TO_LINK)
|
2005-09-22 22:07:57 +00:00
|
|
|
$(ECHO_LINKING)$(LD) $(ALL_LDFLAGS) $(CC_LDFLAGS) -o $(LDOUT)$@ \
|
2002-02-22 12:49:08 +00:00
|
|
|
$(OBJ_FILES_TO_LINK) \
|
2002-06-13 16:19:54 +00:00
|
|
|
$(ALL_TOOL_LIBS)$(END_ECHO)
|
2002-02-22 12:49:08 +00:00
|
|
|
|
2002-10-31 13:59:06 +00:00
|
|
|
internal-tool-copy_into_dir::
|
|
|
|
$(ECHO_COPYING_INTO_DIR)$(MKDIRS) $(COPY_INTO_DIR)/$(GNUSTEP_TARGET_LDIR);\
|
|
|
|
$(INSTALL_PROGRAM) -m 0755 \
|
|
|
|
$(GNUSTEP_OBJ_DIR)/$(GNUSTEP_INSTANCE)$(EXEEXT) \
|
|
|
|
$(COPY_INTO_DIR)/$(GNUSTEP_TARGET_LDIR)$(END_ECHO)
|
2002-02-22 12:49:08 +00:00
|
|
|
|
|
|
|
# This rule runs $(MKDIRS) only if needed
|
2002-12-20 15:25:10 +00:00
|
|
|
$(FINAL_TOOL_INSTALL_DIR):
|
2003-05-27 10:19:06 +00:00
|
|
|
$(ECHO_CREATING)$(MKINSTALLDIRS) $@$(END_ECHO)
|
2002-02-22 12:49:08 +00:00
|
|
|
|
2002-12-20 15:25:10 +00:00
|
|
|
internal-tool-install_:: $(FINAL_TOOL_INSTALL_DIR)
|
2002-06-13 16:19:54 +00:00
|
|
|
$(ECHO_INSTALLING)$(INSTALL_PROGRAM) -m 0755 \
|
2002-02-22 13:12:00 +00:00
|
|
|
$(GNUSTEP_OBJ_DIR)/$(GNUSTEP_INSTANCE)$(EXEEXT) \
|
2002-12-20 15:25:10 +00:00
|
|
|
$(FINAL_TOOL_INSTALL_DIR)$(END_ECHO)
|
2002-02-22 12:49:08 +00:00
|
|
|
|
2002-03-19 13:06:56 +00:00
|
|
|
internal-tool-uninstall_::
|
2002-12-20 15:25:10 +00:00
|
|
|
rm -f $(FINAL_TOOL_INSTALL_DIR)/$(GNUSTEP_INSTANCE)$(EXEEXT)
|
2002-02-22 12:49:08 +00:00
|
|
|
|
2002-10-31 21:01:17 +00:00
|
|
|
# NB: We don't have any cleaning targets for tools here, because we
|
|
|
|
# clean during the Master make invocation.
|
2002-02-22 12:49:08 +00:00
|
|
|
|
2002-09-26 01:18:21 +00:00
|
|
|
#
|
|
|
|
# If the user makefile contains the command
|
|
|
|
# xxx_HAS_RESOURCE_BUNDLE = yes
|
|
|
|
# then we need to build a resource bundle for the tool, and install it.
|
|
|
|
# You can then add resources to the tool, any sort of, with the usual
|
|
|
|
# xxx_RESOURCE_FILES, xxx_LOCALIZED_RESOURCE_FILES, xxx_LANGUAGES, etc.
|
|
|
|
# The tool resource bundle (and all resources inside it) can be
|
|
|
|
# accessed at runtime very comfortably, by using gnustep-base's
|
|
|
|
# [NSBundle +mainBundle] (exactly as you would do for an application).
|
|
|
|
#
|
|
|
|
ifeq ($($(GNUSTEP_INSTANCE)_HAS_RESOURCE_BUNDLE),yes)
|
|
|
|
|
|
|
|
# Include the rules to build resource bundles
|
2006-09-19 01:59:55 +00:00
|
|
|
GNUSTEP_SHARED_BUNDLE_RESOURCE_PATH = $(GNUSTEP_BUILD_DIR)/Resources/$(GNUSTEP_INSTANCE)
|
2007-03-09 17:27:55 +00:00
|
|
|
|
|
|
|
GNUSTEP_SHARED_BUNDLE_INSTALL_NAME = $(GNUSTEP_INSTANCE)
|
|
|
|
GNUSTEP_SHARED_BUNDLE_INSTALL_LOCAL_PATH = Resources
|
|
|
|
GNUSTEP_SHARED_BUNDLE_INSTALL_PATH = $(GNUSTEP_LIBRARY)/Tools/Resources
|
2002-09-26 01:18:21 +00:00
|
|
|
include $(GNUSTEP_MAKEFILES)/Instance/Shared/bundle.make
|
|
|
|
|
|
|
|
internal-tool-all_:: shared-instance-bundle-all
|
2002-10-31 13:59:06 +00:00
|
|
|
internal-tool-copy_into_dir:: shared-instance-bundle-copy_into_dir
|
2002-09-26 01:18:21 +00:00
|
|
|
|
|
|
|
$(TOOL_INSTALL_DIR):
|
2003-05-27 10:19:06 +00:00
|
|
|
$(ECHO_CREATING)$(MKINSTALLDIRS) $@$(END_ECHO)
|
2002-09-26 01:18:21 +00:00
|
|
|
|
2007-03-09 17:27:55 +00:00
|
|
|
$(GNUSTEP_LIBRARY)/Tools/Resources:
|
2003-05-27 10:19:06 +00:00
|
|
|
$(ECHO_CREATING)$(MKINSTALLDIRS) $@$(END_ECHO)
|
2002-09-26 01:18:21 +00:00
|
|
|
|
2007-03-09 17:27:55 +00:00
|
|
|
internal-tool-install_:: $(GNUSTEP_LIBRARY)/Tools/Resources \
|
|
|
|
shared-instance-bundle-install
|
2002-09-26 01:18:21 +00:00
|
|
|
|
|
|
|
internal-tool-uninstall:: shared-instance-bundle-uninstall
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
2002-10-22 00:27:39 +00:00
|
|
|
include $(GNUSTEP_MAKEFILES)/Instance/Shared/strings.make
|