Reworked rules.make to be much simpler and faster.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/tools/make/trunk@2626 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Ovidiu Predescu 1997-11-13 03:18:16 +00:00
parent 6fc18be4b7
commit 6162870cd1
14 changed files with 409 additions and 466 deletions

View file

@ -1,7 +1,31 @@
Wed Nov 12 13:29:24 1997 Ovidiu Predescu <ovidiu@net-community.com>
* common.make (OBJCFLAGS): Removed the -Wno-implicit flag since it
could hide some programming errors.
Tue Nov 11 14:43:56 1997 Adam Fedor <fedor@doc.com>
* target.make (Solaris/BUNDLE_LDFLAGS): Change the flags.
Fri Nov 7 16:33:22 1997 Ovidiu Predescu <ovidiu@net-community.com>
Reworked a bunch of files to be more general and faster.
* clean.make: File removed.
* GNUmakefile.in: Removed the clean.make.
* rules.make: Reworked to be simpler and faster.
* library.make: Reworked for the new rules.make.
* names.make: Likewise.
* objc.make: Likewise.
* tool.make: Likewise.
* application.make: Likewise. Wrote the install target support.
* config.make.in: New definition for TAR.
* test.make (testbundle-resource-files): Added __done at the end of the
for list command so the shell doesn't crash if the list is empty.
* brain.make: Small changes on the OPENSTEP support.
* target.make: Added LIBRARIES_DEPEND_UPON to the list of libraries
for OPENSTEP.
Sat Nov 1 13:17:07 1997 Scott Christley <scottc@net-community.com>
* brain.make: Export LIBRARY_COMBO.

View file

@ -68,7 +68,7 @@ install: all
done
$(INSTALL_PROGRAM) -m 755 openapp $(tooldir); \
$(INSTALL_PROGRAM) -m 755 debugapp $(tooldir); \
for f in aggregate.make application.make bundle.make clean.make \
for f in aggregate.make application.make bundle.make \
common.make brain.make library.make rules.make target.make \
tool.make test.make names.make objc.make MediaBook.func; do \
$(INSTALL_DATA) $$f $(makedir); \

View file

@ -43,18 +43,46 @@ else
endif
endif
ifneq ($(INTERNAL_APP_NAME),)
ifeq ($(INTERNAL_app_NAME),)
# This part gets included by the first invoked make process.
internal-all:: $(APP_NAME:=.all.app.variables)
internal-install:: $(APP_NAME:=.install.app.variables)
internal-uninstall:: $(APP_NAME:=.uninstall.app.variables)
internal-clean:: $(APP_NAME:=.clean.app.variables)
internal-distclean:: $(APP_NAME:=.distclean.app.variables)
$(APP_NAME):
@$(MAKE) --no-print-directory $@.all.app.variables
else
# Libraries that go before the GUI libraries
ALL_GUI_LIBS = $(ADDITIONAL_GUI_LIBS) $(AUXILIARY_GUI_LIBS) $(BACKEND_LIBS) \
$(GUI_LIBS) $(ADDITIONAL_TOOL_LIBS) $(AUXILIARY_TOOL_LIBS) \
$(FND_LIBS) $(ADDITIONAL_OBJC_LIBS) $(AUXILIARY_OBJC_LIBS) $(OBJC_LIBS) \
$(SYSTEM_LIBS) $(TARGET_SYSTEM_LIBS)
ALL_GUI_LIBS := \
$(shell $(WHICH_LIB_SCRIPT) $(LIB_DIRS_NO_SYSTEM) $(ALL_GUI_LIBS) \
debug=$(debug) profile=$(profile) shared=$(shared) libext=$(LIBEXT) \
shared_libext=$(SHARED_LIBEXT))
# Don't include these definitions the first time make is invoked. This part is
# included when make is invoked the second time from the %.buildapp rule (see
# included when make is invoked the second time from the %.build rule (see
# rules.make).
APP_DIR_NAME = $(INTERNAL_APP_NAME:=.$(APP_EXTENSION))
APP_DIR_NAME = $(INTERNAL_app_NAME:=.$(APP_EXTENSION))
# Support building NeXT applications
ifneq ($(OBJC_COMPILER), NeXT)
APP_FILE = \
$(APP_DIR_NAME)/$(GNUSTEP_TARGET_DIR)/$(LIBRARY_COMBO)/$(INTERNAL_APP_NAME)$(EXEEXT)
$(APP_DIR_NAME)/$(GNUSTEP_TARGET_DIR)/$(LIBRARY_COMBO)/$(INTERNAL_app_NAME)$(EXEEXT)
else
APP_FILE = $(APP_DIR_NAME)/$(INTERNAL_APP_NAME)$(EXEEXT)
APP_FILE = $(APP_DIR_NAME)/$(INTERNAL_app_NAME)$(EXEEXT)
endif
#
@ -69,26 +97,36 @@ $(APP_FILE): $(C_OBJ_FILES) $(OBJC_OBJ_FILES)
ifeq ($(OBJC_COMPILER), NeXT)
# This is a hack for OPENSTEP systems to remove the iconheader file
# automatically generated by the makefile package.
rm -f $(INTERNAL_APP_NAME).iconheader
rm -f $(INTERNAL_app_NAME).iconheader
endif
#
# Compilation targets
#
ifeq ($(OBJC_COMPILER), NeXT)
internal-all:: $(INTERNAL_APP_NAME).iconheader $(GNUSTEP_OBJ_DIR) \
$(APP_DIR_NAME) $(APP_FILE) app-resource-files
internal-app-all:: before-$(TARGET)-all $(INTERNAL_app_NAME).iconheader \
$(GNUSTEP_OBJ_DIR) $(APP_DIR_NAME) $(APP_FILE) app-resource-files \
after-$(TARGET)-all
$(INTERNAL_APP_NAME).iconheader:
@(echo "F $(INTERNAL_APP_NAME).$(APP_EXTENSION) $(INTERNAL_APP_NAME) $(APP_EXTENSION)"; \
echo "F $(INTERNAL_APP_NAME) $(INTERNAL_APP_NAME) app") >$@
before-$(TARGET)-all::
after-$(TARGET)-all::
$(INTERNAL_app_NAME).iconheader:
@(echo "F $(INTERNAL_app_NAME).$(APP_EXTENSION) $(INTERNAL_app_NAME) $(APP_EXTENSION)"; \
echo "F $(INTERNAL_app_NAME) $(INTERNAL_app_NAME) app") >$@
$(APP_DIR_NAME):
mkdir $@
else
internal-all:: $(GNUSTEP_OBJ_DIR) \
internal-app-all:: before-$(TARGET)-all $(GNUSTEP_OBJ_DIR) \
$(APP_DIR_NAME)/$(GNUSTEP_TARGET_DIR)/$(LIBRARY_COMBO) $(APP_FILE) \
app-resource-files
app-resource-files after-$(TARGET)-all
before-$(TARGET)-all::
after-$(TARGET)-all::
$(APP_DIR_NAME)/$(GNUSTEP_TARGET_DIR)/$(LIBRARY_COMBO):
@$(GNUSTEP_MAKEFILES)/mkinstalldirs \
@ -101,14 +139,16 @@ app-resource-files::
cp -r $(RESOURCE_FILES) $(APP_DIR_NAME); \
fi)
else
# This part gets included by the first invoked make process.
internal-all:: $(APP_NAME:=.buildapp)
internal-app-install::
$(TAR) cf - $(APP_DIR_NAME) | (cd $(GNUSTEP_APPS); $(TAR) xf -)
internal-app-uninstall::
(cd $(GNUSTEP_APPS); rm -rf $(APP_DIR_NAME))
#
# Cleaning targets
#
internal-clean::
internal-app-clean::
rm -rf $(GNUSTEP_OBJ_PREFIX)/$(GNUSTEP_TARGET_CPU)/$(GNUSTEP_TARGET_OS)/$(LIBRARY_COMBO)
ifeq ($(OBJC_COMPILER), NeXT)
rm -f *.iconheader
@ -120,11 +160,9 @@ else
endif
internal-distclean::
internal-app-distclean::
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 *.app *.debug *.profile *.iconheader
$(APP_NAME):
@$(MAKE) --no-print-directory $@.buildapp
endif

