mirror of
https://github.com/gnustep/tools-make.git
synced 2025-04-23 22:33:28 +00:00
Rewritten - actual code moved into Master/java-tool.make and Instance/java-tool.make
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/tools/make/trunk@12445 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
2f43343109
commit
ff769c3478
1 changed files with 6 additions and 140 deletions
146
java-tool.make
146
java-tool.make
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
# Makefile rules to build Java command-line tools.
|
||||
#
|
||||
# Copyright (C) 2001 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2002 Free Software Foundation, Inc.
|
||||
#
|
||||
# Author: Nicola Pero <nicola@brainstorm.co.uk>
|
||||
#
|
||||
|
@ -19,149 +19,15 @@
|
|||
# If not, write to the Free Software Foundation,
|
||||
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
# Why using Java if you can use Objective-C ...
|
||||
# Anyway if you really want it, here we go.
|
||||
|
||||
#
|
||||
# The name of the tools is in the JAVA_TOOL_NAME variable.
|
||||
# The main class (the one implementing main) is in the
|
||||
# xxx_PRINCIPAL_CLASS variable.
|
||||
#
|
||||
|
||||
# prevent multiple inclusions
|
||||
ifeq ($(JAVA_TOOL_MAKE_LOADED),)
|
||||
JAVA_TOOL_MAKE_LOADED = yes
|
||||
|
||||
JAVA_TOOL_NAME:=$(strip $(JAVA_TOOL_NAME))
|
||||
|
||||
ifeq ($(RULES_MAKE_LOADED),)
|
||||
include $(GNUSTEP_MAKEFILES)/rules.make
|
||||
ifeq ($(GNUSTEP_INSTANCE),)
|
||||
include $(GNUSTEP_MAKEFILES)/Master/java-tool.make
|
||||
else
|
||||
ifeq ($(GNUSTEP_TYPE),java_tool)
|
||||
include $(GNUSTEP_MAKEFILES)/Instance/java-tool.make
|
||||
endif
|
||||
|
||||
ifeq ($(INTERNAL_java_tool_NAME),)
|
||||
|
||||
internal-all:: $(JAVA_TOOL_NAME:=.all.java_tool.variables)
|
||||
|
||||
internal-install:: $(JAVA_TOOL_NAME:=.install.java_tool.variables)
|
||||
|
||||
internal-uninstall:: $(JAVA_TOOL_NAME:=.uninstall.java_tool.variables)
|
||||
|
||||
internal-clean:: $(JAVA_TOOL_NAME:=.clean.java_tool.variables)
|
||||
|
||||
internal-distclean:: $(JAVA_TOOL_NAME:=.distclean.java_tool.variables)
|
||||
|
||||
$(JAVA_TOOL_NAME):
|
||||
@$(MAKE) -f $(MAKEFILE_NAME) --no-print-directory \
|
||||
$@.all.java_tool.variables
|
||||
|
||||
else # second pass
|
||||
|
||||
.PHONY: internal-java_tool-all \
|
||||
internal-java_tool-clean \
|
||||
internal-java_tool-distclean \
|
||||
internal-java_tool-install \
|
||||
internal-java_tool-uninstall \
|
||||
before-$(TARGET)-all \
|
||||
after-$(TARGET)-all \
|
||||
internal-install-java_tool-dirs \
|
||||
install-java_tool \
|
||||
_FORCE
|
||||
|
||||
# This is the directory where the tools get installed. If you don't specify a
|
||||
# directory they will get installed in $(GNUSTEP_LOCAL_ROOT)/Tools/Java/.
|
||||
ifeq ($(JAVA_TOOL_INSTALLATION_DIR),)
|
||||
JAVA_TOOL_INSTALLATION_DIR = $(GNUSTEP_TOOLS)/Java/
|
||||
endif
|
||||
|
||||
internal-java_tool-all:: before-$(TARGET)-all \
|
||||
$(JAVA_OBJ_FILES) \
|
||||
after-$(TARGET)-all
|
||||
|
||||
before-$(TARGET)-all::
|
||||
|
||||
after-$(TARGET)-all::
|
||||
|
||||
internal-java_tool-install:: install-java_tool
|
||||
|
||||
$(JAVA_TOOL_INSTALLATION_DIR):
|
||||
$(MKINSTALLDIRS) $(JAVA_TOOL_INSTALLATION_DIR)
|
||||
|
||||
internal-install-java_tool-dirs:: $(JAVA_TOOL_INSTALLATION_DIR)
|
||||
ifneq ($(JAVA_OBJ_FILES),)
|
||||
$(MKINSTALLDIRS) $(addprefix $(JAVA_TOOL_INSTALLATION_DIR)/,$(dir $(JAVA_OBJ_FILES)));
|
||||
endif
|
||||
|
||||
ifeq ($(PRINCIPAL_CLASS),)
|
||||
$(warning You must specify PRINCIPAL_CLASS)
|
||||
# But then, we are good, and try guessing
|
||||
PRINCIPAL_CLASS = $(word 1 $(JAVA_OBJ_FILES))
|
||||
endif
|
||||
|
||||
# Remove an eventual extension (.class or .java) from PRINCIPAL_CLASS;
|
||||
# only take the first word of it
|
||||
NORMALIZED_PRINCIPAL_CLASS = $(basename $(word 1 $(PRINCIPAL_CLASS)))
|
||||
|
||||
# Escape '/' so it can be passes to sed
|
||||
ESCAPED_PRINCIPAL_CLASS = $(subst /,\/,$(PRINCIPAL_CLASS))
|
||||
|
||||
# Always rebuild this because if the PRINCIPAL_CLASS changes...
|
||||
$(GNUSTEP_INSTALLATION_DIR)/Tools/$(INTERNAL_java_tool_NAME): _FORCE
|
||||
sed -e 's/JAVA_OBJ_FILE/$(ESCAPED_PRINCIPAL_CLASS)/g' \
|
||||
$(GNUSTEP_MAKEFILES)/java-executable.template \
|
||||
> $(GNUSTEP_INSTALLATION_DIR)/Tools/$(INTERNAL_java_tool_NAME); \
|
||||
chmod a+x $(GNUSTEP_INSTALLATION_DIR)/Tools/$(INTERNAL_java_tool_NAME);
|
||||
ifneq ($(CHOWN_TO),)
|
||||
$(CHOWN) $(CHOWN_TO) \
|
||||
$(GNUSTEP_INSTALLATION_DIR)/Tools/$(INTERNAL_java_tool_NAME)
|
||||
endif
|
||||
|
||||
_FORCE::
|
||||
|
||||
# See java.make for comments on ADDITIONAL_JAVA_OBJ_FILES
|
||||
UNESCAPED_ADD_JAVA_OBJ_FILES = $(wildcard $(JAVA_OBJ_FILES:.class=[$$]*.class))
|
||||
ADDITIONAL_JAVA_OBJ_FILES = $(subst $$,\$$,$(UNESCAPED_ADD_JAVA_OBJ_FILES))
|
||||
|
||||
JAVA_PROPERTIES_FILES = $($(INTERNAL_java_tool_NAME)_JAVA_PROPERTIES_FILES)
|
||||
|
||||
install-java_tool:: internal-install-java_tool-dirs \
|
||||
$(GNUSTEP_INSTALLATION_DIR)/Tools/$(INTERNAL_java_tool_NAME)
|
||||
ifneq ($(strip $(JAVA_OBJ_FILES)),)
|
||||
for file in $(JAVA_OBJ_FILES); do \
|
||||
$(INSTALL_DATA) $$file $(JAVA_TOOL_INSTALLATION_DIR)/$$file ; \
|
||||
done;
|
||||
endif
|
||||
ifneq ($(strip $(ADDITIONAL_JAVA_OBJ_FILES)),)
|
||||
for file in $(ADDITIONAL_JAVA_OBJ_FILES); do \
|
||||
$(INSTALL_DATA) $$file $(JAVA_TOOL_INSTALLATION_DIR)/$$file ; \
|
||||
done;
|
||||
endif
|
||||
ifneq ($(JAVA_PROPERTIES_FILES),)
|
||||
for file in $(JAVA_PROPERTIES_FILES) __done; do \
|
||||
if [ $$file != __done ]; then \
|
||||
$(INSTALL_DATA) $$file $(JAVA_INSTALLATION_DIR)/$$file ; \
|
||||
fi; \
|
||||
done
|
||||
endif
|
||||
|
||||
# Warning - to uninstall nested classes you need to have a compiled
|
||||
# source available ...
|
||||
internal-java_tool-uninstall::
|
||||
rm -f $(JAVA_TOOL_INSTALLATION_DIR)/$(JAVA_OBJ_FILES)
|
||||
rm -f $(JAVA_TOOL_INSTALLATION_DIR)/$(ADDITIONAL_JAVA_OBJ_FILES)
|
||||
rm -f $(GNUSTEP_INSTALLATION_DIR)/Tools/$(INTERNAL_java_tool_NAME)
|
||||
|
||||
#
|
||||
# Cleaning targets
|
||||
#
|
||||
internal-java_tool-clean::
|
||||
rm -f $(JAVA_OBJ_FILES) $(ADDITIONAL_JAVA_OBJ_FILES)
|
||||
|
||||
internal-java_tool-distclean::
|
||||
|
||||
|
||||
endif # internal java tool name
|
||||
endif # java_tool.make loaded
|
||||
|
||||
## Local variables:
|
||||
## mode: makefile
|
||||
## End:
|
||||
|
|
Loading…
Reference in a new issue