2009-02-16 11:21:57 +00:00
|
|
|
# -*-makefile-*-
|
2002-02-27 16:35:07 +00:00
|
|
|
# Instance/palette.make
|
|
|
|
#
|
|
|
|
# Instance Makefile rules to build GNUstep-based palettes.
|
|
|
|
#
|
|
|
|
# Copyright (C) 1999 Free Software Foundation, Inc.
|
|
|
|
#
|
|
|
|
# Author: Scott Christley <scottc@net-community.com>
|
|
|
|
# Author: Ovidiu Predescu <ovidiu@net-community.com>
|
|
|
|
# Author: Richard Frith-Macdonald <richard@brainstorm.co.uk>
|
|
|
|
# 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-02-27 16:35:07 +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-02-27 16:35:07 +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-27 16:35:07 +00:00
|
|
|
|
2008-02-19 10:49:20 +00:00
|
|
|
# Palettes usually link against a gui library (if available).
|
2008-02-19 14:15:08 +00:00
|
|
|
ifeq ($(NEEDS_GUI),)
|
2008-03-11 01:06:50 +00:00
|
|
|
NEEDS_GUI = yes
|
2008-02-19 14:15:08 +00:00
|
|
|
endif
|
2008-02-19 10:49:20 +00:00
|
|
|
|
2002-02-27 16:35:07 +00:00
|
|
|
ifeq ($(RULES_MAKE_LOADED),)
|
|
|
|
include $(GNUSTEP_MAKEFILES)/rules.make
|
|
|
|
endif
|
|
|
|
|
|
|
|
# The name of the palette is in the PALETTE_NAME variable.
|
|
|
|
# The list of palette resource file are in xxx_RESOURCE_FILES
|
|
|
|
# The list of palette resource directories are in xxx_RESOURCE_DIRS
|
|
|
|
# The name of the palette class is xxx_PRINCIPAL_CLASS
|
|
|
|
# The name of the palette nib is xxx_MAIN_MODEL_FILE
|
|
|
|
# The name of the palette icon is xxx_PALETTE_ICON
|
|
|
|
# The name of a file containing info.plist entries to be inserted into
|
|
|
|
# Info-gnustep.plist (if any) is xxxInfo.plist where xxx is the palette name
|
|
|
|
# The name of a file containing palette.table entries to be inserted into
|
|
|
|
# palette.table (if any) is xxxpalette.table where xxx is the palette name
|
|
|
|
#
|
|
|
|
|
2002-03-19 13:06:56 +00:00
|
|
|
.PHONY: internal-palette-all_ \
|
|
|
|
internal-palette-install_ \
|
2004-03-04 11:01:19 +00:00
|
|
|
internal-palette-uninstall_ \
|
2009-02-23 11:12:11 +00:00
|
|
|
internal-palette-copy_into_dir \
|
|
|
|
internal-palette-run-compile-submake \
|
|
|
|
internal-palette-compile
|
2002-02-27 16:35:07 +00:00
|
|
|
|
2004-03-18 00:03:56 +00:00
|
|
|
# On windows, this is unfortunately required.
|
2005-03-10 04:28:35 +00:00
|
|
|
ifeq ($(BUILD_DLL), yes)
|
2004-03-18 00:03:56 +00:00
|
|
|
LINK_PALETTE_AGAINST_ALL_LIBS = yes
|
|
|
|
endif
|
|
|
|
|
|
|
|
# On Apple, two-level namespaces require all symbols in bundles
|
2007-02-16 16:40:13 +00:00
|
|
|
# to be resolved at link time. Also on gnu/darwin
|
|
|
|
ifeq ($(CC_BUNDLE), yes)
|
2004-03-18 00:03:56 +00:00
|
|
|
LINK_PALETTE_AGAINST_ALL_LIBS = yes
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(LINK_PALETTE_AGAINST_ALL_LIBS), yes)
|
2008-02-19 10:49:20 +00:00
|
|
|
PALETTE_LIBS += $(ALL_LIBS)
|
2004-03-18 00:03:56 +00:00
|
|
|
endif
|
|
|
|
|
2005-03-10 04:28:35 +00:00
|
|
|
ifeq ($(BUILD_DLL),yes)
|
2004-03-18 00:03:56 +00:00
|
|
|
PALETTE_OBJ_EXT = $(DLL_LIBEXT)
|
|
|
|
endif
|
2002-02-27 16:35:07 +00:00
|
|
|
|
2002-03-01 15:25:42 +00:00
|
|
|
PALETTE_DIR_NAME = $(GNUSTEP_INSTANCE).palette
|
2003-10-13 23:25:23 +00:00
|
|
|
PALETTE_DIR = $(GNUSTEP_BUILD_DIR)/$(PALETTE_DIR_NAME)
|
2004-03-18 00:03:56 +00:00
|
|
|
PALETTE_FILE_NAME = $(PALETTE_DIR_NAME)/$(GNUSTEP_TARGET_LDIR)/$(PALETTE_NAME)$(PALETTE_OBJ_EXT)
|
2003-10-13 23:25:23 +00:00
|
|
|
PALETTE_FILE = $(GNUSTEP_BUILD_DIR)/$(PALETTE_FILE_NAME)
|
2002-03-01 15:25:42 +00:00
|
|
|
|
2004-01-16 17:04:48 +00:00
|
|
|
ifneq ($($(GNUSTEP_INSTANCE)_INSTALL_DIR),)
|
|
|
|
PALETTE_INSTALL_DIR = $($(GNUSTEP_INSTANCE)_INSTALL_DIR)
|
|
|
|
endif
|
|
|
|
|
2003-10-12 16:44:29 +00:00
|
|
|
ifeq ($(PALETTE_INSTALL_DIR),)
|
|
|
|
PALETTE_INSTALL_DIR = $(GNUSTEP_PALETTES)
|
|
|
|
endif
|
|
|
|
|
2003-10-13 23:25:23 +00:00
|
|
|
GNUSTEP_SHARED_BUNDLE_RESOURCE_PATH = $(PALETTE_DIR)/Resources
|
2007-03-09 19:22:11 +00:00
|
|
|
|
|
|
|
GNUSTEP_SHARED_BUNDLE_INSTALL_NAME = $(PALETTE_DIR_NAME)
|
|
|
|
GNUSTEP_SHARED_BUNDLE_INSTALL_LOCAL_PATH = .
|
|
|
|
GNUSTEP_SHARED_BUNDLE_INSTALL_PATH = $(PALETTE_INSTALL_DIR)
|
2002-03-01 15:25:42 +00:00
|
|
|
include $(GNUSTEP_MAKEFILES)/Instance/Shared/bundle.make
|
|
|
|
|
2010-02-12 09:19:25 +00:00
|
|
|
internal-palette-all_:: $(GNUSTEP_OBJ_INSTANCE_DIR) \
|
2009-10-10 17:33:02 +00:00
|
|
|
$(OBJ_DIRS_TO_CREATE) \
|
2003-10-13 23:25:23 +00:00
|
|
|
$(PALETTE_DIR)/Resources \
|
|
|
|
$(PALETTE_DIR)/$(GNUSTEP_TARGET_LDIR) \
|
2009-02-16 11:21:57 +00:00
|
|
|
internal-palette-run-compile-submake \
|
2003-10-13 23:25:23 +00:00
|
|
|
$(PALETTE_DIR)/Resources/Info-gnustep.plist \
|
|
|
|
$(PALETTE_DIR)/Resources/palette.table \
|
2002-03-19 13:06:56 +00:00
|
|
|
shared-instance-bundle-all
|
2009-10-10 14:59:24 +00:00
|
|
|
# If they specified Info-gnustep.plist in the xxx_RESOURCE_FILES,
|
|
|
|
# print a warning. They are supposed to provide a xxxInfo.plist which
|
|
|
|
# gets merged with the automatically generated entries to generate
|
|
|
|
# Info-gnustep.plist.
|
|
|
|
ifneq ($(FOUNDATION_LIB), apple)
|
|
|
|
ifneq ($(filter Info-gnustep.plist,$($(GNUSTEP_INSTANCE)_RESOURCE_FILES)),)
|
|
|
|
$(WARNING_INFO_GNUSTEP_PLIST)
|
|
|
|
endif
|
|
|
|
else
|
|
|
|
ifneq ($(filter Info.plist,$($(GNUSTEP_INSTANCE)_RESOURCE_FILES)),)
|
|
|
|
$(WARNING_INFO_PLIST)
|
|
|
|
endif
|
|
|
|
endif
|
2002-03-19 13:06:56 +00:00
|
|
|
|
2003-10-13 23:25:23 +00:00
|
|
|
$(PALETTE_DIR)/$(GNUSTEP_TARGET_LDIR):
|
|
|
|
$(ECHO_CREATING)$(MKDIRS) $(PALETTE_DIR)/$(GNUSTEP_TARGET_LDIR)$(END_ECHO)
|
2002-02-27 16:35:07 +00:00
|
|
|
|
2009-02-16 11:21:57 +00:00
|
|
|
ifeq ($(GNUSTEP_MAKE_PARALLEL_BUILDING), no)
|
|
|
|
# Standard building
|
|
|
|
internal-palette-run-compile-submake: $(PALETTE_FILE)
|
|
|
|
else
|
|
|
|
# Parallel building. The actual compilation is delegated to a
|
|
|
|
# sub-make invocation where _GNUSTEP_MAKE_PARALLEL is set to yet.
|
|
|
|
# That sub-make invocation will compile files in parallel.
|
|
|
|
internal-palette-run-compile-submake:
|
2010-02-14 23:13:47 +00:00
|
|
|
$(ECHO_NOTHING_RECURSIVE_MAKE)$(MAKE) -f $(MAKEFILE_NAME) --no-print-directory --no-keep-going \
|
2009-02-16 11:21:57 +00:00
|
|
|
internal-palette-compile \
|
|
|
|
GNUSTEP_TYPE=$(GNUSTEP_TYPE) \
|
|
|
|
GNUSTEP_INSTANCE=$(GNUSTEP_INSTANCE) \
|
|
|
|
GNUSTEP_OPERATION=compile \
|
|
|
|
GNUSTEP_BUILD_DIR="$(GNUSTEP_BUILD_DIR)" \
|
2010-02-14 23:13:47 +00:00
|
|
|
_GNUSTEP_MAKE_PARALLEL=yes$(END_ECHO_RECURSIVE_MAKE)
|
2009-02-16 11:21:57 +00:00
|
|
|
|
|
|
|
internal-palette-compile: $(PALETTE_FILE)
|
|
|
|
endif
|
|
|
|
|
2005-09-18 20:05:09 +00:00
|
|
|
# Standard bundle build using the rules for this target
|
2009-10-10 17:33:02 +00:00
|
|
|
$(PALETTE_FILE): $(OBJ_FILES_TO_LINK)
|
2009-03-19 16:59:53 +00:00
|
|
|
ifeq ($(OBJ_FILES_TO_LINK),)
|
|
|
|
$(WARNING_EMPTY_LINKING)
|
|
|
|
endif
|
2005-09-18 20:05:09 +00:00
|
|
|
$(ECHO_LINKING)$(BUNDLE_LD) $(BUNDLE_LDFLAGS) \
|
2002-02-27 16:35:07 +00:00
|
|
|
-o $(LDOUT)$(PALETTE_FILE) \
|
2005-09-18 20:05:09 +00:00
|
|
|
$(OBJ_FILES_TO_LINK) $(ALL_LDFLAGS) \
|
2008-02-19 10:49:20 +00:00
|
|
|
$(BUNDLE_LIBFLAGS) $(ALL_LIB_DIRS) $(PALETTE_LIBS)$(END_ECHO)
|
2004-03-18 00:03:56 +00:00
|
|
|
|
2002-02-28 18:30:07 +00:00
|
|
|
PRINCIPAL_CLASS = $(strip $($(GNUSTEP_INSTANCE)_PRINCIPAL_CLASS))
|
|
|
|
|
2002-02-27 16:35:07 +00:00
|
|
|
ifeq ($(PRINCIPAL_CLASS),)
|
2002-02-28 18:30:07 +00:00
|
|
|
PRINCIPAL_CLASS = $(GNUSTEP_INSTANCE)
|
2002-02-27 16:35:07 +00:00
|
|
|
endif
|
|
|
|
|
2002-02-27 16:40:09 +00:00
|
|
|
PALETTE_ICON = $($(GNUSTEP_INSTANCE)_PALETTE_ICON)
|
|
|
|
|
2002-02-27 16:35:07 +00:00
|
|
|
ifeq ($(PALETTE_ICON),)
|
2002-02-27 16:40:09 +00:00
|
|
|
PALETTE_ICON = $(GNUSTEP_INSTANCE)
|
2002-02-27 16:35:07 +00:00
|
|
|
endif
|
|
|
|
|
2007-03-16 12:23:56 +00:00
|
|
|
# FIXME - xxxInfo.plist in this case is not really a plist!
|
|
|
|
|
|
|
|
$(PALETTE_DIR)/Resources/Info-gnustep.plist: $(PALETTE_DIR)/Resources $(GNUSTEP_PLIST_DEPEND)
|
2003-05-27 10:35:01 +00:00
|
|
|
$(ECHO_CREATING)(echo "{"; echo ' NOTE = "Automatically generated, do not edit!";'; \
|
2005-03-21 22:06:32 +00:00
|
|
|
echo " NSExecutable = \"$(PALETTE_NAME)$(PALETTE_OBJ_EXT)\";"; \
|
2013-12-27 16:23:08 +00:00
|
|
|
if [ -r "$(GNUSTEP_PLIST_DEPEND)" ]; then \
|
|
|
|
cat $(GNUSTEP_PLIST_DEPEND); \
|
2002-02-27 16:35:07 +00:00
|
|
|
fi; \
|
2003-05-27 10:35:01 +00:00
|
|
|
echo "}") >$@$(END_ECHO)
|
2002-02-27 16:35:07 +00:00
|
|
|
|
2002-03-06 12:25:03 +00:00
|
|
|
MAIN_MODEL_FILE = $(strip $(subst .gmodel,,$(subst .gorm,,$(subst .nib,,$($(GNUSTEP_INSTANCE)_MAIN_MODEL_FILE)))))
|
|
|
|
|
2007-03-16 12:23:56 +00:00
|
|
|
# Depend on xxxpalette.table but only if it exists.
|
|
|
|
PALETTE_TABLE_DEPEND = $(wildcard $(GNUSTEP_INSTANCE)palette.table)
|
|
|
|
|
|
|
|
# FIXME - use stamp.make to depend on the value of the variables
|
|
|
|
# MAIN_MODEL_FILE, PRINCIPAL_CLASS and PALETTE_ICON
|
|
|
|
$(PALETTE_DIR)/Resources/palette.table: $(PALETTE_DIR)/Resources $(PALETTE_TABLE_DEPEND)
|
2004-07-12 03:24:33 +00:00
|
|
|
$(ECHO_CREATING)(echo "{";\
|
|
|
|
echo ' NOTE = "Automatically generated, do not edit!";'; \
|
2002-03-06 12:25:03 +00:00
|
|
|
echo " NibFile = \"$(MAIN_MODEL_FILE)\";"; \
|
2002-02-27 16:35:07 +00:00
|
|
|
echo " Class = \"$(PRINCIPAL_CLASS)\";"; \
|
|
|
|
echo " Icon = \"$(PALETTE_ICON)\";"; \
|
2004-07-12 03:24:33 +00:00
|
|
|
echo "}"; \
|
2002-02-27 16:35:07 +00:00
|
|
|
if [ -r "$(GNUSTEP_INSTANCE)palette.table" ]; then \
|
|
|
|
cat $(GNUSTEP_INSTANCE)palette.table; \
|
|
|
|
fi; \
|
2003-05-27 10:35:01 +00:00
|
|
|
) >$@$(END_ECHO)
|
2002-02-27 16:35:07 +00:00
|
|
|
|
2004-03-04 11:01:19 +00:00
|
|
|
internal-palette-copy_into_dir:: shared-instance-bundle-copy_into_dir
|
|
|
|
|
2002-03-01 15:25:42 +00:00
|
|
|
#
|
2003-10-13 10:35:24 +00:00
|
|
|
# Install targets
|
2002-03-01 15:25:42 +00:00
|
|
|
#
|
2003-10-12 16:44:29 +00:00
|
|
|
$(PALETTE_INSTALL_DIR):
|
|
|
|
$(ECHO_CREATING)$(MKINSTALLDIRS) $@$(END_ECHO)
|
2002-03-01 15:25:42 +00:00
|
|
|
|
2003-10-12 16:44:29 +00:00
|
|
|
internal-palette-install_:: shared-instance-bundle-install
|
2002-02-27 16:35:07 +00:00
|
|
|
ifeq ($(strip),yes)
|
2003-10-13 23:25:23 +00:00
|
|
|
$(ECHO_STRIPPING)$(STRIP) $(PALETTE_INSTALL_DIR)/$(PALETTE_FILE_NAME)$(END_ECHO)
|
2002-02-27 16:35:07 +00:00
|
|
|
endif
|
|
|
|
|
2003-10-12 16:44:29 +00:00
|
|
|
internal-palette-uninstall_:: shared-instance-bundle-uninstall
|
2002-02-27 16:35:07 +00:00
|
|
|
|
|
|
|
|
2002-10-22 00:27:39 +00:00
|
|
|
include $(GNUSTEP_MAKEFILES)/Instance/Shared/strings.make
|