View file

@ -107,11 +107,8 @@ FND_DEFINE = -DLIB_FOUNDATION_LIBRARY=1
endif
ifeq ($(FOUNDATION_LIB),nx)
FND_LDFLAGS = -framework Foundation
FND_LIBS =
endif
ifeq ($(FOUNDATION_LIB), nx)
FND_LDFLAGS =
FND_LIBS = -framework Foundation
FND_DEFINE = -DNeXT_Foundation_LIBRARY=1
endif
@ -130,14 +127,13 @@ GUI_LIBS = -lgnustep-gui
endif
ifeq ($(GUI_LIB),nx)
ifneq ($(INTERNAL_APP_NAME),)
ifneq ($(INTERNAL_app_NAME),)
# If we're building an application pass the following additional flags to
# the linker
GUI_LDFLAGS = -sectcreate __ICON __header $(INTERNAL_APP_NAME).iconheader \
GUI_LDFLAGS = -sectcreate __ICON __header $(INTERNAL_app_NAME).iconheader \
-segprot __ICON r r -sectcreate __ICON app /NextLibrary/Frameworks/AppKit.framework/Resources/NSDefaultApplicationIcon.tiff \
-framework AppKit
GUI_LIBS =
-framework AppKit
GUI_LIBS =
endif
endif

View file

@ -1,40 +0,0 @@
#
# clean.make
#
# Clean up the host and target names
#
# Copyright (C) 1997 Free Software Foundation, Inc.
#
# Author: Scott Christley <scottc@net-community.com>
#
# 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.
ifneq ($(internal_names_clean), yes)
# Clean up the host names
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
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))
ifneq ($(arch),)
export CLEANED_ARCH = $(foreach a, $(arch), $(shell $(CLEAN_CPU_SCRIPT) $(a)))
endif
export internal_names_clean=yes
endif

View file

@ -168,7 +168,7 @@ endif
#
# Overridable compilation flags
#
OBJCFLAGS = -Wno-implicit -Wno-import
OBJCFLAGS = -Wno-import
CFLAGS =
OBJ_DIR_PREFIX =

View file

@ -54,6 +54,7 @@ LEX = lex
INSTALL = @HOST_INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
TAR = tar
# The default library combination
library_combo = @ac_cv_library_combo@

View file

@ -38,38 +38,31 @@ include $(GNUSTEP_SYSTEM_ROOT)/Makefiles/rules.make
# Where xxx is the name of the library
#
ifeq ($(INTERNAL_LIBRARY_NAME),)
ifeq ($(INTERNAL_library_NAME),)
# This part is included the first time make is invoked.
internal-all:: $(LIBRARY_NAME:=.buildlib)
internal-all:: $(LIBRARY_NAME:=.all.library.variables)
internal-install:: all $(LIBRARY_NAME:=.installlib)
internal-install:: $(LIBRARY_NAME:=.install.library.variables)
internal-uninstall:: $(LIBRARY_NAME:=.uninstalllib)
internal-uninstall:: $(LIBRARY_NAME:=.uninstall.library.variables)
#
# Cleaning targets
#
internal-clean::
rm -rf $(GNUSTEP_OBJ_DIR)
internal-clean:: $(LIBRARY_NAME:=.clean.library.variables)
internal-distclean::
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
internal-distclean:: $(LIBRARY_NAME:=.distclean.library.variables)
$(LIBRARY_NAME):
@$(MAKE) --no-print-directory $@.buildlib
@$(MAKE) --no-print-directory $@.all.library.variables
else
# This part gets included the second time make is invoked.
ifeq ($(shared), yes)
LIBRARY_FILE = $(INTERNAL_LIBRARY_NAME)$(LIBRARY_NAME_SUFFIX)$(SHARED_LIBEXT)
LIBRARY_FILE = $(INTERNAL_library_NAME)$(LIBRARY_NAME_SUFFIX)$(SHARED_LIBEXT)
LIBRARY_FILE_EXT=$(SHARED_LIBEXT)
VERSION_LIBRARY_FILE = $(LIBRARY_FILE).$(VERSION)
else
LIBRARY_FILE = $(INTERNAL_LIBRARY_NAME)$(LIBRARY_NAME_SUFFIX)$(LIBEXT)
LIBRARY_FILE = $(INTERNAL_library_NAME)$(LIBRARY_NAME_SUFFIX)$(LIBEXT)
LIBRARY_FILE_EXT=$(LIBEXT)
VERSION_LIBRARY_FILE = $(LIBRARY_FILE)
endif
@ -85,22 +78,25 @@ endif
#
# Compilation targets
#
internal-all:: $(GNUSTEP_OBJ_DIR) $(GNUSTEP_OBJ_DIR)/$(VERSION_LIBRARY_FILE) \
import-library
internal-library-all:: before-$(TARGET)-all $(GNUSTEP_OBJ_DIR) \
$(GNUSTEP_OBJ_DIR)/$(VERSION_LIBRARY_FILE) import-library \
after-$(TARGET)-all
$(GNUSTEP_OBJ_DIR)/$(VERSION_LIBRARY_FILE): $(C_OBJ_FILES) $(OBJC_OBJ_FILES)
$(LIB_LINK_CMD)
before-$(TARGET)-all::
after-$(TARGET)-all::
import-library::
#
# Install and uninstall targets
#
internal-install:: internal-install-dirs internal-install-lib \
internal-library-install:: internal-install-dirs internal-install-lib \
internal-install-headers
before-install:: all
internal-install-dirs::
$(GNUSTEP_MAKEFILES)/mkinstalldirs \
$(GNUSTEP_LIBRARIES_ROOT)/$(GNUSTEP_TARGET_DIR) \
@ -130,7 +126,7 @@ internal-install-lib::
internal-install-import-lib::
internal-uninstall:: internal-uninstall-headers internal-uninstall-lib
internal-library-uninstall:: internal-uninstall-headers internal-uninstall-lib
internal-uninstall-headers::
for file in $(HEADER_FILES); do \
@ -149,10 +145,10 @@ internal-uninstall-import-lib::
#
# Cleaning targets
#
internal-clean::
rm -rf $(GNUSTEP_OBJ_PREFIX)
internal-library-clean::
rm -rf $(GNUSTEP_OBJ_DIR)
internal-distclean::
internal-library-distclean::
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
@ -160,6 +156,6 @@ internal-distclean::
#
# Testing targets
#
internal-check::
internal-library-check::
endif

