mirror of
https://github.com/gnustep/tools-make.git
synced 2025-04-23 22:33:28 +00:00
Added .PHONY; removed doubled dependency of install on all; turned
shell conditionals into makefile ones; use a single rm command in clean; force rebuilding of executable wrapper script each time the java tool is installed; simplified managing of case when JAVA_FILES etc is empty git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/tools/make/trunk@10358 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
9a44618273
commit
2da07a6a26
1 changed files with 30 additions and 22 deletions
|
@ -54,6 +54,16 @@ $(JAVA_TOOL_NAME):
|
|||
|
||||
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
|
||||
|
||||
# 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),)
|
||||
|
@ -68,15 +78,15 @@ before-$(TARGET)-all::
|
|||
|
||||
after-$(TARGET)-all::
|
||||
|
||||
internal-java_tool-install:: internal-java_tool-all install-java_tool
|
||||
internal-java_tool-install:: install-java_tool
|
||||
|
||||
$(JAVA_TOOL_INSTALLATION_DIR):
|
||||
$(MKDIRS) $(JAVA_TOOL_INSTALLATION_DIR)
|
||||
|
||||
internal-install-java_tool-dirs:: $(JAVA_TOOL_INSTALLATION_DIR)
|
||||
if [ "$(JAVA_OBJ_FILES)" != "" ]; then \
|
||||
$(MKDIRS) $(addprefix $(JAVA_TOOL_INSTALLATION_DIR)/,$(dir $(JAVA_OBJ_FILES))); \
|
||||
fi
|
||||
ifneq ($(JAVA_OBJ_FILES),)
|
||||
$(MKDIRS) $(addprefix $(JAVA_TOOL_INSTALLATION_DIR)/,$(dir $(JAVA_OBJ_FILES)));
|
||||
endif
|
||||
|
||||
ifeq ($(PRINCIPAL_CLASS),)
|
||||
$(warning You must specify PRINCIPAL_CLASS)
|
||||
|
@ -91,32 +101,31 @@ NORMALIZED_PRINCIPAL_CLASS = $(basename $(word 1 $(PRINCIPAL_CLASS)))
|
|||
# Escape '/' so it can be passes to sed
|
||||
ESCAPED_PRINCIPAL_CLASS = $(subst /,\/,$(PRINCIPAL_CLASS))
|
||||
|
||||
$(GNUSTEP_INSTALLATION_DIR)/Tools/$(INTERNAL_java_tool_NAME):
|
||||
# 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);
|
||||
|
||||
_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))
|
||||
|
||||
install-java_tool:: internal-install-java_tool-dirs \
|
||||
$(GNUSTEP_INSTALLATION_DIR)/Tools/$(INTERNAL_java_tool_NAME)
|
||||
if [ "$(JAVA_OBJ_FILES)" != "" ]; then \
|
||||
for file in $(JAVA_OBJ_FILES) __done; do \
|
||||
if [ $$file != __done ]; then \
|
||||
$(INSTALL_DATA) $$file $(JAVA_TOOL_INSTALLATION_DIR)/$$file ; \
|
||||
fi; \
|
||||
done; \
|
||||
fi; \
|
||||
if [ "$(ADDITIONAL_JAVA_OBJ_FILES)" != "" ]; then \
|
||||
for file in $(ADDITIONAL_JAVA_OBJ_FILES) __done; do \
|
||||
if [ $$file != __done ]; then \
|
||||
$(INSTALL_DATA) $$file $(JAVA_TOOL_INSTALLATION_DIR)/$$file ; \
|
||||
fi; \
|
||||
done; \
|
||||
fi
|
||||
$(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
|
||||
|
||||
# Warning - to uninstall nested classes you need to have a compiled
|
||||
# source available ...
|
||||
|
@ -129,8 +138,7 @@ internal-java_tool-uninstall::
|
|||
# Cleaning targets
|
||||
#
|
||||
internal-java_tool-clean::
|
||||
rm -f $(JAVA_OBJ_FILES)
|
||||
rm -f $(ADDITIONAL_JAVA_OBJ_FILES)
|
||||
rm -f $(JAVA_OBJ_FILES) $(ADDITIONAL_JAVA_OBJ_FILES)
|
||||
|
||||
internal-java_tool-distclean::
|
||||
|
||||
|
|
Loading…
Reference in a new issue