1997-09-16 01:07:48 +00:00
|
|
|
#
|
|
|
|
# library.make
|
|
|
|
#
|
|
|
|
# Makefile rules to build GNUstep-based libraries.
|
|
|
|
#
|
|
|
|
# Copyright (C) 1997 Free Software Foundation, Inc.
|
|
|
|
#
|
|
|
|
# Author: Scott Christley <scottc@net-community.com>
|
1997-10-28 02:34:11 +00:00
|
|
|
# Ovidiu Predescu <ovidiu@net-community.com>
|
1997-09-16 01:07:48 +00:00
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
|
1997-11-14 22:50:41 +00:00
|
|
|
# prevent multiple inclusions
|
|
|
|
ifeq ($(LIBRARY_MAKE_LOADED),)
|
|
|
|
LIBRARY_MAKE_LOADED=yes
|
|
|
|
|
1997-09-16 01:07:48 +00:00
|
|
|
#
|
|
|
|
# Include in the common makefile rules
|
|
|
|
#
|
1998-02-06 19:15:05 +00:00
|
|
|
include $(GNUSTEP_MAKEFILES)/rules.make
|
1997-09-16 01:07:48 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# The name of the library is in the LIBRARY_NAME variable.
|
1997-10-28 02:34:11 +00:00
|
|
|
# The Objective-C files that gets included in the library are in xxx_OBJC_FILES
|
|
|
|
# The C files are in xxx_C_FILES
|
|
|
|
# The pswrap files are in xxx_PSWRAP_FILES
|
|
|
|
# The header files are in xxx_HEADER_FILES
|
|
|
|
# The directory where the header files are located is xxx_HEADER_FILES_DIR
|
|
|
|
# The directory where to install the header files inside the library
|
|
|
|
# installation directory is xxx_HEADER_FILES_INSTALL_DIR
|
1997-09-16 01:07:48 +00:00
|
|
|
#
|
1997-10-28 02:34:11 +00:00
|
|
|
# Where xxx is the name of the library
|
|
|
|
#
|
|
|
|
|
1997-11-13 03:18:16 +00:00
|
|
|
ifeq ($(INTERNAL_library_NAME),)
|
1997-10-28 02:34:11 +00:00
|
|
|
# This part is included the first time make is invoked.
|
|
|
|
|
1997-11-13 03:18:16 +00:00
|
|
|
internal-all:: $(LIBRARY_NAME:=.all.library.variables)
|
1997-10-28 02:34:11 +00:00
|
|
|
|
1997-11-13 05:14:35 +00:00
|
|
|
internal-install:: all $(LIBRARY_NAME:=.install.library.variables)
|
1997-10-28 02:34:11 +00:00
|
|
|
|
1997-11-13 03:18:16 +00:00
|
|
|
internal-uninstall:: $(LIBRARY_NAME:=.uninstall.library.variables)
|
1997-10-30 22:43:44 +00:00
|
|
|
|
1997-11-13 03:18:16 +00:00
|
|
|
internal-clean:: $(LIBRARY_NAME:=.clean.library.variables)
|
1997-10-28 02:34:11 +00:00
|
|
|
|
1997-11-13 03:18:16 +00:00
|
|
|
internal-distclean:: $(LIBRARY_NAME:=.distclean.library.variables)
|
1997-10-28 02:34:11 +00:00
|
|
|
|
|
|
|
$(LIBRARY_NAME):
|
1998-01-09 22:05:03 +00:00
|
|
|
@$(MAKE) -f $(MAKEFILE_NAME) --no-print-directory \
|
|
|
|
$@.all.library.variables
|
1997-10-28 02:34:11 +00:00
|
|
|
|
|
|
|
else
|
|
|
|
# This part gets included the second time make is invoked.
|
1997-09-16 01:07:48 +00:00
|
|
|
|
1997-09-26 01:16:38 +00:00
|
|
|
ifeq ($(shared), yes)
|
1997-11-13 03:18:16 +00:00
|
|
|
LIBRARY_FILE = $(INTERNAL_library_NAME)$(LIBRARY_NAME_SUFFIX)$(SHARED_LIBEXT)
|
1997-10-03 21:12:56 +00:00
|
|
|
LIBRARY_FILE_EXT=$(SHARED_LIBEXT)
|
1997-10-28 02:34:11 +00:00
|
|
|
VERSION_LIBRARY_FILE = $(LIBRARY_FILE).$(VERSION)
|
1997-09-26 01:16:38 +00:00
|
|
|
else
|
1997-11-13 03:18:16 +00:00
|
|
|
LIBRARY_FILE = $(INTERNAL_library_NAME)$(LIBRARY_NAME_SUFFIX)$(LIBEXT)
|
1997-10-03 21:12:56 +00:00
|
|
|
LIBRARY_FILE_EXT=$(LIBEXT)
|
1997-10-28 02:34:11 +00:00
|
|
|
VERSION_LIBRARY_FILE = $(LIBRARY_FILE)
|
1997-09-26 01:16:38 +00:00
|
|
|
endif
|
|
|
|
|
1997-10-02 00:41:03 +00:00
|
|
|
ifeq ($(strip $(HEADER_FILES_DIR)),)
|
|
|
|
HEADER_FILES_DIR = .
|
|
|
|
endif
|
|
|
|
|
1997-09-16 01:07:48 +00:00
|
|
|
#
|
|
|
|
# Internal targets
|
|
|
|
#
|
|
|
|
|
|
|
|
#
|
|
|
|
# Compilation targets
|
|
|
|
#
|
1998-02-06 02:27:22 +00:00
|
|
|
internal-library-all:: before-all before-$(TARGET)-all $(GNUSTEP_OBJ_DIR) \
|
1997-11-13 03:18:16 +00:00
|
|
|
$(GNUSTEP_OBJ_DIR)/$(VERSION_LIBRARY_FILE) import-library \
|
1998-02-06 02:27:22 +00:00
|
|
|
after-$(TARGET)-all after-all
|
1997-09-16 01:07:48 +00:00
|
|
|
|
1997-10-07 23:27:51 +00:00
|
|
|
$(GNUSTEP_OBJ_DIR)/$(VERSION_LIBRARY_FILE): $(C_OBJ_FILES) $(OBJC_OBJ_FILES)
|
1997-09-26 01:16:38 +00:00
|
|
|
$(LIB_LINK_CMD)
|
1997-09-18 01:36:07 +00:00
|
|
|
|
1997-11-13 03:18:16 +00:00
|
|
|
before-$(TARGET)-all::
|
|
|
|
|
|
|
|
after-$(TARGET)-all::
|
|
|
|
|
1997-09-16 01:07:48 +00:00
|
|
|
import-library::
|
|
|
|
|
|
|
|
#
|
|
|
|
# Install and uninstall targets
|
|
|
|
#
|
1997-11-13 03:18:16 +00:00
|
|
|
internal-library-install:: internal-install-dirs internal-install-lib \
|
1997-10-15 22:45:58 +00:00
|
|
|
internal-install-headers
|
|
|
|
|
1997-09-18 01:36:07 +00:00
|
|
|
internal-install-dirs::
|
|
|
|
$(GNUSTEP_MAKEFILES)/mkinstalldirs \
|
|
|
|
$(GNUSTEP_LIBRARIES_ROOT)/$(GNUSTEP_TARGET_DIR) \
|
|
|
|
$(GNUSTEP_LIBRARIES) \
|
1997-09-30 16:09:35 +00:00
|
|
|
$(GNUSTEP_HEADERS)$(HEADER_FILES_INSTALL_DIR) \
|
1997-09-18 01:36:07 +00:00
|
|
|
$(ADDITIONAL_INSTALL_DIRS)
|
|
|
|
|
|
|
|
internal-install-headers::
|
1997-10-28 02:34:11 +00:00
|
|
|
if [ "$(HEADER_FILES)" != "" ]; then \
|
|
|
|
for file in $(HEADER_FILES) __done; do \
|
|
|
|
if [ $$file != __done ]; then \
|
|
|
|
$(INSTALL_DATA) $(HEADER_FILES_DIR)/$$file \
|
|
|
|
$(GNUSTEP_HEADERS)$(HEADER_FILES_INSTALL_DIR)/$$file ; \
|
|
|
|
fi; \
|
|
|
|
done; \
|
|
|
|
fi
|
1997-09-18 01:36:07 +00:00
|
|
|
|
1997-09-26 01:16:38 +00:00
|
|
|
internal-install-libs:: internal-install-lib \
|
|
|
|
internal-install-import-lib
|
1997-09-18 01:36:07 +00:00
|
|
|
|
1997-09-26 01:16:38 +00:00
|
|
|
internal-install-lib::
|
1997-10-07 23:27:51 +00:00
|
|
|
if [ -f $(GNUSTEP_OBJ_DIR)/$(VERSION_LIBRARY_FILE) ]; then \
|
|
|
|
$(INSTALL_PROGRAM) $(GNUSTEP_OBJ_DIR)/$(VERSION_LIBRARY_FILE) \
|
|
|
|
$(GNUSTEP_LIBRARIES) ; \
|
1997-09-26 01:16:38 +00:00
|
|
|
$(AFTER_INSTALL_LIBRARY_CMD) \
|
1997-09-23 21:17:19 +00:00
|
|
|
fi
|
1997-09-18 01:36:07 +00:00
|
|
|
|
|
|
|
internal-install-import-lib::
|
1997-09-16 01:07:48 +00:00
|
|
|
|
1998-02-09 10:13:03 +00:00
|
|
|
internal-library-uninstall:: before-uninstall internal-uninstall-headers internal-uninstall-lib after-uninstall
|
|
|
|
|
|
|
|
before-uninstall after-uninstall::
|
1997-09-30 16:09:35 +00:00
|
|
|
|
|
|
|
internal-uninstall-headers::
|
1998-01-30 23:59:17 +00:00
|
|
|
for file in $(HEADER_FILES) __done; do \
|
|
|
|
if [ $$file != __done ]; then \
|
|
|
|
rm -f $(GNUSTEP_HEADERS)$(HEADER_FILES_INSTALL_DIR)/$$file ; \
|
|
|
|
fi; \
|
1997-09-30 16:09:35 +00:00
|
|
|
done
|
|
|
|
|
|
|
|
internal-uninstall-libs:: internal-uninstall-lib \
|
|
|
|
internal-uninstall-import-lib
|
|
|
|
|
|
|
|
internal-uninstall-lib::
|
|
|
|
rm -f $(GNUSTEP_LIBRARIES)/$(VERSION_LIBRARY_FILE)
|
|
|
|
rm -f $(GNUSTEP_LIBRARIES)/$(LIBRARY_FILE)
|
|
|
|
|
|
|
|
internal-uninstall-import-lib::
|
|
|
|
|
1997-09-16 01:07:48 +00:00
|
|
|
#
|
|
|
|
# Cleaning targets
|
|
|
|
#
|
1997-11-13 03:18:16 +00:00
|
|
|
internal-library-clean::
|
|
|
|
rm -rf $(GNUSTEP_OBJ_DIR)
|
1997-09-16 01:07:48 +00:00
|
|
|
|
1997-11-13 03:18:16 +00:00
|
|
|
internal-library-distclean::
|
1997-10-03 21:12:56 +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
|
|
|
|
|
1997-09-16 01:07:48 +00:00
|
|
|
#
|
|
|
|
# Testing targets
|
|
|
|
#
|
1997-11-13 03:18:16 +00:00
|
|
|
internal-library-check::
|
1997-10-28 02:34:11 +00:00
|
|
|
|
|
|
|
endif
|
1997-11-14 22:50:41 +00:00
|
|
|
|
|
|
|
endif
|
|
|
|
# library.make loaded
|