View file

@ -23,10 +23,16 @@
# Run config.guess to guess the 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))
ifeq ($(GNUSTEP_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))
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))
endif
endif
#
@ -52,9 +58,12 @@ GNUSTEP_TARGET_CPU := $(shell $(CONFIG_CPU_SCRIPT) $(GNUSTEP_TARGET))
GNUSTEP_TARGET_VENDOR := $(shell $(CONFIG_VENDOR_SCRIPT) $(GNUSTEP_TARGET))
GNUSTEP_TARGET_OS := $(shell $(CONFIG_OS_SCRIPT) $(GNUSTEP_TARGET))
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))
endif
#
# Clean up the host and target names
#
include $(GNUSTEP_SYSTEM_ROOT)/Makefiles/clean.make
ifneq ($(arch),)
export CLEANED_ARCH = $(foreach a, $(arch), $(shell $(CLEAN_CPU_SCRIPT) $(a)))
endif

View file

@ -19,61 +19,88 @@
# If not, write to the Free Software Foundation,
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# The name of the ObjC program is in the OBJC_PROGRAM_NAME variable.
#
# xxx We need to prefix the target name when cross-compiling
#
#
# Include in the common makefile rules
#
include $(GNUSTEP_SYSTEM_ROOT)/Makefiles/rules.make
ifeq ($(INTERNAL_objc_program_NAME),)
# This part gets included by the first invoked make process.
internal-all:: $(OBJC_PROGRAM_NAME:=.all.objc-program.variables)
internal-install:: $(OBJC_PROGRAM_NAME:=.install.objc-program.variables)
internal-uninstall:: $(OBJC_PROGRAM_NAME:=.uninstall.objc-program.variables)
internal-clean:: $(OBJC_PROGRAM_NAME:=.clean.objc-program.variables)
internal-distclean:: $(OBJC_PROGRAM_NAME:=.distclean.objc-program.variables)
$(OBJC_PROGRAM_NAME):
@$(MAKE) --no-print-directory $@.all.objc-program.variables
else
# This is the directory where the objc programss get installed. If you
# don't specify a directory they will get installed in the GNUstep
# system root.
OBJC_PROGRAM_INSTALLATION_DIR = \
$(GNUSTEP_INSTALLATION_DIR)/Tools
#
# The name of the ObjC program is in the OBJC_PROGRAM_NAME variable.
#
# xxx We need to prefix the target name when cross-compiling
#
OBJC_PROGRAM_LIST := $(OBJC_PROGRAM_NAME:=.buildobjc)
OBJC_PROGRAM_FILE = $(OBJC_PROGRAM_LIST)
ALL_OBJC_LIBS = $(ADDITIONAL_OBJC_LIBS) $(AUXILIARY_OBJC_LIBS) $(OBJC_LIBS) \
$(TARGET_SYSTEM_LIBS)
ALL_OBJC_LIBS := \
$(shell $(WHICH_LIB_SCRIPT) $(LIB_DIRS_NO_SYSTEM) $(ALL_OBJC_LIBS) \
debug=$(debug) profile=$(profile) shared=$(shared) libext=$(LIBEXT) \
shared_libext=$(SHARED_LIBEXT))
#
# Internal targets
#
$(OBJC_PROGRAM_NAME) : $(C_OBJ_FILES) $(OBJC_OBJ_FILES)
$(LD) $(ALL_LDFLAGS) $(LDOUT)$(OBJC_PROGRAM_NAME) \
$(GNUSTEP_OBJ_DIR)/$(INTERNAL_objc_program_NAME): \
$(C_OBJ_FILES) $(OBJC_OBJ_FILES)
$(LD) $(ALL_LDFLAGS) $(LDOUT)$@ \
$(C_OBJ_FILES) $(OBJC_OBJ_FILES) \
$(ALL_LIB_DIRS) $(ALL_OBJC_LIBS)
#
# Compilation targets
#
internal-all:: $(GNUSTEP_OBJ_DIR) $(OBJC_PROGRAM_LIST)
internal-objc-program-all:: before-$(TARGET)-all $(GNUSTEP_OBJ_DIR) \
$(GNUSTEP_OBJ_DIR)/$(INTERNAL_objc_program_NAME) after-$(TARGET)-all
internal-objc-all:: build-objc-program
before-$(TARGET)-all::
internal-install:: all internal-install-objc-dirs internal-install-objc-program
after-$(TARGET)-all::
internal-objc-program-install:: internal-install-objc-dirs install-objc-program
internal-install-objc-dirs::
$(GNUSTEP_MAKEFILES)/mkinstalldirs $(OBJC_PROGRAM_INSTALLATION_DIR)
internal-install-objc-program::
for f in $(OBJC_PROGRAM_NAME); do \
$(INSTALL_PROGRAM) -m 0755 $$f $(OBJC_PROGRAM_INSTALLATION_DIR); \
done
build-objc-program:: $(OBJC_PROGRAM_NAME)
install-objc-program::
$(INSTALL_PROGRAM) -m 0755 $(INTERNAL_objc_program_NAME) \
$(OBJC_PROGRAM_INSTALLATION_DIR);
#
# Cleaning targets
#
internal-clean::
internal-objc-program-clean::
rm -f $(OBJC_PROGRAM_NAME)
rm -rf $(GNUSTEP_OBJ_PREFIX)
internal-distclean::
internal-objc-program-distclean::
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
endif

View file

