Added support for building profile, debug and shared/static versions of a library. Partial support for the NeXT compiler added. Several cleanups.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/tools/make/trunk@2447 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Ovidiu Predescu 1997-09-26 01:16:38 +00:00
parent 9b370e4f9c
commit 4a4d7d8372
12 changed files with 228 additions and 166 deletions

View file

@ -1,3 +1,43 @@
Thu Sep 25 17:32:37 1997 Ovidiu Predescu <ovidiu@net-community.com>
* DESIGN: Updated to contain the latest changes in the package.
* Makefile.in: Use a for loop to install the files.
* aggregate.make: Commpress all the internal-* targets into a single
rule to make the maintanance easier.
* rules.make: Add rule for creating the object files directory here
instead of having the same rule in several files.
* application.make: Remove creation of the object files directory. Just
add the dependency to the targets.
* tool.make: Likewise.
* clean.make: Optimize cannonicalization of host/target cpu/os/vendor
by adding a flag that says if they are already cannoical or not.
* target.make: Use the variable defined above to speed up the building
process.
* common.make: Added support for building separate versions of
libraries for debugging, profiling and/or static or shared. Use
different object file directories instead of using a suffix to the
file name. Building a shared library is now the default for systems
that support shared libraries.
* library.make: Removed the two variables for specifying the shared
library and the static one. Added two new target variables which
define commands to be run after the installation of either the static
or of the shared library.
* target.make: Define the two new variables above for the different
supported systems.
* common.make: Added a partial support for the NeXT compiler. We also
need a way to determine what compiler is used, which is simple because
our tools only partially work with the NeXT runtime/compiler.
* core.make: Support for the NeXT Foundation and AppKit added.
* rules.make: Use flags to specify the include paths while compiling to
support NeXT frameworks. Cleanup in the shared libraries support.
* rules.make: .PRECIOUS target added to disable removing of
intermediate files (Scott's idea).
Thu Sep 25 11:25:36 1997 Ovidiu Predescu <ovidiu@net-community.com>
* Makefile.in: Include config.make to get the definition for the

19
DESIGN
View file

@ -53,23 +53,23 @@ be compiled for these combinations:
Objective-C runtime: NeXT, GNU
Foundation library: NeXT, PDO, gnustep-base, libFoundation
GUI library: NeXT, gnustep-gui
Back-end library: none, XDPS, Win32
Back-end library: nil, XDPS, Win32
The back-end library is required if the GUI library used is
gnustep-gui. It is "none" if the GUI library is NeXT's AppKit. We'll
gnustep-gui. It is "nil" if the GUI library is NeXT's AppKit. We'll
use the following abbreviations to identify different parts:
Objective-C runtime: nx (for NeXT), gnu (for GNU)
Foundation library: nx (for NeXT), pdo (for PDO), gnu (for gnustep-base),
fd (for libFoundation)
GUI library: nx (for NeXT), gnu (for gnustep-gui)
Back-end library: non (for none), xdp (for XDPS), w32 (for Win32)
Back-end library: nil (for none), xdp (for XDPS), w32 (for Win32)
We'll denote the fact that an application was compiled for a certain
combination of the above values by using the abbreviations of the
different subsystems and placing underscores between them. For example
an application compiled for NeXT Foundation using NeXT AppKit will
have the compile attribute nx_nx_nx_non. An application compiled for
have the compile attribute nx_nx_nx_nil. An application compiled for
PDO with the gnustep-gui library under Unix will be denoted by
nx_pdo_gnu_xdp and another one compiled for gnustep-base using
gnustep-gui under Unix will be denoted by gnu_gnu_gnu_xdp. Here is a
@ -77,8 +77,8 @@ list of some of the possible combinations:
ObjC runtime Foundation GUI Backend
------------ ---------- --- --------
nx nx nx non
nx pdo nx non
nx nx nx nil
nx pdo nx nil
nx pdo gnu xdp
gnu gnu gnu xdp
gnu gnu gnu w32
@ -347,7 +347,9 @@ project needs to be built. This is defined by including a certain
makefile package file. For example if the package to be built is an
application then a possible Makefile can look like this:
OBJC_FILES = test.m
APP_NAME = test1 test2
test1_OBJC_FILES = test1.m
test2_OBJC_FILES = test2.m test21.m
-include Makefile.preamble
include application.make
@ -366,3 +368,6 @@ targets.
The makefile package is installed under $(GNUSTEP_SYSTEM_ROOT)/Makefiles.
Ovidiu Predescu
Last updated: September, 1997

View file

@ -58,9 +58,9 @@ install:
for f in config.guess config.sub install-sh mkinstalldirs *.sh; do \
$(INSTALL_PROGRAM) -m 755 $$f $(makedir); \
done
for f in application.make bundle.make clean.make common.make \
core.make library.make rules.make target.make tool.make \
config.site MediaBook.func; do \
for f in aggregate.make application.make bundle.make clean.make \
common.make core.make library.make rules.make target.make \
tool.make config.site MediaBook.func; do \
$(INSTALL_DATA) $$f $(makedir); \
done
$(INSTALL_DATA) config.make $(makedir)/$(GNUSTEP_TARGET_DIR)

View file

@ -32,38 +32,10 @@ include $(GNUSTEP_SYSTEM_ROOT)/Makefiles/rules.make
#
# Internal targets
#
internal-all::
@(for f in $(SUBPROJECTS); do \
echo Making all in $$f...;\
(cd $$f; $(MAKE) all); \
done)
internal-install::
@(for f in $(SUBPROJECTS); do \
echo Making install in $$f...;\
(cd $$f; $(MAKE) install); \
done)
internal-uninstall::
@(for f in $(SUBPROJECTS); do \
echo Making uninstall in $$f...;\
(cd $$f; $(MAKE) uninstall); \
done)
internal-clean::
@(for f in $(SUBPROJECTS); do \
echo Making clean in $$f...;\
(cd $$f; $(MAKE) clean); \
done)
internal-distclean::
@(for f in $(SUBPROJECTS); do \
echo Making distclean in $$f...;\
(cd $$f; $(MAKE) distclean); \
done)
internal-check::
@(for f in $(SUBPROJECTS); do \
echo Making check in $$f...;\
(cd $$f; $(MAKE) check); \
internal-all internal-install internal-uninstall internal-clean \
internal-distclean internal-check::
@(target=`echo $@ | sed 's/internal-//'`; \
for f in $(SUBPROJECTS); do \
echo Making $$target in $$f...;\
(cd $$f; $(MAKE) $$target); \
done)

View file

@ -48,9 +48,9 @@ $(GNUSTEP_OBJ_DIR)/stamp-% : $(C_OBJ_FILES) $(OBJC_OBJ_FILES)
#
# Compilation targets
#
internal-all:: $(APP_DIR_NAME)
internal-all:: $(GNUSTEP_OBJ_DIR) $(APP_DIR_NAME)
internal-app-all:: build-app-dir object-dir build-app
internal-app-all:: build-app-dir build-app
build-app-dir::
@$(GNUSTEP_MAKEFILES)/mkinstalldirs \
@ -61,10 +61,6 @@ build-app-dir::
build-app:: $(GNUSTEP_OBJ_DIR)/stamp-$(APP_NAME)
object-dir::
@$(GNUSTEP_MAKEFILES)/mkinstalldirs \
./$(GNUSTEP_OBJ_DIR)
#
# Cleaning targets
#

View file

@ -19,12 +19,18 @@
# If not, write to the Free Software Foundation,
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
ifneq ($(internal_names_clean), yes)
# Clean up the host names
GNUSTEP_HOST_CPU := $(shell $(CLEAN_CPU_SCRIPT) $(GNUSTEP_HOST_CPU))
GNUSTEP_HOST_VENDOR := $(shell $(CLEAN_VENDOR_SCRIPT) $(GNUSTEP_HOST_VENDOR))
GNUSTEP_HOST_OS := $(shell $(CLEAN_OS_SCRIPT) $(GNUSTEP_HOST_OS))
export GNUSTEP_HOST_CPU := $(shell $(CLEAN_CPU_SCRIPT) $(GNUSTEP_HOST_CPU))
export GNUSTEP_HOST_VENDOR := $(shell $(CLEAN_VENDOR_SCRIPT) $(GNUSTEP_HOST_VENDOR))
export GNUSTEP_HOST_OS := $(shell $(CLEAN_OS_SCRIPT) $(GNUSTEP_HOST_OS))
# Clean up the target names
GNUSTEP_TARGET_CPU := $(shell $(CLEAN_CPU_SCRIPT) $(GNUSTEP_TARGET_CPU))
GNUSTEP_TARGET_VENDOR := $(shell $(CLEAN_VENDOR_SCRIPT) $(GNUSTEP_TARGET_VENDOR))
GNUSTEP_TARGET_OS := $(shell $(CLEAN_OS_SCRIPT) $(GNUSTEP_TARGET_OS))
export GNUSTEP_TARGET_CPU := $(shell $(CLEAN_CPU_SCRIPT) $(GNUSTEP_TARGET_CPU))
export GNUSTEP_TARGET_VENDOR := $(shell $(CLEAN_VENDOR_SCRIPT) $(GNUSTEP_TARGET_VENDOR))
export GNUSTEP_TARGET_OS := $(shell $(CLEAN_OS_SCRIPT) $(GNUSTEP_TARGET_OS))
export internal_names_clean=yes
endif

View file

@ -54,8 +54,6 @@ include $(GNUSTEP_SYSTEM_ROOT)/Makefiles/$(GNUSTEP_TARGET_DIR)/config.make
#
include $(GNUSTEP_SYSTEM_ROOT)/Makefiles/core.make
GNUSTEP_OBJ_DIR = objs/$(GNUSTEP_TARGET_DIR)/$(LIBRARY_COMBO)
#
# Variables specifying the installation directory paths
#
@ -70,36 +68,44 @@ GNUSTEP_MAKEFILES = $(GNUSTEP_SYSTEM_ROOT)/Makefiles
#
# Determine Foundation header subdirectory based upon library combo
#
FND_HEADER =
ifeq ($(FOUNDATION_LIB),gnu)
FND_HEADER = /gnustep/base
GNUSTEP_HEADERS_FND = $(GNUSTEP_HEADERS)/gnustep/base
GNUSTEP_HEADERS_FND_FLAG = -I$(GNUSTEP_HEADERS_FND)
endif
ifeq ($(FOUNDATION_LIB),fd)
FND_HEADER = /libFoundation
GNUSTEP_HEADERS_FND = $(GNUSTEP_HEADERS)/libFoundation
GNUSTEP_HEADERS_FND_FLAG = -I$(GNUSTEP_HEADERS_FND)
endif
GNUSTEP_HEADERS_FND = $(GNUSTEP_HEADERS)$(FND_HEADER)
ifeq ($(OBJC_COMPILER), NeXT)
ifeq ($(FOUNDATION_LIB),nx)
GNUSTEP_HEADERS_FND =
GNUSTEP_HEADERS_FND_FLAG = -framework Foundation
endif
endif
#
# Determine AppKit header subdirectory based upon library combo
#
APP_HEADER =
ifeq ($(GUI_LIB),gnu)
APP_HEADER = /gnustep/gui
GNUSTEP_HEADERS_GUI = $(GNUSTEP_HEADERS)/gnustep/gui
GNUSTEP_HEADERS_GUI_FLAG = -I$(GNUSTEP_HEADERS_GUI)
endif
GNUSTEP_HEADERS_GUI = $(GNUSTEP_HEADERS)$(APP_HEADER)
ifeq ($(OBJC_COMPILER), NeXT)
ifeq ($(FOUNDATION_LIB),nx)
GNUSTEP_HEADERS_GUI =
GNUSTEP_HEADERS_GUI_FLAG = -framework AppKit
endif
endif
#
# Overridable compilation flags
#
DEBUGFLAG = -g
OPTFLAG = -O2
OBJCFLAGS = -Wno-implicit -Wno-import
CFLAGS =
CFLAGS =
OBJ_DIR_PREFIX =
ifeq ($(OBJC_RUNTIME_LIB),gnu)
RUNTIME_FLAG = -fgnu-runtime
@ -109,6 +115,46 @@ ifeq ($(OBJC_RUNTIME_LIB),nx)
RUNTIME_FLAG = -fnext-runtime
endif
INTERNAL_OBJCFLAGS = $(DEBUGFLAG) $(OPTFLAG) $(OBJCFLAGS) $(RUNTIME_FLAG)
INTERNAL_CFLAGS = $(DEBUGFLAG) $(OPTFLAG) $(CFLAGS) $(RUNTIME_FLAG)
INTERNAL_LDFLAGS = $(LDFLAGS)
OPTFLAG = -O2
# Enable building shared libraries by default. If the user wants to build a
# static library, he/she has to specify shared=no explicitly.
ifeq ($(HAVE_SHARED_LIBS), yes)
ifeq ($(shared), no)
shared=no
else
shared=yes
endif
endif
ifeq ($(shared), yes)
LIB_LINK_CMD = $(SHARED_LIB_LINK_CMD)
OBJ_DIR_PREFIX += shared_
INTERNAL_OBJCFLAGS = $(SHARED_CFLAGS)
INTERNAL_CFLAGS = $(SHARED_CFLAGS)
AFTER_INSTALL_LIBRARY_CMD = $(AFTER_INSTALL_SHARED_LIB_COMMAND)
else
LIB_LINK_CMD = $(STATIC_LIB_LINK_CMD)
OBJ_DIR_PREFIX += static_
AFTER_INSTALL_LIBRARY_CMD = $(AFTER_INSTALL_STATIC_LIB_COMMAND)
endif
ifeq ($(profile), yes)
ADDITIONAL_FLAGS += -pg
OBJ_DIR_PREFIX += profile_
endif
ifeq ($(debug), yes)
ADDITIONAL_FLAGS += -g
OBJ_DIR_PREFIX += debug_
endif
OBJ_DIR_PREFIX += obj
INTERNAL_OBJCFLAGS += $(ADDITIONAL_FLAGS) $(OPTFLAG) $(OBJCFLAGS) \
$(RUNTIME_FLAG)
INTERNAL_CFLAGS += $(ADDITIONAL_FLAGS) $(CFLAGS) $(OPTFLAG) $(RUNTIME_FLAG)
INTERNAL_LDFLAGS += $(LDFLAGS)
GNUSTEP_OBJ_DIR = $(shell echo $(OBJ_DIR_PREFIX) | sed 's/ //g')/$(GNUSTEP_TARGET_DIR)/$(LIBRARY_COMBO)

View file

@ -80,6 +80,11 @@ FND_LDFLAGS =
FND_LIBS = -lFoundation
endif
ifeq ($(FOUNDATION_LIB),nx)
FND_LDFLAGS = -framework Foundation
FND_LIBS =
endif
GUI_LDFLAGS =
GUI_LIBS =
#
@ -90,6 +95,11 @@ GUI_LDFLAGS =
GUI_LIBS = -lgnustep-gui
endif
ifeq ($(GUI_LIB),nx)
GUI_LDFLAGS = -framework AppKit
GUI_LIBS =
endif
BACKEND_LDFLAGS =
BACKEND_LIBS =
#

View file

@ -28,9 +28,13 @@ include $(GNUSTEP_SYSTEM_ROOT)/Makefiles/rules.make
# The name of the library is in the LIBRARY_NAME variable.
#
ifeq ($(shared), yes)
LIBRARY_FILE = $(LIBRARY_NAME)$(SHARED_LIBEXT)
else
LIBRARY_FILE = $(LIBRARY_NAME)$(LIBEXT)
SHARED_LIBRARY_NAME = $(LIBRARY_NAME)$(SHARED_LIBEXT)
SHARED_LIBRARY_FILE = $(LIBRARY_NAME)$(SHARED_LIBEXT).$(VERSION)
endif
VERSION_LIBRARY_FILE = $(LIBRARY_FILE).$(VERSION)
#
# Internal targets
@ -39,19 +43,10 @@ SHARED_LIBRARY_FILE = $(LIBRARY_NAME)$(SHARED_LIBEXT).$(VERSION)
#
# Compilation targets
#
internal-all:: object-dir static-library shared-library import-library
internal-all:: $(GNUSTEP_OBJ_DIR) $(LIBRARY_FILE) import-library
object-dir::
$(GNUSTEP_MAKEFILES)/mkinstalldirs \
./$(GNUSTEP_OBJ_DIR)
static-library:: $(C_OBJ_FILES) $(OBJC_OBJ_FILES)
$(AR) $(ARFLAGS) $(AROUT)$(GNUSTEP_OBJ_DIR)/$(LIBRARY_FILE) \
$(C_OBJ_FILES) $(OBJC_OBJ_FILES)
$(RANLIB) $(GNUSTEP_OBJ_DIR)/$(LIBRARY_FILE)
shared-library:: $(SHARED_C_OBJ_FILES) $(SHARED_OBJC_OBJ_FILES)
$(SHARED_LIB_LINK_CMD)
$(LIBRARY_FILE): $(C_OBJ_FILES) $(OBJC_OBJ_FILES)
$(LIB_LINK_CMD)
import-library::
@ -59,7 +54,7 @@ import-library::
# Install and uninstall targets
#
internal-install:: internal-install-dirs internal-install-headers \
internal-install-libs
internal-install-lib
internal-install-dirs::
$(GNUSTEP_MAKEFILES)/mkinstalldirs \
@ -76,23 +71,14 @@ internal-install-headers::
$(GNUSTEP_HEADERS)$(HEADER_FILES_INSTALL_DIR)/$$file ; \
done
internal-install-libs:: internal-install-static-lib \
internal-install-shared-lib internal-install-import-lib
internal-install-libs:: internal-install-lib \
internal-install-import-lib
internal-install-static-lib::
internal-install-lib::
if [ -e $(GNUSTEP_OBJ_DIR)/$(LIBRARY_FILE) ]; then \
$(INSTALL_PROGRAM) $(GNUSTEP_OBJ_DIR)/$(LIBRARY_FILE) \
$(GNUSTEP_LIBRARIES) ; \
$(RANLIB) $(GNUSTEP_LIBRARIES)/$(LIBRARY_FILE) ; \
fi
internal-install-shared-lib::
if [ -e $(GNUSTEP_OBJ_DIR)/$(SHARED_LIBRARY_FILE) ]; then \
$(INSTALL_PROGRAM) $(GNUSTEP_OBJ_DIR)/$(SHARED_LIBRARY_FILE) \
$(GNUSTEP_LIBRARIES) ; \
(cd $(GNUSTEP_LIBRARIES); \
rm -f $(SHARED_LIBRARY_NAME); \
$(LN_S) $(SHARED_LIBRARY_FILE) $(SHARED_LIBRARY_NAME)) \
$(AFTER_INSTALL_LIBRARY_CMD) \
fi
internal-install-import-lib::
@ -108,8 +94,8 @@ internal-clean::
rm -f $(PSWRAP_C_FILES)
rm -f $(PSWRAP_H_FILES)
rm -f $(GNUSTEP_OBJ_DIR)/$(LIBRARY_FILE)
rm -f $(GNUSTEP_OBJ_DIR)/$(SHARED_LIBRARY_NAME)
rm -f $(GNUSTEP_OBJ_DIR)/$(SHARED_LIBRARY_FILE)
rm -f $(GNUSTEP_OBJ_DIR)/$(VERSION_LIBRARY_FILE)
rm -f $(GNUSTEP_OBJ_DIR)/$(LIBRARY_FILE)
internal-distclean:: clean
rm -rf objs

View file

@ -23,11 +23,11 @@ ALL_CPPFLAGS = $(CPPFLAGS) $(ADDITIONAL_CPPFLAGS)
ALL_OBJCFLAGS = $(INTERNAL_OBJCFLAGS) $(ADDITIONAL_OBJCFLAGS) \
$(ADDITIONAL_INCLUDE_DIRS) -I. $(SYSTEM_INCLUDES) \
-I$(GNUSTEP_HEADERS_FND) -I$(GNUSTEP_HEADERS_GUI) -I$(GNUSTEP_HEADERS)
$(GNUSTEP_HEADERS_FND_FLAG) $(GNUSTEP_HEADERS_GUI_FLAG) -I$(GNUSTEP_HEADERS)
ALL_CFLAGS = $(INTERNAL_CFLAGS) $(ADDITIONAL_CFLAGS) \
$(ADDITIONAL_INCLUDE_DIRS) -I. $(SYSTEM_INCLUDES) \
-I$(GNUSTEP_HEADERS_FND) -I$(GNUSTEP_HEADERS_GUI) -I$(GNUSTEP_HEADERS)
$(GNUSTEP_HEADERS_FND_FLAG) $(GNUSTEP_HEADERS_GUI_FLAG) -I$(GNUSTEP_HEADERS)
ALL_LDFLAGS = $(INTERNAL_LDFLAGS) $(ADDITIONAL_LDFLAGS) \
$(FND_LDFLAGS) $(GUI_LDFLAGS) $(BACKEND_LDFLAGS) \
@ -45,41 +45,35 @@ VPATH = .
.SUFFIXES: .m .c .psw
$(GNUSTEP_OBJ_DIR)/%${OEXT} : %.m
$(CC) -c $(ALL_CPPFLAGS) $(ALL_OBJCFLAGS) \
-o $@ $<
.PRECIOUS: %.c %.h $(GNUSTEP_OBJ_DIR)/%${OEXT}
$(GNUSTEP_OBJ_DIR)/%${OEXT} : %.c
$(CC) -c $(ALL_CPPFLAGS) $(ALL_CFLAGS) \
-o $@ $<
$(GNUSTEP_OBJ_DIR)/%${OEXT} : %.m
$(CC) -c $(ALL_CPPFLAGS) $(ALL_OBJCFLAGS) \
-o $@ $<
%.c : %.psw
pswrap -h $*.h -o $@ $<
$(GNUSTEP_OBJ_DIR)/%_pic${OEXT}: %.m
$(CC) -c $(ALL_CPPFLAGS) $(SHARED_CFLAGS) $(ALL_OBJCFLAGS) \
-o $@ $<
$(GNUSTEP_OBJ_DIR)/%_pic${OEXT}: %.c
$(CC) -c $(ALL_CPPFLAGS) $(SHARED_CFLAGS) $(ALL_CFLAGS) \
-o $@ $<
# The magical app rule, thank you GNU make!
%.app : FORCE
@echo Making $*...
@$(MAKE) internal-app-all \
APP_NAME=$* \
OBJC_FILES="$($*_OBJC_FILES)" \
C_FILES="$($*_C_FILES)" \
PSWRAP_FILES="$($*_PSWRAP_FILES)"
APP_NAME=$* \
OBJC_FILES="$($*_OBJC_FILES)" \
C_FILES="$($*_C_FILES)" \
PSWRAP_FILES="$($*_PSWRAP_FILES)"
%.tool : FORCE
@echo Making $*...
@$(MAKE) internal-tool-all \
TOOL_NAME=$* \
OBJC_FILES="$($*_OBJC_FILES)" \
C_FILES="$($*_C_FILES)" \
PSWRAP_FILES="$($*_PSWRAP_FILES)"
TOOL_NAME=$* \
OBJC_FILES="$($*_OBJC_FILES)" \
C_FILES="$($*_C_FILES)" \
PSWRAP_FILES="$($*_PSWRAP_FILES)"
#
# The list of Objective-C source files to be compiled
@ -93,36 +87,14 @@ $(GNUSTEP_OBJ_DIR)/%_pic${OEXT}: %.c
OBJC_OBJS = $(OBJC_FILES:.m=${OEXT})
OBJC_OBJ_FILES = $(addprefix $(GNUSTEP_OBJ_DIR)/,$(OBJC_OBJS))
ifeq ($(HAVE_SHARED_LIBS), yes)
SHARED_OBJC_OBJS = $(OBJC_FILES:.m=_pic${OEXT})
SHARED_OBJC_OBJ_FILES = $(addprefix $(GNUSTEP_OBJ_DIR)/,$(SHARED_OBJC_OBJS))
else
SHARED_OBJC_OBJS =
SHARED_OBJC_OBJ_FILES =
endif
PSWRAP_C_FILES = $(PSWRAP_FILES:.psw=.c)
PSWRAP_H_FILES = $(PSWRAP_FILES:.psw=.h)
PSWRAP_OBJS = $(PSWRAP_FILES:.psw=${OEXT})
PSWRAP_OBJ_FILES = $(addprefix $(GNUSTEP_OBJ_DIR)/,$(PSWRAP_OBJS))
ifeq ($(HAVE_SHARED_LIBS), yes)
SHARED_PSWRAP_OBJS = $(PSWRAP_FILES:.psw=_pic${OEXT})
SHARED_PSWRAP_OBJ_FILES= $(addprefix $(GNUSTEP_OBJ_DIR)/,$(SHARED_PSWRAP_OBJS))
else
SHARED_PSWRAP_OBJS =
SHARED_PSWRAP_OBJ_FILES =
endif
C_OBJS = $(C_FILES:.c=${OEXT})
C_OBJ_FILES = $(PSWRAP_OBJ_FILES) $(addprefix $(GNUSTEP_OBJ_DIR)/,$(C_OBJS))
ifeq ($(HAVE_SHARED_LIBS), yes)
SHARED_C_OBJS = $(C_FILES:.c=_pic${OEXT})
SHARED_C_OBJ_FILES = $(SHARED_PSWRAP_OBJ_FILES) \
$(addprefix $(GNUSTEP_OBJ_DIR)/,$(SHARED_C_OBJS))
else
SHARED_C_OBJS =
SHARED_C_OBJ_FILES =
endif
#
# Global targets
@ -139,6 +111,10 @@ distclean:: before-distclean internal-distclean after-distclean
check:: before-check internal-check after-check
# The rule to create the objects file directory
$(GNUSTEP_OBJ_DIR):
@$(GNUSTEP_MAKEFILES)/mkinstalldirs ./$(GNUSTEP_OBJ_DIR)
#
# Placeholders for internal targets
#

View file

@ -21,10 +21,12 @@
# Run config.guess to guess the host
GNUSTEP_HOST := $(shell $(CONFIG_GUESS_SCRIPT))
GNUSTEP_HOST_CPU := $(shell $(CONFIG_CPU_SCRIPT) $(GNUSTEP_HOST))
GNUSTEP_HOST_VENDOR := $(shell $(CONFIG_VENDOR_SCRIPT) $(GNUSTEP_HOST))
GNUSTEP_HOST_OS := $(shell $(CONFIG_OS_SCRIPT) $(GNUSTEP_HOST))
ifneq ($(internal_names_clean), yes)
export GNUSTEP_HOST := $(shell $(CONFIG_GUESS_SCRIPT))
export GNUSTEP_HOST_CPU := $(shell $(CONFIG_CPU_SCRIPT) $(GNUSTEP_HOST))
export GNUSTEP_HOST_VENDOR := $(shell $(CONFIG_VENDOR_SCRIPT) $(GNUSTEP_HOST))
export GNUSTEP_HOST_OS := $(shell $(CONFIG_OS_SCRIPT) $(GNUSTEP_HOST))
endif
#
# The user can specify a `target' variable when running make
@ -74,12 +76,22 @@ TARGET_SYSTEM_LIBS := -lsocket -lnsl -ldl -lm
endif
#
# Specific settings for building shared libraries
# Specific settings for building shared or static libraries on various systems
#
HAVE_SHARED_LIBS = no
STATIC_LIB_LINK_CMD = \
$(AR) $(ARFLAGS) $(AROUT)$(GNUSTEP_OBJ_DIR)/$(LIBRARY_FILE) $^; \
$(RANLIB) $(GNUSTEP_OBJ_DIR)/$(LIBRARY_FILE)
AFTER_INSTALL_STATIC_LIB_COMMAND = \
$(RANLIB) $(GNUSTEP_LIBRARIES)/$(LIBRARY_FILE);
SHARED_LIB_LINK_CMD =
SHARED_CFLAGS =
SHARE_LIBEXT =
AFTER_INSTALL_SHARED_LIB_COMMAND = \
(cd $(GNUSTEP_LIBRARIES); \
rm -f $(LIBRARY_FILE); \
$(LN_S) $(VERSION_LIBRARY_FILE) $(LIBRARY_FILE))
#
# OpenStep 4.x
@ -87,12 +99,29 @@ SHARE_LIBEXT =
ifeq ($(GNUSTEP_TARGET_OS), nextstep4)
HAVE_SHARED_LIBS = yes
SHARED_LIB_LINK_CMD = \
libtool -dynamic -o $@ \
/bin/libtool -dynamic -o $@ \
/NextLibrary/Frameworks/System.framework/System \
$(GNUSTEP_LIBRARIES)/libobjc$(SHARED_LIBEXT) \
$(GNUSTEP_LIBRARIES)/libgcc$(SHARED_LIBEXT) $^ \
>/dev/null
ifeq ($(OBJC_RUNTIME_LIB), gnu)
STATIC_LIB_LINK_CMD = \
/bin/libtool -static -o $@ \
/NextLibrary/Frameworks/System.framework/System \
$(GNUSTEP_LIBRARIES)/libobjc$(SHARED_LIBEXT) \
$(GNUSTEP_LIBRARIES)/libgcc$(SHARED_LIBEXT) $^ \
>/dev/null
else
# not tested
STATIC_LIB_LINK_CMD = \
/bin/libtool -static -o $@ \
/NextLibrary/Frameworks/System.framework/System \
$(GNUSTEP_LIBRARIES)/libgcc$(SHARED_LIBEXT) $^ \
>/dev/null
endif
AFTER_INSTALL_STATIC_LIB_COMMAND =
SHARED_CFLAGS += -dynamic
SHARED_LIBEXT = .a
endif
@ -103,11 +132,11 @@ endif
ifeq ($(GNUSTEP_TARGET_OS), linux-gnu)
HAVE_SHARED_LIBS = yes
SHARED_LIB_LINK_CMD = \
$(CC) -shared -W,l,soname=$(SHARED_LIBRARY_FILE) \
-o $(GNUSTEP_OBJ_DIR)/$(SHARED_LIBRARY_FILE) $^ ;\
$(CC) -shared -W,l,soname=$(LIBRARY_FILE) \
-o $(GNUSTEP_OBJ_DIR)/$(VERSION_LIBRARY_FILE) $^ ;\
(cd $(GNUSTEP_OBJ_DIR); \
rm -f $(SHARED_LIBRARY_NAME); \
$(LN_S) $(SHARED_LIBRARY_FILE) $(SHARED_LIBRARY_NAME))
rm -f $(LIBRARY_FILE); \
$(LN_S) $(VERSION_LIBRARY_FILE) $(LIBRARY_FILE))
SHARED_CFLAGS += -fPIC
SHARED_LIBEXT = .so
@ -120,11 +149,11 @@ endif
ifeq ($(findstring solaris, $(GNUSTEP_TARGET_OS)), solaris)
HAVE_SHARED_LIBS = yes
SHARED_LIB_LINK_CMD = \
$(CC) -G -o $(SHARED_LIBRARY_FILE) $^ ;\
mv $(SHARED_LIBRARY_FILE) $(GNUSTEP_OBJ_DIR) ;\
$(CC) -G -o $(VERSION_LIBRARY_FILE) $^ ;\
mv $(VERSION_LIBRARY_FILE) $(GNUSTEP_OBJ_DIR) ;\
(cd $(GNUSTEP_OBJ_DIR); \
rm -f $(SHARED_LIBRARY_NAME); \
$(LN_S) $(SHARED_LIBRARY_FILE) $(SHARED_LIBRARY_NAME))
rm -f $(LIBRARY_FILE); \
$(LN_S) $(VERSION_LIBRARY_FILE) $(LIBRARY_FILE))
SHARED_CFLAGS += -fpic -fPIC
SHARED_LIBEXT = .so

View file

@ -47,16 +47,12 @@ $(GNUSTEP_OBJ_DIR)/stamp-tool-% : $(C_OBJ_FILES) $(OBJC_OBJ_FILES)
#
# Compilation targets
#
internal-all:: $(TOOL_LIST)
internal-all:: $(GNUSTEP_OBJ_DIR) $(TOOL_LIST)
internal-tool-all:: object-dir build-tool
internal-tool-all:: build-tool
build-tool:: $(GNUSTEP_OBJ_DIR)/stamp-tool-$(TOOL_NAME)
object-dir::
@$(GNUSTEP_MAKEFILES)/mkinstalldirs \
./$(GNUSTEP_OBJ_DIR)
#
# Cleaning targets
#