2002-02-22 13:15:51 +00:00
|
|
|
#
|
|
|
|
# Instance/service.make
|
|
|
|
#
|
|
|
|
# Instance Makefile rules to build GNUstep-based services.
|
|
|
|
#
|
|
|
|
# Copyright (C) 1998, 2001 Free Software Foundation, Inc.
|
|
|
|
#
|
|
|
|
# Author: Richard Frith-Macdonald <richard@brainstorm.co.uk>
|
|
|
|
# Based on the makefiles by Scott Christley.
|
|
|
|
# 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 13:15:51 +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 13:15:51 +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 13:15:51 +00:00
|
|
|
|
|
|
|
ifeq ($(RULES_MAKE_LOADED),)
|
|
|
|
include $(GNUSTEP_MAKEFILES)/rules.make
|
|
|
|
endif
|
|
|
|
|
|
|
|
#
|
|
|
|
# The name of the service is in the SERVICE_NAME variable.
|
|
|
|
# The NSServices info should be in $(SERVICE_NAME)Info.plist
|
|
|
|
# The list of service resource file are in xxx_RESOURCE_FILES
|
|
|
|
# The list of service resource directories are in xxx_RESOURCE_DIRS
|
|
|
|
# where xxx is the service name
|
|
|
|
#
|
|
|
|
|
2002-03-19 13:06:56 +00:00
|
|
|
.PHONY: internal-service-all_ \
|
|
|
|
internal-service-install_ \
|
|
|
|
internal-service-uninstall_ \
|
2004-03-04 11:01:19 +00:00
|
|
|
internal-service-copy_into_dir \
|
2002-02-22 13:15:51 +00:00
|
|
|
service-resource-files
|
|
|
|
|
|
|
|
# Libraries that go before the GUI libraries
|
|
|
|
ALL_SERVICE_LIBS = \
|
|
|
|
$(ALL_LIB_DIRS) \
|
|
|
|
$(ADDITIONAL_GUI_LIBS) $(AUXILIARY_GUI_LIBS) \
|
|
|
|
$(GUI_LIBS) $(ADDITIONAL_TOOL_LIBS) $(AUXILIARY_TOOL_LIBS) \
|
2005-08-08 15:04:07 +00:00
|
|
|
$(FND_LIBS) $(ADDITIONAL_OBJC_LIBS) $(AUXILIARY_OBJC_LIBS) \
|
2006-09-08 11:19:09 +00:00
|
|
|
$(OBJC_LIBS) $(SYSTEM_LIBS) $(TARGET_SYSTEM_LIBS)
|
2002-02-22 13:15:51 +00:00
|
|
|
|
|
|
|
# Don't include these definitions the first time make is invoked. This part is
|
|
|
|
# included when make is invoked the second time from the %.build rule (see
|
|
|
|
# rules.make).
|
|
|
|
SERVICE_DIR_NAME = $(GNUSTEP_INSTANCE:=.service)
|
2003-10-13 23:25:23 +00:00
|
|
|
SERVICE_DIR = $(GNUSTEP_BUILD_DIR)/$(SERVICE_DIR_NAME)
|
2002-02-22 13:15:51 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Internal targets
|
|
|
|
#
|
2003-10-13 23:25:23 +00:00
|
|
|
SERVICE_FILE_NAME = $(SERVICE_DIR_NAME)/$(GNUSTEP_TARGET_LDIR)/$(GNUSTEP_INSTANCE)
|
|
|
|
SERVICE_FILE = $(GNUSTEP_BUILD_DIR)/$(SERVICE_FILE_NAME)
|
2002-02-22 13:15:51 +00:00
|
|
|
|
2004-01-16 17:04:48 +00:00
|
|
|
ifneq ($($(GNUSTEP_INSTANCE)_INSTALL_DIR),)
|
|
|
|
SERVICE_INSTALL_DIR = $($(GNUSTEP_INSTANCE)_INSTALL_DIR)
|
|
|
|
endif
|
|
|
|
|
2003-10-12 16:44:29 +00:00
|
|
|
ifeq ($(SERVICE_INSTALL_DIR),)
|
|
|
|
SERVICE_INSTALL_DIR = $(GNUSTEP_SERVICES)
|
|
|
|
endif
|
|
|
|
|
2003-10-13 23:25:23 +00:00
|
|
|
GNUSTEP_SHARED_BUNDLE_RESOURCE_PATH = $(SERVICE_DIR)/Resources
|
2007-03-09 19:22:11 +00:00
|
|
|
GNUSTEP_SHARED_BUNDLE_INSTALL_NAME = $(SERVICE_DIR_NAME)
|
|
|
|
GNUSTEP_SHARED_BUNDLE_INSTALL_LOCAL_PATH = .
|
|
|
|
GNUSTEP_SHARED_BUNDLE_INSTALL_PATH = $(SERVICE_INSTALL_DIR)
|
2002-03-01 15:35:25 +00:00
|
|
|
include $(GNUSTEP_MAKEFILES)/Instance/Shared/bundle.make
|
2002-02-22 13:15:51 +00:00
|
|
|
|
2002-03-19 13:06:56 +00:00
|
|
|
internal-service-all_:: $(GNUSTEP_OBJ_DIR) \
|
2003-10-13 23:25:23 +00:00
|
|
|
$(SERVICE_DIR)/$(GNUSTEP_TARGET_LDIR) \
|
2002-03-19 13:06:56 +00:00
|
|
|
$(SERVICE_FILE) \
|
2003-10-13 23:25:23 +00:00
|
|
|
$(SERVICE_DIR)/Resources/Info-gnustep.plist \
|
2002-03-19 13:06:56 +00:00
|
|
|
shared-instance-bundle-all
|
2002-02-22 13:15:51 +00:00
|
|
|
|
2002-03-01 15:35:25 +00:00
|
|
|
$(SERVICE_FILE): $(OBJ_FILES_TO_LINK)
|
2005-09-22 22:07:57 +00:00
|
|
|
$(ECHO_LINKING)$(LD) $(ALL_LDFLAGS) $(CC_LDFLAGS) -o $(LDOUT)$@ \
|
|
|
|
$(OBJ_FILES_TO_LINK) $(ALL_SERVICE_LIBS)$(END_ECHO)
|
2002-03-01 15:35:25 +00:00
|
|
|
|
2003-10-13 23:25:23 +00:00
|
|
|
$(SERVICE_DIR)/$(GNUSTEP_TARGET_LDIR):
|
|
|
|
$(ECHO_CREATING)$(MKDIRS) $(SERVICE_DIR)/$(GNUSTEP_TARGET_LDIR)$(END_ECHO)
|
2002-02-22 13:15:51 +00:00
|
|
|
|
|
|
|
|
|
|
|
# Allow the gui library to redefine make_services to use its local one
|
|
|
|
ifeq ($(GNUSTEP_MAKE_SERVICES),)
|
|
|
|
GNUSTEP_MAKE_SERVICES = make_services
|
|
|
|
endif
|
|
|
|
|
2007-03-16 12:23:56 +00:00
|
|
|
# Depend on xxxInfo.plist but only if it exists.
|
|
|
|
GNUSTEP_PLIST_DEPEND = $(wildcard $(GNUSTEP_INSTANCE)Info.plist)
|
|
|
|
|
|
|
|
ifeq ($(GNUSTEP_PLIST_DEPEND),)
|
|
|
|
$(warning Service $(GNUSTEP_INSTANCE) missing $(GNUSTEP_INSTANCE)Info.plist)
|
|
|
|
endif
|
|
|
|
|
|
|
|
# FIXME - xxxInfo.plist in this case is not really a plist!
|
|
|
|
|
2003-10-13 23:25:23 +00:00
|
|
|
$(SERVICE_DIR)/Resources/Info-gnustep.plist: \
|
2007-03-16 12:23:56 +00:00
|
|
|
$(SERVICE_DIR)/Resources $(GNUSTEP_PLIST_DEPEND)
|
2003-05-27 10:35:01 +00:00
|
|
|
$(ECHO_CREATING)(echo "{"; echo ' NOTE = "Automatically generated, do not edit!";'; \
|
2002-02-22 13:15:51 +00:00
|
|
|
echo " NSExecutable = \"$(GNUSTEP_INSTANCE)\";"; \
|
2007-03-16 12:23:56 +00:00
|
|
|
if [ -r "$(GNUSTEP_INSTANCE)Info.plist" ]; then \
|
|
|
|
cat $(GNUSTEP_INSTANCE)Info.plist; \
|
|
|
|
fi; \
|
2002-02-22 13:15:51 +00:00
|
|
|
echo "}") >$@ ;\
|
|
|
|
if $(GNUSTEP_MAKE_SERVICES) --test $@; then : ; else rm -f $@; false; \
|
2003-05-27 10:35:01 +00:00
|
|
|
fi$(END_ECHO)
|
2002-02-22 13:15:51 +00:00
|
|
|
|
2004-03-04 11:01:19 +00:00
|
|
|
internal-service-copy_into_dir:: shared-instance-bundle-copy_into_dir
|
|
|
|
|
2002-03-01 15:35:25 +00:00
|
|
|
#
|
|
|
|
# Install targets
|
|
|
|
#
|
2003-10-12 16:44:29 +00:00
|
|
|
$(SERVICE_INSTALL_DIR):
|
2003-05-27 10:19:06 +00:00
|
|
|
$(ECHO_CREATING)$(MKINSTALLDIRS) $@$(END_ECHO)
|
2002-02-22 13:15:51 +00:00
|
|
|
|
2003-10-12 16:44:29 +00:00
|
|
|
internal-service-install_:: shared-instance-bundle-install
|
2002-02-22 13:15:51 +00:00
|
|
|
ifeq ($(strip),yes)
|
2003-10-13 23:25:23 +00:00
|
|
|
$(ECHO_STRIPPING)$(STRIP) $(SERVICE_INSTALL_DIR)/$(SERVICE_FILE_NAME)$(END_ECHO)
|
2002-02-22 13:15:51 +00:00
|
|
|
endif
|
|
|
|
|
2003-10-12 16:44:29 +00:00
|
|
|
internal-service-uninstall_:: shared-instance-bundle-uninstall
|
2002-02-22 13:15:51 +00:00
|
|
|
|
2002-10-22 00:27:39 +00:00
|
|
|
include $(GNUSTEP_MAKEFILES)/Instance/Shared/strings.make
|