@ -6,6 +6,7 @@
# Copyright (C) 1997 Free Software Foundation, Inc.
#
# Author: Scott Christley <scottc@net-community.com>
# Author: Ovidiu Predescu <ovidiu@net-community.com>
#
# This file is part of the GNUstep Makefile Package.
#
@ -19,311 +20,29 @@
# If not, write to the Free Software Foundation,
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# Don't reload all the rules if already loaded
ifneq ($(RULES_LOADED),yes)
RULES_LOADED := yes
ALL_CPPFLAGS = $(CPPFLAGS) $(ADDITIONAL_CPPFLAGS) $(AUXILIARY_CPPFLAGS)
ALL_OBJCFLAGS = $(INTERNAL_OBJCFLAGS) $(ADDITIONAL_OBJCFLAGS) \
$(AUXILIARY_OBJCFLAGS) $(ADDITIONAL_INCLUDE_DIRS) \
$(AUXILIARY_INCLUDE_DIRS) -I. $(SYSTEM_INCLUDES) \
$(GNUSTEP_HEADERS_FND_FLAG) $(GNUSTEP_HEADERS_GUI_FLAG) \
-I$(GNUSTEP_HEADERS_TARGET_FLAG) -I$(GNUSTEP_USER_HEADERS) \
-I$(GNUSTEP_LOCAL_HEADERS) -I$(GNUSTEP_SYSTEM_HEADERS)
ALL_CFLAGS = $(INTERNAL_CFLAGS) $(ADDITIONAL_CFLAGS) \
$(AUXILIARY_CFLAGS) $(ADDITIONAL_INCLUDE_DIRS) \
$(AUXILIARY_INCLUDE_DIRS) -I. $(SYSTEM_INCLUDES) \
$(GNUSTEP_HEADERS_FND_FLAG) $(GNUSTEP_HEADERS_GUI_FLAG) \
-I$(GNUSTEP_HEADERS_TARGET_FLAG) -I$(GNUSTEP_USER_HEADERS) \
-I$(GNUSTEP_LOCAL_HEADERS) -I$(GNUSTEP_SYSTEM_HEADERS)
ALL_LDFLAGS = $(ADDITIONAL_LDFLAGS) $(AUXILIARY_LDFLAGS) $(GUI_LDFLAGS) \
$(BACKEND_LDFLAGS) $(SYSTEM_LDFLAGS) $(INTERNAL_LDFLAGS)
ALL_LIB_DIRS = $(ADDITIONAL_LIB_DIRS) $(AUXILIARY_LIB_DIRS) \
-L$(GNUSTEP_USER_LIBRARIES) -L$(GNUSTEP_USER_LIBRARIES_ROOT) \
-L$(GNUSTEP_LOCAL_LIBRARIES) -L$(GNUSTEP_LOCAL_LIBRARIES_ROOT) \
-L$(GNUSTEP_SYSTEM_LIBRARIES) -L$(GNUSTEP_SYSTEM_LIBRARIES_ROOT) \
$(SYSTEM_LIB_DIR)
ALL_OBJC_LIBS = $(ADDITIONAL_TOOL_LIBS) $(AUXILIARY_TOOL_LIBS) \
$(OBJC_LIBS) $(TARGET_SYSTEM_LIBS)
ALL_TOOL_LIBS = $(ADDITIONAL_TOOL_LIBS) $(AUXILIARY_TOOL_LIBS) $(FND_LIBS) \
$(OBJC_LIBS) $(TARGET_SYSTEM_LIBS)
ALL_GUI_LIBS = $(ADDITIONAL_GUI_LIBS) $(AUXILIARY_GUI_LIBS) $(BACKEND_LIBS) \
$(GUI_LIBS) $(AUXILIARY_TOOL_LIBS) \
$(FND_LIBS) $(OBJC_LIBS) $(SYSTEM_LIBS) $(TARGET_SYSTEM_LIBS)
LIB_DIRS_NO_SYSTEM = $(ADDITIONAL_LIB_DIRS) \
-L$(GNUSTEP_USER_LIBRARIES) -L$(GNUSTEP_USER_LIBRARIES_ROOT) \
-L$(GNUSTEP_LOCAL_LIBRARIES) -L$(GNUSTEP_LOCAL_LIBRARIES_ROOT) \
-L$(GNUSTEP_SYSTEM_LIBRARIES) -L$(GNUSTEP_SYSTEM_LIBRARIES_ROOT)
ALL_OBJC_LIBS := \
$(shell $(WHICH_LIB_SCRIPT) $(LIB_DIRS_NO_SYSTEM) $(ALL_OBJC_LIBS) \
debug=$(debug) profile=$(profile) shared=$(shared) libext=$(LIBEXT) \
shared_libext=$(SHARED_LIBEXT))
ALL_TOOL_LIBS := \
$(shell $(WHICH_LIB_SCRIPT) $(LIB_DIRS_NO_SYSTEM) $(ALL_TOOL_LIBS) \
debug=$(debug) profile=$(profile) shared=$(shared) libext=$(LIBEXT) \
shared_libext=$(SHARED_LIBEXT))
ALL_GUI_LIBS := \
$(shell $(WHICH_LIB_SCRIPT) $(LIB_DIRS_NO_SYSTEM) $(ALL_GUI_LIBS) \
debug=$(debug) profile=$(profile) shared=$(shared) libext=$(LIBEXT) \
shared_libext=$(SHARED_LIBEXT))
LIBRARIES_DEPEND_UPON := \
$(shell $(WHICH_LIB_SCRIPT) $(LIB_DIRS_NO_SYSTEM) $(LIBRARIES_DEPEND_UPON)\
debug=$(debug) profile=$(profile) shared=$(shared) libext=$(LIBEXT) \
shared_libext=$(SHARED_LIBEXT))
VPATH = .
.SUFFIXES: .m .c .psw
.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 $@ $<
# The magical application rules, thank you GNU make!
%.buildapp:
@echo Making $*...
@$(MAKE) --no-print-directory --no-keep-going internal-all \
INTERNAL_APP_NAME=$* \
OBJC_FILES="$($*_OBJC_FILES)" \
C_FILES="$($*_C_FILES)" \
PSWRAP_FILES="$($*_PSWRAP_FILES)" \
RESOURCE_FILES="$($*_RESOURCES)" \
RESOURCE_DIRS="$($*_RESOURCE_DIRS)"
# library recursive make rules
%.buildlib:
@echo Making $*...
@$(MAKE) --no-print-directory --no-keep-going internal-all \
INTERNAL_LIBRARY_NAME=$* \
OBJC_FILES="$($*_OBJC_FILES)" \
C_FILES="$($*_C_FILES)" \
PSWRAP_FILES="$($*_PSWRAP_FILES)" \
HEADER_FILES="$($*_HEADER_FILES)" \
HEADER_FILES_DIR="$($*_HEADER_FILES_DIR)" \
HEADER_FILES_INSTALL_DIR="$($*_HEADER_FILES_INSTALL_DIR)"
%.installlib:
@echo Making $*...
@$(MAKE) --no-print-directory --no-keep-going internal-install \
INTERNAL_LIBRARY_NAME=$* \
OBJC_FILES="$($*_OBJC_FILES)" \
C_FILES="$($*_C_FILES)" \
PSWRAP_FILES="$($*_PSWRAP_FILES)" \
HEADER_FILES="$($*_HEADER_FILES)" \
HEADER_FILES_DIR="$($*_HEADER_FILES_DIR)" \
HEADER_FILES_INSTALL_DIR="$($*_HEADER_FILES_INSTALL_DIR)"
%.uninstalllib:
@echo Making $*...
@$(MAKE) --no-print-directory --no-keep-going internal-uninstall \
INTERNAL_LIBRARY_NAME=$* \
OBJC_FILES="$($*_OBJC_FILES)" \
C_FILES="$($*_C_FILES)" \
PSWRAP_FILES="$($*_PSWRAP_FILES)" \
HEADER_FILES="$($*_HEADER_FILES)" \
HEADER_FILES_DIR="$($*_HEADER_FILES_DIR)" \
HEADER_FILES_INSTALL_DIR="$($*_HEADER_FILES_INSTALL_DIR)"
# tool recursive make rules
%.buildtool : FORCE
@echo Making $*...
@$(MAKE) --no-print-directory --no-keep-going internal-tool-all \
TOOL_NAME=$* \
OBJC_FILES="$($*_OBJC_FILES)" \
C_FILES="$($*_C_FILES)" \
PSWRAP_FILES="$($*_PSWRAP_FILES)"
# ObjC program recursive make rules
%.buildobjc : FORCE
@echo Making $*...
@$(MAKE) --no-print-directory --no-keep-going internal-objc-all \
OBJC_PROGRAM_NAME=$* \
OBJC_FILES="$($*_OBJC_FILES)" \
C_FILES="$($*_C_FILES)" \
PSWRAP_FILES="$($*_PSWRAP_FILES)"
# This part is included the first time make is invoked. This part defines the
# global targets and the following implicit rule which determines the
# TARGET_TYPE of the next thing to be build in the following make invocation
# (a library, application, tool etc.), the current name of the target from a
# specific library/application/tool/etc list and the OPERATION to be performed
# (all, install, clean, distclean etc.).
# This target has to be called with the name of the actual target, followed
# by the operation, then the makefile fragment to be called and then the
# variables word. Suppose for example we build the library libgmodel, the
# target should look like:
#
# The bundle extension (default is .bundle) is defined by BUNDLE_EXTENSION.
# libgmodel.all.library.variables
#
ifeq ($(strip $(BUNDLE_EXTENSION)),)
BUNDLE_EXTENSION = .bundle
endif
%.variables:
@(target=`echo $* | sed -e 's/\(.*\)\.\(.*\)\.\(.*\)/\1/' | tr - _`; \
operation=`echo $* | sed -e 's/\(.*\)\.\(.*\)\.\(.*\)/\2/'`; \
type=`echo $* | sed -e 's/\(.*\)\.\(.*\)\.\(.*\)/\3/'`; \
$(MAKE) --no-print-directory --no-keep-going TARGET_TYPE=$$type \
OPERATION=$${operation} TARGET=$${target} \
PROCESSED_FIRST_TIME=yes $${target}.build)
# bundle recursive make rules
%$(BUNDLE_EXTENSION) : FORCE
@echo Making $*...
@$(MAKE) --no-print-directory --no-keep-going internal-bundle-all \
BUNDLE_NAME=$* \
OBJC_FILES="$($*_OBJC_FILES)" \
C_FILES="$($*_C_FILES)" \
PSWRAP_FILES="$($*_PSWRAP_FILES)" \
RESOURCE_FILES="$($*_RESOURCES)" \
RESOURCE_DIRS="$($*_RESOURCE_DIRS)" \
BUNDLE_LIBS="$($*_BUNDLE_LIBS)"
#
# Testing rules
#
# These are for compiling
ALL_TEST_LIBRARY_LIBS = $(ADDITIONAL_LIBRARY_LIBS) $(AUXILIARY_LIBS) \
-lobjc-test \
$(AUXILIARY_TOOL_LIBS) $(FND_LIBS) $(OBJC_LIBS) $(TARGET_SYSTEM_LIBS)
ALL_TEST_BUNDLE_LIBS = $(ADDITIONAL_BUNDLE_LIBS)
ALL_TEST_TOOL_LIBS = $(ADDITIONAL_TOOL_LIBS) $(AUXILIARY_TOOL_LIBS) \
$(FND_LIBS) $(OBJC_LIBS) $(TARGET_SYSTEM_LIBS)
ALL_TEST_APP_LIBS = $(ADDITIONAL_APP_LIBS) $(AUXILIARY_GUI_LIBS) \
$(BACKEND_LIBS) $(GUI_LIBS) $(AUXILIARY_TOOL_LIBS) \
$(FND_LIBS) $(OBJC_LIBS) $(SYSTEM_LIBS) $(TARGET_SYSTEM_LIBS)
ALL_TEST_LIBRARY_LIBS := \
$(shell $(WHICH_LIB_SCRIPT) $(LIB_DIRS_NO_SYSTEM) $(ALL_TEST_LIBRARY_LIBS)\
debug=$(debug) profile=$(profile) shared=$(shared) libext=$(LIBEXT) \
shared_libext=$(SHARED_LIBEXT))
ALL_TEST_BUNDLE_LIBS := \
$(shell $(WHICH_LIB_SCRIPT) $(LIB_DIRS_NO_SYSTEM) $(ALL_TEST_BUNDLE_LIBS) \
debug=$(debug) profile=$(profile) shared=$(shared) libext=$(LIBEXT) \
shared_libext=$(SHARED_LIBEXT))
ALL_TEST_TOOL_LIBS := \
$(shell $(WHICH_LIB_SCRIPT) $(LIB_DIRS_NO_SYSTEM) $(ALL_TEST_TOOL_LIBS) \
debug=$(debug) profile=$(profile) shared=$(shared) libext=$(LIBEXT) \
shared_libext=$(SHARED_LIBEXT))
ALL_TEST_APP_LIBS := \
$(shell $(WHICH_LIB_SCRIPT) $(LIB_DIRS_NO_SYSTEM) $(ALL_TEST_APP_LIBS) \
debug=$(debug) profile=$(profile) shared=$(shared) libext=$(LIBEXT) \
shared_libext=$(SHARED_LIBEXT))
%.testlib : FORCE
@echo Making $*...
@$(MAKE) --no-print-directory --no-keep-going internal-testlib-all \
TEST_LIBRARY_NAME=$* \
OBJC_FILES="$($*_OBJC_FILES)" \
C_FILES="$($*_C_FILES)" \
PSWRAP_FILES="$($*_PSWRAP_FILES)" \
ADDITIONAL_INCLUDE_DIRS="$(ADDITIONAL_INCLUDE_DIRS) $($*_INCLUDE_DIRS)" \
ADDITIONAL_LIBRARY_LIBS="$($*_LIBS)" \
ADDITIONAL_LIB_DIRS="$(ADDITIONAL_LIB_DIRS) $($*_LIB_DIRS)" \
SCRIPTS_DIRECTORY="$($*_SCRIPTS_DIRECTORY)"
%.testbundle : FORCE
@echo Making $*...
@$(MAKE) --no-print-directory --no-keep-going internal-testbundle-all \
TEST_BUNDLE_NAME=$* \
OBJC_FILES="$($*_OBJC_FILES)" \
C_FILES="$($*_C_FILES)" \
PSWRAP_FILES="$($*_PSWRAP_FILES)" \
RESOURCE_FILES="$($*_RESOURCES)" \
RESOURCE_DIRS="$($*_RESOURCE_DIRS)" \
ADDITIONAL_INCLUDE_DIRS="$(ADDITIONAL_INCLUDE_DIRS) $($*_INCLUDE_DIRS)" \
ADDITIONAL_BUNDLE_LIBS="$($*_LIBS)" \
ADDITIONAL_LIB_DIRS="$(ADDITIONAL_LIB_DIRS) $($*_LIB_DIRS)" \
SCRIPTS_DIRECTORY="$($*_SCRIPTS_DIRECTORY)"
%.testtool : FORCE
@echo Making $*...
@$(MAKE) --no-print-directory --no-keep-going internal-testtool-all \
TEST_TOOL_NAME=$* \
OBJC_FILES="$($*_OBJC_FILES)" \
C_FILES="$($*_C_FILES)" \
PSWRAP_FILES="$($*_PSWRAP_FILES)" \
ADDITIONAL_INCLUDE_DIRS="$(ADDITIONAL_INCLUDE_DIRS) $($*_INCLUDE_DIRS)" \
ADDITIONAL_TOOL_LIBS="$($*_LIBS)" \
ADDITIONAL_LIB_DIRS="$(ADDITIONAL_LIB_DIRS) $($*_LIB_DIRS)" \
SCRIPTS_DIRECTORY="$($*_SCRIPTS_DIRECTORY)"
%.testapp : FORCE
@echo Making $*...
@$(MAKE) --no-print-directory --no-keep-going internal-testapp-all \
INTERNAL_TEST_APP_NAME=$* \
OBJC_FILES="$($*_OBJC_FILES)" \
C_FILES="$($*_C_FILES)" \
PSWRAP_FILES="$($*_PSWRAP_FILES)" \
RESOURCE_FILES="$($*_RESOURCES)" \
RESOURCE_DIRS="$($*_RESOURCE_DIRS)" \
ADDITIONAL_INCLUDE_DIRS="$(ADDITIONAL_INCLUDE_DIRS) $($*_INCLUDE_DIRS)" \
ADDITIONAL_APP_LIBS="$($*_LIBS)" \
ADDITIONAL_LIB_DIRS="$(ADDITIONAL_LIB_DIRS) $($*_LIB_DIRS)" \
SCRIPTS_DIRECTORY="$($*_SCRIPTS_DIRECTORY)"
# These are for running the tests
%.checklib : FORCE
@echo Checking $*...
@$(MAKE) --no-print-directory --no-keep-going internal-check-LIBRARY \
TEST_LIBRARY_NAME=$* \
ADDITIONAL_LIB_DIRS="$($*_LIB_DIRS)" \
CHECK_SCRIPT_DIRS="$($*_SCRIPT_DIRS)" \
SCRIPTS_DIRECTORY="$($*_SCRIPTS_DIRECTORY)"
%.checkbundle : FORCE
@echo Checking $*...
@$(MAKE) --no-print-directory --no-keep-going internal-check-BUNDLE \
TEST_BUNDLE_NAME=$* \
ADDITIONAL_LIB_DIRS="$($*_LIB_DIRS)" \
CHECK_SCRIPT_DIRS="$($*_SCRIPT_DIRS)" \
SCRIPTS_DIRECTORY="$($*_SCRIPTS_DIRECTORY)"
%.checktool : FORCE
@echo Checking $*...
@$(MAKE) --no-print-directory --no-keep-going internal-check-TOOL \
TEST_TOOL_NAME=$* \
ADDITIONAL_LIB_DIRS="$($*_LIB_DIRS)" \
CHECK_SCRIPT_DIRS="$($*_SCRIPT_DIRS)" \
SCRIPTS_DIRECTORY="$($*_SCRIPTS_DIRECTORY)"
%.checkapp : FORCE
@echo Checking $*...
@$(MAKE) --no-print-directory --no-keep-going internal-check-APP \
TEST_APP_NAME=$* \
ADDITIONAL_LIB_DIRS="$($*_LIB_DIRS)" \
CHECK_SCRIPT_DIRS="$($*_SCRIPT_DIRS)" \
SCRIPTS_DIRECTORY="$($*_SCRIPTS_DIRECTORY)"
#
# The list of Objective-C source files to be compiled
# are in the OBJC_FILES variable.
#
# The list of C source files to be compiled
# are in the C_FILES variable.
#
# The list of PSWRAP source files to be compiled
# are in the PSWRAP_FILES variable.
OBJC_OBJS = $(OBJC_FILES:.m=${OEXT})
OBJC_OBJ_FILES = $(addprefix $(GNUSTEP_OBJ_DIR)/,$(OBJC_OBJS))
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))
C_OBJS = $(C_FILES:.c=${OEXT})
C_OBJ_FILES = $(PSWRAP_OBJ_FILES) $(addprefix $(GNUSTEP_OBJ_DIR)/,$(C_OBJS))
# echo variables: target=$$target operation=$$operation type=$$type;
#
# Global targets
@ -340,10 +59,6 @@ distclean:: clean 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
#
@ -385,7 +100,162 @@ internal-check::
after-check::
FORCE:
ifeq ($(PROCESSED_FIRST_TIME),yes)
# Rules loaded
ALL_CPPFLAGS = $(CPPFLAGS) $(ADDITIONAL_CPPFLAGS) $(AUXILIARY_CPPFLAGS)
ALL_OBJCFLAGS = $(INTERNAL_OBJCFLAGS) $(ADDITIONAL_OBJCFLAGS) \
$(AUXILIARY_OBJCFLAGS) $(ADDITIONAL_INCLUDE_DIRS) \
$(AUXILIARY_INCLUDE_DIRS) -I. $(SYSTEM_INCLUDES) \
$(GNUSTEP_HEADERS_FND_FLAG) $(GNUSTEP_HEADERS_GUI_FLAG) \
-I$(GNUSTEP_HEADERS_TARGET_FLAG) -I$(GNUSTEP_USER_HEADERS) \
-I$(GNUSTEP_LOCAL_HEADERS) -I$(GNUSTEP_SYSTEM_HEADERS)
ALL_CFLAGS = $(INTERNAL_CFLAGS) $(ADDITIONAL_CFLAGS) \
$(AUXILIARY_CFLAGS) $(ADDITIONAL_INCLUDE_DIRS) \
$(AUXILIARY_INCLUDE_DIRS) -I. $(SYSTEM_INCLUDES) \
$(GNUSTEP_HEADERS_FND_FLAG) $(GNUSTEP_HEADERS_GUI_FLAG) \
-I$(GNUSTEP_HEADERS_TARGET_FLAG) -I$(GNUSTEP_USER_HEADERS) \
-I$(GNUSTEP_LOCAL_HEADERS) -I$(GNUSTEP_SYSTEM_HEADERS)
ALL_LDFLAGS = $(ADDITIONAL_LDFLAGS) $(AUXILIARY_LDFLAGS) $(GUI_LDFLAGS) \
$(BACKEND_LDFLAGS) $(SYSTEM_LDFLAGS) $(INTERNAL_LDFLAGS)
ALL_LIB_DIRS = $(ADDITIONAL_LIB_DIRS) $(AUXILIARY_LIB_DIRS) \
-L$(GNUSTEP_USER_LIBRARIES) -L$(GNUSTEP_USER_LIBRARIES_ROOT) \
-L$(GNUSTEP_LOCAL_LIBRARIES) -L$(GNUSTEP_LOCAL_LIBRARIES_ROOT) \
-L$(GNUSTEP_SYSTEM_LIBRARIES) -L$(GNUSTEP_SYSTEM_LIBRARIES_ROOT) \
$(SYSTEM_LIB_DIR)
LIB_DIRS_NO_SYSTEM = $(ADDITIONAL_LIB_DIRS) \
-L$(GNUSTEP_USER_LIBRARIES) -L$(GNUSTEP_USER_LIBRARIES_ROOT) \
-L$(GNUSTEP_LOCAL_LIBRARIES) -L$(GNUSTEP_LOCAL_LIBRARIES_ROOT) \
-L$(GNUSTEP_SYSTEM_LIBRARIES) -L$(GNUSTEP_SYSTEM_LIBRARIES_ROOT)
ifeq (1, 0)
# Macros used by test.make
ALL_TEST_LIBRARY_LIBS = $(ADDITIONAL_LIBRARY_LIBS) $(AUXILIARY_LIBS) \
-lobjc-test \
$(AUXILIARY_TOOL_LIBS) $(FND_LIBS) $(OBJC_LIBS) $(TARGET_SYSTEM_LIBS)
ALL_TEST_BUNDLE_LIBS = $(ADDITIONAL_BUNDLE_LIBS)
ALL_TEST_TOOL_LIBS = $(ADDITIONAL_TOOL_LIBS) $(AUXILIARY_TOOL_LIBS) \
$(FND_LIBS) $(OBJC_LIBS) $(TARGET_SYSTEM_LIBS)
ALL_TEST_APP_LIBS = $(ADDITIONAL_APP_LIBS) $(AUXILIARY_GUI_LIBS) \
$(BACKEND_LIBS) $(GUI_LIBS) $(AUXILIARY_TOOL_LIBS) \
$(FND_LIBS) $(OBJC_LIBS) $(SYSTEM_LIBS) $(TARGET_SYSTEM_LIBS)
ALL_TEST_LIBRARY_LIBS := \
$(shell $(WHICH_LIB_SCRIPT) $(LIB_DIRS_NO_SYSTEM) $(ALL_TEST_LIBRARY_LIBS)\
debug=$(debug) profile=$(profile) shared=$(shared) libext=$(LIBEXT) \
shared_libext=$(SHARED_LIBEXT))
ALL_TEST_BUNDLE_LIBS := \
$(shell $(WHICH_LIB_SCRIPT) $(LIB_DIRS_NO_SYSTEM) $(ALL_TEST_BUNDLE_LIBS) \
debug=$(debug) profile=$(profile) shared=$(shared) libext=$(LIBEXT) \
shared_libext=$(SHARED_LIBEXT))
ALL_TEST_TOOL_LIBS := \
$(shell $(WHICH_LIB_SCRIPT) $(LIB_DIRS_NO_SYSTEM) $(ALL_TEST_TOOL_LIBS) \
debug=$(debug) profile=$(profile) shared=$(shared) libext=$(LIBEXT) \
shared_libext=$(SHARED_LIBEXT))
ALL_TEST_APP_LIBS := \
$(shell $(WHICH_LIB_SCRIPT) $(LIB_DIRS_NO_SYSTEM) $(ALL_TEST_APP_LIBS) \
debug=$(debug) profile=$(profile) shared=$(shared) libext=$(LIBEXT) \
shared_libext=$(SHARED_LIBEXT))
endif
ifneq ($(LIBRARIES_DEPEND_UPON),)
LIBRARIES_DEPEND_UPON := \
$(shell $(WHICH_LIB_SCRIPT) $(LIB_DIRS_NO_SYSTEM) $(LIBRARIES_DEPEND_UPON)\
debug=$(debug) profile=$(profile) shared=$(shared) libext=$(LIBEXT) \
shared_libext=$(SHARED_LIBEXT))
endif
#
# The bundle extension (default is .bundle) is defined by BUNDLE_EXTENSION.
#
ifeq ($(strip $(BUNDLE_EXTENSION)),)
BUNDLE_EXTENSION = .bundle
endif
# General rules
VPATH = .
.SUFFIXES: .m .c .psw
.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 $@ $<
# The magical application rules, thank you GNU make!
%.build:
@(echo Making $(OPERATION) for $(TARGET_TYPE) $*...; \
$(MAKE) --no-print-directory --no-keep-going \
internal-$(TARGET_TYPE)-$(OPERATION) \
INTERNAL_$(TARGET_TYPE)_NAME=$* \
OBJC_FILES="$($*_OBJC_FILES)" \
C_FILES="$($*_C_FILES)" \
PSWRAP_FILES="$($*_PSWRAP_FILES)" \
HEADER_FILES="$($*_HEADER_FILES)" \
HEADER_FILES_DIR="$($*_HEADER_FILES_DIR)" \
HEADER_FILES_INSTALL_DIR="$($*_HEADER_FILES_INSTALL_DIR)" \
RESOURCE_FILES="$($*_RESOURCES)" \
RESOURCE_DIRS="$($*_RESOURCE_DIRS)" \
BUNDLE_LIBS="$($*_BUNDLE_LIBS)" \
ADDITIONAL_INCLUDE_DIRS="$(ADDITIONAL_INCLUDE_DIRS) \
$($*_INCLUDE_DIRS)" \
ADDITIONAL_GUI_LIBS="$($*_GUI_LIBS) $(ADDITIONAL_GUI_LIBS)" \
ADDITIONAL_TOOL_LIBS="$($*_TOOL_LIBS) $(ADDITIONAL_TOOL_LIBS)" \
ADDITIONAL_OBJC_LIBS="$($*_OBJC_LIBS) $(ADDITIONAL_OBJC_LIBS)" \
ADDITIONAL_LIBRARY_LIBS="$($*_LIBS)" \
ADDITIONAL_LIB_DIRS="$($*_LIB_DIRS) $(ADDITIONAL_LIB_DIRS)" \
SCRIPTS_DIRECTORY="$($*_SCRIPTS_DIRECTORY)" \
CHECK_SCRIPT_DIRS="$($*_SCRIPT_DIRS)" \
)
#
# The list of Objective-C source files to be compiled
# are in the OBJC_FILES variable.
#
# The list of C source files to be compiled
# are in the C_FILES variable.
#
# The list of PSWRAP source files to be compiled
# are in the PSWRAP_FILES variable.
OBJC_OBJS = $(OBJC_FILES:.m=${OEXT})
OBJC_OBJ_FILES = $(addprefix $(GNUSTEP_OBJ_DIR)/,$(OBJC_OBJS))
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))
C_OBJS = $(C_FILES:.c=${OEXT})
C_OBJ_FILES = $(PSWRAP_OBJ_FILES) $(addprefix $(GNUSTEP_OBJ_DIR)/,$(C_OBJS))
# Rules processed second time
endif
ifeq ($(OBJ_DIR_RULE),)
OBJ_DIR_RULE = defined
# The rule to create the objects file directory. This rule is here so that it
# can be accessed from the global before and after targets as well.
$(GNUSTEP_OBJ_DIR):
@$(GNUSTEP_MAKEFILES)/mkinstalldirs ./$(GNUSTEP_OBJ_DIR)
endif

