1999-02-19 21:47:15 +00:00
|
|
|
#
|
|
|
|
# subproject.make
|
|
|
|
#
|
|
|
|
# Makefile rules to build subprojects in GNUstep projects.
|
|
|
|
#
|
|
|
|
# Copyright (C) 1998 Free Software Foundation, Inc.
|
|
|
|
#
|
|
|
|
# Author: Jonathan Gapen <jagapen@whitewater.chem.wisc.edu>
|
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
|
|
|
|
# prevent multiple inclusions
|
|
|
|
ifeq ($(SUBPROJECT_MAKE_LOADED),)
|
|
|
|
SUBPROJECT_MAKE_LOADED=yes
|
|
|
|
|
|
|
|
#
|
|
|
|
# Include in the common makefile rules
|
|
|
|
#
|
2001-07-10 09:45:34 +00:00
|
|
|
ifeq ($(RULES_MAKE_LOADED),)
|
1999-02-19 21:47:15 +00:00
|
|
|
include $(GNUSTEP_MAKEFILES)/rules.make
|
2001-07-10 09:45:34 +00:00
|
|
|
endif
|
1999-02-19 21:47:15 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# The names of the subproject is in the SUBPROJECT_NAME variable.
|
|
|
|
#
|
|
|
|
|
|
|
|
SUBPROJECT_NAME:=$(strip $(SUBPROJECT_NAME))
|
|
|
|
|
2001-07-11 11:12:33 +00:00
|
|
|
ifeq ($(INTERNAL_subproject_NAME),)
|
1999-02-19 21:47:15 +00:00
|
|
|
# This part is included the first time make is invoked.
|
|
|
|
|
2001-07-10 17:22:23 +00:00
|
|
|
ifneq ($(FRAMEWORK_NAME),)
|
2001-07-11 11:12:33 +00:00
|
|
|
build-headers:: $(SUBPROJECT_NAME:=.build-headers.subproject.variables)
|
2001-07-10 17:22:23 +00:00
|
|
|
endif
|
|
|
|
|
2001-07-11 11:12:33 +00:00
|
|
|
internal-all:: $(SUBPROJECT_NAME:=.all.subproject.variables)
|
1999-02-19 21:47:15 +00:00
|
|
|
|
2001-07-11 12:49:13 +00:00
|
|
|
# for frameworks, headers are copied by build-headers into the
|
|
|
|
# framework directory, and are automatically installed when you
|
|
|
|
# install the framework; for other projects, we need to install each
|
|
|
|
# subproject's headers separately
|
|
|
|
ifeq ($(FRAMEWORK_NAME),)
|
|
|
|
# WARNING - if you type `make install' in a framework's subproject dir
|
|
|
|
# you are going to install the headers in the wrong place - can't fix
|
|
|
|
# that - but you can prevent it by adding `FRAMEWORK_NAME = xxx' to
|
2001-07-11 17:09:05 +00:00
|
|
|
# your subprojects' GNUmakefiles.
|
2001-07-11 12:49:13 +00:00
|
|
|
internal-install:: $(SUBPROJECT_NAME:=.install.subproject.variables)
|
|
|
|
|
|
|
|
internal-uninstall:: $(SUBPROJECT_NAME:=.uninstall.subproject.variables)
|
|
|
|
|
|
|
|
endif
|
1999-07-29 20:58:04 +00:00
|
|
|
|
2001-07-11 11:12:33 +00:00
|
|
|
internal-clean:: $(SUBPROJECT_NAME:=.clean.subproject.variables)
|
1999-02-19 21:47:15 +00:00
|
|
|
|
2001-07-11 11:12:33 +00:00
|
|
|
internal-distclean:: $(SUBPROJECT_NAME:=.distclean.subproject.variables)
|
1999-02-19 21:47:15 +00:00
|
|
|
|
|
|
|
$(SUBPROJECT_NAME):
|
|
|
|
@$(MAKE) -f $(MAKEFILE_NAME) --no-print-directory \
|
2001-07-11 11:12:33 +00:00
|
|
|
$@.all.subproject.variables
|
1999-02-19 21:47:15 +00:00
|
|
|
|
|
|
|
else
|
|
|
|
# This part gets included the second time make is invoked.
|
|
|
|
|
2001-07-11 12:49:13 +00:00
|
|
|
FRAMEWORK_HEADERS_DIR = $(FRAMEWORK_VERSION_DIR_NAME)/Headers/
|
|
|
|
FRAMEWORK_HEADER_FILES = $(patsubst %.h,$(FRAMEWORK_HEADERS_DIR)%.h,$(HEADER_FILES))
|
2000-10-28 21:58:48 +00:00
|
|
|
|
1999-02-19 21:47:15 +00:00
|
|
|
#
|
|
|
|
# Internal targets
|
|
|
|
#
|
|
|
|
|
|
|
|
#
|
|
|
|
# Compilation targets
|
|
|
|
#
|
2001-07-11 17:09:05 +00:00
|
|
|
ifeq ($(FRAMEWORK_NAME),)
|
|
|
|
internal-subproject-all:: before-$(TARGET)-all \
|
|
|
|
$(GNUSTEP_OBJ_DIR) \
|
|
|
|
$(GNUSTEP_OBJ_DIR)/$(SUBPROJECT_PRODUCT) \
|
|
|
|
after-$(TARGET)-all
|
|
|
|
else
|
2001-07-11 11:12:33 +00:00
|
|
|
internal-subproject-all:: before-$(TARGET)-all \
|
2001-07-10 17:22:23 +00:00
|
|
|
$(GNUSTEP_OBJ_DIR) \
|
|
|
|
$(GNUSTEP_OBJ_DIR)/$(SUBPROJECT_PRODUCT) \
|
|
|
|
framework-components \
|
|
|
|
framework-resource-files \
|
|
|
|
localized-framework-resource-files \
|
|
|
|
framework-webresource-files \
|
|
|
|
framework-localized-webresource-files \
|
|
|
|
after-$(TARGET)-all
|
2001-07-11 17:09:05 +00:00
|
|
|
endif
|
1999-02-19 21:47:15 +00:00
|
|
|
|
2001-07-11 12:49:13 +00:00
|
|
|
# We need to depend on SUBPROJECT_OBJ_FILES to account for sub-subprojects.
|
|
|
|
$(GNUSTEP_OBJ_DIR)/$(SUBPROJECT_PRODUCT): $(C_OBJ_FILES) $(OBJC_OBJ_FILES) \
|
|
|
|
$(OBJ_FILES) $(SUBPROJECT_OBJ_FILES)
|
1999-02-19 21:47:15 +00:00
|
|
|
$(OBJ_MERGE_CMD)
|
|
|
|
|
2001-07-10 17:22:23 +00:00
|
|
|
before-$(TARGET)-all::
|
1999-02-19 21:47:15 +00:00
|
|
|
|
|
|
|
after-$(TARGET)-all::
|
|
|
|
|
2001-07-10 17:22:23 +00:00
|
|
|
ifneq ($(FRAMEWORK_NAME),)
|
2001-07-11 11:12:33 +00:00
|
|
|
internal-subproject-build-headers:: $(FRAMEWORK_HEADER_FILES)
|
2000-10-28 21:58:48 +00:00
|
|
|
|
2001-07-11 17:09:05 +00:00
|
|
|
# We need to build the FRAMEWORK_HEADERS_DIR directory here because
|
|
|
|
# this rule could be executed before the top-level framework has built
|
|
|
|
# his dirs
|
2001-07-11 12:49:13 +00:00
|
|
|
$(FRAMEWORK_HEADER_FILES):: $(HEADER_FILES) $(FRAMEWORK_HEADERS_DIR)
|
|
|
|
ifneq ($(HEADER_FILES),)
|
|
|
|
for file in $(HEADER_FILES) __done; do \
|
|
|
|
if [ $$file != __done ]; then \
|
|
|
|
$(INSTALL_DATA) ./$$file $(FRAMEWORK_HEADERS_DIR)/$$file ; \
|
|
|
|
fi; \
|
|
|
|
done
|
|
|
|
endif
|
|
|
|
|
|
|
|
$(FRAMEWORK_HEADERS_DIR):
|
|
|
|
$(MKDIRS) $@
|
2000-10-28 21:58:48 +00:00
|
|
|
|
2000-10-29 23:48:45 +00:00
|
|
|
framework-components::
|
2001-07-11 17:09:05 +00:00
|
|
|
ifneq ($(COMPONENTS),)
|
|
|
|
@ echo "Copying components into the framework wrapper..."; \
|
|
|
|
cd $(FRAMEWORK_VERSION_DIR_NAME)/Resources; \
|
|
|
|
for component in $(COMPONENTS) __done; do \
|
|
|
|
if [ $$component != __done ]; then \
|
|
|
|
if [ -d ../../../../$(SUBPROJECT_ROOT_DIR)/$$component ]; then \
|
|
|
|
cp -r ../../../../$(SUBPROJECT_ROOT_DIR)/$$component ./; \
|
|
|
|
fi; \
|
2000-10-29 23:48:45 +00:00
|
|
|
fi; \
|
2001-07-11 17:09:05 +00:00
|
|
|
done; \
|
|
|
|
echo "Copying localized components into the framework wrapper..."; \
|
|
|
|
for l in $(LANGUAGES) __done; do \
|
|
|
|
if [ $$l != __done ]; then \
|
|
|
|
if [ ! -f $$l.lproj ]; then \
|
|
|
|
$(MKDIRS) $$l.lproj; \
|
|
|
|
fi; \
|
|
|
|
fi; \
|
|
|
|
cd $$l.lproj; \
|
|
|
|
for f in $(COMPONENTS) __done; do \
|
|
|
|
if [ $$f != __done ]; then \
|
|
|
|
if [ -d ../../../../../$(SUBPROJECT_ROOT_DIR)/$$l.lproj/$$f ]; then \
|
|
|
|
cp -r ../../../../../$(SUBPROJECT_ROOT_DIR)/$$l.lproj/$$f .; \
|
|
|
|
fi; \
|
|
|
|
fi; \
|
|
|
|
done; \
|
|
|
|
cd ..; \
|
|
|
|
done
|
|
|
|
endif
|
2000-10-29 23:48:45 +00:00
|
|
|
|
2000-10-28 21:58:48 +00:00
|
|
|
framework-resource-files::
|
2001-07-11 17:09:05 +00:00
|
|
|
ifneq ($(RESOURCE_FILES),)
|
|
|
|
echo "Copying resources into the framework wrapper..."; \
|
|
|
|
for f in "$(RESOURCE_FILES)"; do \
|
|
|
|
cp -r $$f $(FRAMEWORK_VERSION_DIR_NAME)/Resources; \
|
|
|
|
done;
|
|
|
|
endif
|
2000-10-28 21:58:48 +00:00
|
|
|
|
|
|
|
localized-framework-resource-files::
|
2001-07-11 17:09:05 +00:00
|
|
|
ifneq ($(LOCALIZED_RESOURCE_FILES),)
|
|
|
|
echo "Copying localized resources into the framework wrapper..."; \
|
|
|
|
for l in $(LANGUAGES) __done; do \
|
|
|
|
if [ $$l != __done ]; then \
|
|
|
|
if [ ! -f $$l.lproj ]; then \
|
|
|
|
$(MKDIRS) $(FRAMEWORK_VERSION_DIR_NAME)/Resources/$$l.lproj; \
|
|
|
|
fi; \
|
|
|
|
fi; \
|
|
|
|
for f in $(LOCALIZED_RESOURCE_FILES) __done; do \
|
|
|
|
if [ $$f != __done ]; then \
|
|
|
|
if [ -f $$l.lproj/$$f ]; then \
|
|
|
|
cp -r $$l.lproj/$$f $(FRAMEWORK_VERSION_DIR_NAME)/Resources/$$l.lproj/; \
|
|
|
|
fi; \
|
|
|
|
fi; \
|
|
|
|
done; \
|
|
|
|
done
|
|
|
|
endif
|
2000-10-28 21:58:48 +00:00
|
|
|
|
2001-07-11 17:09:05 +00:00
|
|
|
# FIXME - FRAMEWORK_WEBSERVER_RESOURCE_DIRS is not defined ...
|
2000-10-29 23:48:45 +00:00
|
|
|
framework-webresource-dir::
|
|
|
|
@(if [ "$(WEBSERVER_RESOURCE_FILES)" != "" ] || [ "$(FRAMEWORK_WEBSERVER_RESOURCE_DIRS)" != "" ]; then \
|
|
|
|
$(MKDIRS) $(FRAMEWORK_VERSION_DIR_NAME)/WebServerResources; \
|
|
|
|
$(MKDIRS) $(FRAMEWORK_WEBSERVER_RESOURCE_DIRS); \
|
|
|
|
if test ! -L "$(FRAMEWORK_DIR_NAME)/WebServerResources"; then \
|
|
|
|
$(LN_S) Versions/Current/WebServerResources $(FRAMEWORK_DIR_NAME);\
|
|
|
|
fi; \
|
|
|
|
fi;)
|
|
|
|
|
|
|
|
framework-webresource-files:: framework-webresource-dir
|
2001-07-11 17:09:05 +00:00
|
|
|
ifneq ($(WEBSERVER_RESOURCE_FILES),)
|
|
|
|
echo "Copying webserver resources into the framework wrapper..."; \
|
|
|
|
cd $(FRAMEWORK_VERSION_DIR_NAME)/WebServerResources; \
|
|
|
|
for ff in $(WEBSERVER_RESOURCE_FILES) __done; do \
|
|
|
|
if [ $$ff != __done ]; then \
|
|
|
|
if [ -f ../../../../$(SUBPROJECT_ROOT_DIR)/WebServerResources/$$ff ]; then \
|
|
|
|
cp -r ../../../../$(SUBPROJECT_ROOT_DIR)/WebServerResources/$$ff .; \
|
2000-10-29 23:48:45 +00:00
|
|
|
fi; \
|
2001-07-11 17:09:05 +00:00
|
|
|
fi; \
|
|
|
|
done
|
|
|
|
endif
|
2000-10-29 23:48:45 +00:00
|
|
|
|
|
|
|
framework-localized-webresource-files:: framework-webresource-dir
|
2001-07-11 17:09:05 +00:00
|
|
|
ifneq ($(LOCALIZED_WEBSERVER_RESOURCE_FILES),)
|
|
|
|
echo "Copying localized webserver resources into the framework wrapper..."; \
|
|
|
|
cd $(FRAMEWORK_VERSION_DIR_NAME)/WebServerResources; \
|
|
|
|
for l in $(LANGUAGES) __done; do \
|
|
|
|
if [ $$l != __done ]; then \
|
|
|
|
if [ ! -f $$l.lproj ]; then \
|
|
|
|
$(MKDIRS) $$l.lproj; \
|
2000-10-29 23:48:45 +00:00
|
|
|
fi; \
|
2001-07-11 17:09:05 +00:00
|
|
|
fi; \
|
|
|
|
cd $$l.lproj; \
|
|
|
|
for f in $(LOCALIZED_WEBSERVER_RESOURCE_FILES) __done; do \
|
|
|
|
if [ $$f != __done ]; then \
|
|
|
|
if [ -f ../../../../../$(SUBPROJECT_ROOT_DIR)/WebServerResources/$$l.lproj/$$f ]; then \
|
|
|
|
if [ ! -r $$f ]; then \
|
|
|
|
cp -r ../../../../../$(SUBPROJECT_ROOT_DIR)/WebServerResources/$$l.lproj/$$f $$f; \
|
|
|
|
fi; \
|
2000-10-29 23:48:45 +00:00
|
|
|
fi;\
|
2001-07-11 17:09:05 +00:00
|
|
|
fi;\
|
2000-10-29 23:48:45 +00:00
|
|
|
done;\
|
2001-07-11 17:09:05 +00:00
|
|
|
cd ..; \
|
|
|
|
done
|
|
|
|
endif
|
|
|
|
|
|
|
|
endif # FRAMEWORK code
|
2000-10-29 23:48:45 +00:00
|
|
|
|
1999-02-19 21:47:15 +00:00
|
|
|
#
|
2001-07-11 12:49:13 +00:00
|
|
|
# Installation targets - we only need to install headers and only
|
|
|
|
# if this is not in a framework
|
1999-02-19 21:47:15 +00:00
|
|
|
#
|
2001-07-11 12:49:13 +00:00
|
|
|
ifeq ($(FRAMEWORK_NAME),)
|
1999-02-19 21:47:15 +00:00
|
|
|
|
2001-07-11 12:49:13 +00:00
|
|
|
ifeq ($(strip $(HEADER_FILES_DIR)),)
|
|
|
|
override HEADER_FILES_DIR = .
|
|
|
|
endif
|
1999-07-29 20:58:04 +00:00
|
|
|
|
2001-07-11 12:49:13 +00:00
|
|
|
internal-subproject-install:: $(GNUSTEP_HEADERS)$(HEADER_FILES_INSTALL_DIR) \
|
|
|
|
$(ADDITIONAL_INSTALL_DIRS) \
|
|
|
|
internal-install-headers
|
1999-07-29 20:58:04 +00:00
|
|
|
|
2001-07-11 12:49:13 +00:00
|
|
|
$(GNUSTEP_HEADERS)$(HEADER_FILES_INSTALL_DIR):
|
|
|
|
$(MKDIRS) $@
|
1999-07-29 20:58:04 +00:00
|
|
|
|
2001-07-11 12:49:13 +00:00
|
|
|
$(ADDITIONAL_INSTALL_DIRS):
|
|
|
|
$(MKDIRS) $@
|
|
|
|
|
|
|
|
internal-install-headers::
|
|
|
|
ifneq ($(HEADER_FILES),)
|
1999-07-29 20:58:04 +00:00
|
|
|
for file in $(HEADER_FILES) __done; do \
|
|
|
|
if [ $$file != __done ]; then \
|
2001-07-11 12:49:13 +00:00
|
|
|
$(INSTALL_DATA) \
|
|
|
|
$(HEADER_FILES_DIR)/$$file \
|
|
|
|
$(GNUSTEP_HEADERS)$(HEADER_FILES_INSTALL_DIR)/$$file ; \
|
|
|
|
fi; \
|
2001-07-11 17:09:05 +00:00
|
|
|
done
|
2001-07-11 12:49:13 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
internal-subproject-uninstall::
|
|
|
|
for file in $(HEADER_FILES) __done; do \
|
|
|
|
if [ $$file != __done ]; then \
|
|
|
|
rm -f $(GNUSTEP_HEADERS)$(HEADER_FILES_INSTALL_DIR)/$$file ; \
|
1999-07-29 20:58:04 +00:00
|
|
|
fi; \
|
|
|
|
done
|
|
|
|
|
2001-07-11 12:49:13 +00:00
|
|
|
endif
|
|
|
|
|
1999-02-19 21:47:15 +00:00
|
|
|
#
|
|
|
|
# Cleaning targets
|
|
|
|
#
|
2001-07-11 11:12:33 +00:00
|
|
|
internal-subproject-clean::
|
1999-02-19 21:47:15 +00:00
|
|
|
rm -rf $(GNUSTEP_OBJ_DIR)
|
|
|
|
|
2001-07-11 11:12:33 +00:00
|
|
|
internal-subproject-distclean::
|
1999-02-19 21:47:15 +00:00
|
|
|
rm -rf shared_obj static_obj shared_debug_obj shared_profile_obj \
|
|
|
|
static_debug_obj static_profile_obj shared_profile_debug_obj \
|
|
|
|
static_profile_debug_obj
|
|
|
|
|
|
|
|
#
|
|
|
|
# Testing targets
|
|
|
|
#
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
endif
|
|
|
|
# subproject.make loaded
|
2000-10-28 21:58:48 +00:00
|
|
|
|
|
|
|
## Local variables:
|
|
|
|
## mode: makefile
|
|
|
|
## End:
|