1997-09-16 01:07:48 +00:00
|
|
|
#
|
|
|
|
# tool.make
|
|
|
|
#
|
|
|
|
# Makefile rules to build GNUstep-based command line tools.
|
|
|
|
#
|
|
|
|
# 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.
|
1997-09-22 22:49:02 +00:00
|
|
|
|
1997-11-13 03:18:16 +00:00
|
|
|
#
|
|
|
|
# The name of the tools is in the TOOL_NAME variable.
|
|
|
|
#
|
|
|
|
# xxx We need to prefix the target name when cross-compiling
|
|
|
|
#
|
|
|
|
|
1997-11-14 22:50:41 +00:00
|
|
|
# prevent multiple inclusions
|
|
|
|
ifeq ($(TOOL_MAKE_LOADED),)
|
|
|
|
TOOL_MAKE_LOADED=yes
|
|
|
|
|
1999-02-15 09:20:19 +00:00
|
|
|
TOOL_NAME:=$(strip $(TOOL_NAME))
|
|
|
|
|
1997-09-22 22:49:02 +00:00
|
|
|
#
|
|
|
|
# Include in the common makefile rules
|
|
|
|
#
|
1998-02-06 19:15:05 +00:00
|
|
|
include $(GNUSTEP_MAKEFILES)/rules.make
|
1997-09-22 22:49:02 +00:00
|
|
|
|
1998-02-15 01:10:47 +00:00
|
|
|
# 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.
|
1998-05-13 20:56:38 +00:00
|
|
|
ifeq ($(TOOL_INSTALLATION_DIR),)
|
|
|
|
TOOL_INSTALLATION_DIR = \
|
2000-02-19 00:40:47 +00:00
|
|
|
$(GNUSTEP_TOOLS)/$(GNUSTEP_TARGET_DIR)/$(LIBRARY_COMBO)
|
1998-05-13 20:56:38 +00:00
|
|
|
endif
|
1998-02-15 01:10:47 +00:00
|
|
|
|
1997-11-13 03:18:16 +00:00
|
|
|
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):
|
1998-06-17 14:50:36 +00:00
|
|
|
@$(MAKE) -f $(MAKEFILE_NAME) --no-print-directory --no-keep-going $@.all.tool.variables
|
1997-11-13 03:18:16 +00:00
|
|
|
|
2000-06-13 15:14:23 +00:00
|
|
|
else # second pass
|
1997-11-13 03:18:16 +00:00
|
|
|
|
|
|
|
ALL_TOOL_LIBS = $(ADDITIONAL_TOOL_LIBS) $(AUXILIARY_TOOL_LIBS) $(FND_LIBS) \
|
|
|
|
$(ADDITIONAL_OBJC_LIBS) $(AUXILIARY_OBJC_LIBS) $(OBJC_LIBS) \
|
|
|
|
$(TARGET_SYSTEM_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))
|
1997-09-22 22:49:02 +00:00
|
|
|
|
2000-06-13 15:14:23 +00:00
|
|
|
ifeq ($(WITH_DLL),yes)
|
|
|
|
TTMP_LIBS := $(ALL_TOOL_LIBS)
|
|
|
|
TTMP_LIBS := $(filter -l%, $(TTMP_LIBS))
|
|
|
|
# filter all non-static libs (static libs are those ending in _ds, _s, _ps..)
|
|
|
|
TTMP_LIBS := $(filter-out -l%_ds, $(TTMP_LIBS))
|
|
|
|
TTMP_LIBS := $(filter-out -l%_s, $(TTMP_LIBS))
|
|
|
|
TTMP_LIBS := $(filter-out -l%_dps,$(TTMP_LIBS))
|
|
|
|
TTMP_LIBS := $(filter-out -l%_ps, $(TTMP_LIBS))
|
|
|
|
# strip away -l, _p and _d ..
|
|
|
|
TTMP_LIBS := $(TTMP_LIBS:-l%=%)
|
|
|
|
TTMP_LIBS := $(TTMP_LIBS:%_d=%)
|
|
|
|
TTMP_LIBS := $(TTMP_LIBS:%_p=%)
|
|
|
|
TTMP_LIBS := $(TTMP_LIBS:%_dp=%)
|
2000-06-30 22:29:10 +00:00
|
|
|
TTMP_LIBS := $(shell echo $(TTMP_LIBS)|tr '-' '_')
|
2000-06-13 15:14:23 +00:00
|
|
|
TTMP_LIBS := $(TTMP_LIBS:%=-Dlib%_ISDLL=1)
|
|
|
|
ALL_CPPFLAGS += $(TTMP_LIBS)
|
|
|
|
endif
|
|
|
|
|
1997-09-22 22:49:02 +00:00
|
|
|
#
|
1997-11-13 03:18:16 +00:00
|
|
|
# Compilation targets
|
1997-09-22 22:49:02 +00:00
|
|
|
#
|
1997-11-13 03:18:16 +00:00
|
|
|
internal-tool-all:: before-$(TARGET)-all $(GNUSTEP_OBJ_DIR) \
|
1998-12-15 20:27:09 +00:00
|
|
|
$(GNUSTEP_OBJ_DIR)/$(INTERNAL_tool_NAME)$(EXEEXT) after-$(TARGET)-all
|
1997-09-22 22:49:02 +00:00
|
|
|
|
2000-06-13 15:14:23 +00:00
|
|
|
$(GNUSTEP_OBJ_DIR)/$(INTERNAL_tool_NAME)$(EXEEXT): $(C_OBJ_FILES) $(OBJC_OBJ_FILES) $(SUBPROJECT_OBJ_FILES) $(OBJ_FILES)
|
1999-09-15 02:41:46 +00:00
|
|
|
$(LD) $(ALL_LDFLAGS) -o $(LDOUT)$@ \
|
2000-06-13 15:14:23 +00:00
|
|
|
$(C_OBJ_FILES) $(OBJC_OBJ_FILES) $(OBJ_FILES) $(SUBPROJECT_OBJ_FILES) \
|
1998-05-28 06:56:11 +00:00
|
|
|
$(ALL_LIB_DIRS) $(ALL_TOOL_LIBS)
|
1997-09-22 22:49:02 +00:00
|
|
|
|
1997-11-13 03:18:16 +00:00
|
|
|
before-$(TARGET)-all::
|
1997-09-22 22:49:02 +00:00
|
|
|
|
1997-11-13 03:18:16 +00:00
|
|
|
after-$(TARGET)-all::
|
1997-09-22 22:49:02 +00:00
|
|
|
|
1998-02-06 02:27:22 +00:00
|
|
|
internal-tool-install:: internal-tool-all internal-install-dirs install-tool
|
1997-10-28 02:34:11 +00:00
|
|
|
|
|
|
|
internal-install-dirs::
|
1998-12-20 21:27:47 +00:00
|
|
|
$(MKDIRS) $(TOOL_INSTALLATION_DIR)
|
1997-10-28 02:34:11 +00:00
|
|
|
|
1997-11-13 03:18:16 +00:00
|
|
|
install-tool::
|
1998-12-15 20:27:09 +00:00
|
|
|
$(INSTALL_PROGRAM) -m 0755 $(GNUSTEP_OBJ_DIR)/$(INTERNAL_tool_NAME)$(EXEEXT) \
|
1997-11-13 03:18:16 +00:00
|
|
|
$(TOOL_INSTALLATION_DIR);
|
1999-06-02 03:16:12 +00:00
|
|
|
cp $(GNUSTEP_MAKEFILES)/executable.template $(GNUSTEP_INSTALLATION_DIR)/Tools/$(INTERNAL_tool_NAME)
|
|
|
|
chmod a+x $(GNUSTEP_INSTALLATION_DIR)/Tools/$(INTERNAL_tool_NAME)
|
1997-10-28 02:34:11 +00:00
|
|
|
|
1997-11-13 03:18:16 +00:00
|
|
|
internal-tool-uninstall::
|
1998-12-15 20:27:09 +00:00
|
|
|
rm -f $(TOOL_INSTALLATION_DIR)/$(INTERNAL_tool_NAME)$(EXEEXT)
|
1997-09-22 22:49:02 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Cleaning targets
|
|
|
|
#
|
1997-11-13 03:18:16 +00:00
|
|
|
internal-tool-clean::
|
|
|
|
rm -rf $(GNUSTEP_OBJ_DIR)
|
1997-10-28 02:34:11 +00:00
|
|
|
|
1997-11-13 03:18:16 +00:00
|
|
|
internal-tool-distclean::
|
1997-10-28 02:34:11 +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-11-13 03:18:16 +00:00
|
|
|
endif
|
1997-11-14 22:50:41 +00:00
|
|
|
|
|
|
|
endif
|
|
|
|
# tool.make loaded
|
1998-05-28 06:56:11 +00:00
|
|
|
|
|
|
|
## Local variables:
|
|
|
|
## mode: makefile
|
|
|
|
## End:
|