View file

@ -105,7 +105,7 @@ SHARED_LIB_LINK_CMD = \
-L$(GNUSTEP_USER_ROOT)/$(TARGET_LIB_DIR) \
-L$(GNUSTEP_LOCAL_ROOT)/$(TARGET_LIB_DIR) \
-L$(GNUSTEP_SYSTEM_ROOT)/$(TARGET_LIB_DIR) \
$(ADDITIONAL_LIB_DIRS) $^; \
$(ADDITIONAL_LIB_DIRS) $(LIBRARIES_DEPEND_UPON) $^; \
(cd $(GNUSTEP_OBJ_DIR); rm -f $(LIBRARY_FILE); \
$(LN_S) $(VERSION_LIBRARY_FILE) $(LIBRARY_FILE))
endif

View file

@ -207,8 +207,10 @@ build-testbundle-dir::
build-testbundle:: $(TEST_BUNDLE_NAME) testbundle-resource-files
testbundle-resource-files::
for f in $(RESOURCE_FILES); do \
$(INSTALL_DATA) $$f $(TEST_BUNDLE_DIR_NAME)/$$f ;\
for f in $(RESOURCE_FILES) __done; do \
if [ $$f != __done ]; then \
$(INSTALL_DATA) $$f $(TEST_BUNDLE_DIR_NAME)/$$f ;\
fi; \
done
internal-testtool-all:: $(TEST_TOOL_NAME)

View file

@ -19,64 +19,84 @@
# If not, write to the Free Software Foundation,
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# The name of the tools is in the TOOL_NAME variable.
#
# xxx We need to prefix the target name when cross-compiling
#
#
# Include in the common makefile rules
#
include $(GNUSTEP_SYSTEM_ROOT)/Makefiles/rules.make
ifeq ($(INTERNAL_tool_NAME),)
internal-all:: $(TOOL_NAME:=.all.tool.variables)
internal-install:: $(TOOL_NAME:=.install.tool.variables)
internal-uninstall:: $(TOOL_NAME:=.uninstall.tool.variables)
internal-clean:: $(TOOL_NAME:=.clean.tool.variables)
internal-distclean:: $(TOOL_NAME:=.distclean.tool.variables)
$(TOOL_NAME):
@$(MAKE) --no-print-directory $@.all.tool.variables
else
# This is the directory where the tools get installed. If you don't specify a
# directory they will get installed in the GNUstep system root.
TOOL_INSTALLATION_DIR = \
$(GNUSTEP_INSTALLATION_DIR)/Tools/$(GNUSTEP_TARGET_DIR)/$(LIBRARY_COMBO)
#
# The name of the tools is in the TOOL_NAME variable.
#
# xxx We need to prefix the target name when cross-compiling
#
TOOL_LIST := $(TOOL_NAME:=.buildtool)
TOOL_FILE = $(TOOL_LIST)
ALL_TOOL_LIBS = $(ADDITIONAL_TOOL_LIBS) $(AUXILIARY_TOOL_LIBS) $(FND_LIBS) \
$(ADDITIONAL_OBJC_LIBS) $(AUXILIARY_OBJC_LIBS) $(OBJC_LIBS) \
$(TARGET_SYSTEM_LIBS)
#
# Internal targets
#
$(TOOL_NAME) : $(C_OBJ_FILES) $(OBJC_OBJ_FILES)
$(LD) $(ALL_LDFLAGS) $(LDOUT)$(TOOL_NAME) \
$(C_OBJ_FILES) $(OBJC_OBJ_FILES) \
$(ALL_LIB_DIRS) $(ALL_TOOL_LIBS)
ALL_TOOL_LIBS := \
$(shell $(WHICH_LIB_SCRIPT) $(LIB_DIRS_NO_SYSTEM) $(ALL_TOOL_LIBS) \
debug=$(debug) profile=$(profile) shared=$(shared) libext=$(LIBEXT) \
shared_libext=$(SHARED_LIBEXT))
#
# Compilation targets
#
internal-all:: $(GNUSTEP_OBJ_DIR) $(TOOL_LIST)
internal-tool-all:: before-$(TARGET)-all $(GNUSTEP_OBJ_DIR) \
$(GNUSTEP_OBJ_DIR)/$(INTERNAL_tool_NAME) after-$(TARGET)-all
internal-tool-all:: build-tool
$(GNUSTEP_OBJ_DIR)/$(INTERNAL_tool_NAME): $(C_OBJ_FILES) $(OBJC_OBJ_FILES)
$(LD) $(ALL_LDFLAGS) $(LDOUT)$@ \
$(C_OBJ_FILES) $(OBJC_OBJ_FILES) \
$(ALL_LIB_DIRS) $(ALL_TOOL_LIBS)
internal-install:: all internal-install-dirs internal-install-tool
before-$(TARGET)-all::
after-$(TARGET)-all::
internal-tool-install:: internal-install-dirs install-tool
internal-install-dirs::
$(GNUSTEP_MAKEFILES)/mkinstalldirs $(TOOL_INSTALLATION_DIR)
internal-install-tool::
for f in $(TOOL_NAME); do \
$(INSTALL_PROGRAM) -m 0755 $$f $(TOOL_INSTALLATION_DIR); \
done
install-tool::
$(INSTALL_PROGRAM) -m 0755 $(INTERNAL_tool_NAME) \
$(TOOL_INSTALLATION_DIR);
build-tool:: $(TOOL_NAME)
internal-tool-uninstall::
rm -f $(TOOL_INSTALLATION_DIR)/$(INTERNAL_tool_NAME)
#
# Cleaning targets
#
internal-clean::
rm -f $(TOOL_NAME)
rm -rf $(GNUSTEP_OBJ_PREFIX)
internal-tool-clean::
rm -rf $(GNUSTEP_OBJ_DIR)
internal-distclean::
internal-tool-distclean::
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
$(LIBRARY_NAME):
@$(MAKE) --no-print-directory $@.buildlib
endif