4
# Makefile fragment with rules to compile and install java files,
5
# with associated property files.
7
# Copyright (C) 2000, 2002 Free Software Foundation, Inc.
9
# Author: Nicola Pero <nicola@brainstorm.co.uk>
11
# This file is part of the GNUstep Makefile Package.
13
# This library is free software; you can redistribute it and/or
14
# modify it under the terms of the GNU General Public License
15
# as published by the Free Software Foundation; either version 2
16
# of the License, or (at your option) any later version.
18
# You should have received a copy of the GNU General Public
19
# License along with this library; see the file COPYING.LIB.
20
# If not, write to the Free Software Foundation,
21
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26
# JAVA_OBJ_FILES, JAVA_JNI_OBJ_FILES, SUBPROJECT_OBJ_FILES :
27
# the list of object files (built by Instance/rules.make)
29
# $(GNUSTEP_INSTANCE)_JAVA_PROPERTIES_FILES : the list of .properties files
30
# to install together with the .java files
32
# GNUSTEP_SHARED_JAVA_INSTALLATION_DIR : the base directory where to
39
# shared-instance-java-all
40
# shared-instance-java-install
41
# shared-instance-java-uninstall
42
# shared-instance-java-clean
47
shared-instance-java-all \
48
shared-instance-java-install \
49
shared-instance-java-install-dirs \
50
shared-instance-java-uninstall \
51
shared-instance-java-clean
54
shared-instance-java-all: $(JAVA_OBJ_FILES) \
55
$(JAVA_JNI_OBJ_FILES) \
56
$(SUBPROJECT_OBJ_FILES)
58
# Say that you have a Pisa.java source file. Here we install both
59
# Pisa.class (the main class) and also, if they exist, all class files
60
# with names beginning wih Pisa$ (such as Pisa$1$Nicola.class); these
61
# files are generated for nested/inner classes, and must be installed
62
# as well. The fact we need to install these files is the reason why
63
# the following is more complicated than you would think at first
66
# Build efficiently the list of possible inner/nested classes
68
# We first build a list like in `Pisa[$]*.class Roma[$]*.class' by
69
# taking the JAVA_OBJ_FILES and replacing .class with [$]*.class, then
70
# we use wildcard to get the list of all files matching the pattern
71
UNESCAPED_ADD_JAVA_OBJ_FILES = $(wildcard $(JAVA_OBJ_FILES:.class=[$$]*.class))
73
# Finally we need to escape the $s before passing the filenames to the
75
ADDITIONAL_JAVA_OBJ_FILES = $(subst $$,\$$,$(UNESCAPED_ADD_JAVA_OBJ_FILES))
77
JAVA_PROPERTIES_FILES = $($(GNUSTEP_INSTANCE)_JAVA_PROPERTIES_FILES)
79
shared-instance-java-install: shared-instance-java-install-dirs
80
ifneq ($(JAVA_OBJ_FILES),)
81
$(ECHO_INSTALLING_CLASS_FILES)for file in $(JAVA_OBJ_FILES) __done; do \
82
if [ $$file != __done ]; then \
83
$(INSTALL_DATA) $$file \
84
$(GNUSTEP_SHARED_JAVA_INSTALLATION_DIR)/$$file ; \
88
ifneq ($(ADDITIONAL_JAVA_OBJ_FILES),)
89
$(ECHO_INSTALLING_ADD_CLASS_FILES)for file in $(ADDITIONAL_JAVA_OBJ_FILES) __done; do \
90
if [ $$file != __done ]; then \
91
$(INSTALL_DATA) $$file \
92
$(GNUSTEP_SHARED_JAVA_INSTALLATION_DIR)/$$file ; \
96
ifneq ($(JAVA_PROPERTIES_FILES),)
97
$(ECHO_INSTALLING_PROPERTIES_FILES)for file in $(JAVA_PROPERTIES_FILES) __done; do \
98
if [ $$file != __done ]; then \
99
$(INSTALL_DATA) $$file \
100
$(GNUSTEP_SHARED_JAVA_INSTALLATION_DIR)/$$file ; \
105
shared-instance-java-install-dirs: $(GNUSTEP_SHARED_JAVA_INSTALLATION_DIR)
106
ifneq ($(JAVA_OBJ_FILES),)
107
$(ECHO_NOTHING)$(MKINSTALLDIRS) \
108
$(addprefix $(GNUSTEP_SHARED_JAVA_INSTALLATION_DIR)/,$(dir $(JAVA_OBJ_FILES)))$(END_ECHO)
111
$(GNUSTEP_SHARED_JAVA_INSTALLATION_DIR):
112
$(ECHO_CREATING)$(MKINSTALLDIRS) $@$(END_ECHO)
114
shared-instance-java-clean:
115
$(ECHO_NOTHING)rm -f $(JAVA_OBJ_FILES) \
116
$(ADDITIONAL_JAVA_OBJ_FILES) \
117
$(JAVA_JNI_OBJ_FILES)$(END_ECHO)
119
shared-instance-java-uninstall:
120
ifneq ($(JAVA_OBJ_FILES),)
121
$(ECHO_NOTHING)for file in $(JAVA_OBJ_FILES) __done; do \
122
if [ $$file != __done ]; then \
123
rm -f $(GNUSTEP_SHARED_JAVA_INSTALLATION_DIR)/$$file ; \
127
ifneq ($(ADDITIONAL_JAVA_OBJ_FILES),)
128
$(ECHO_NOTHING)for file in $(ADDITIONAL_JAVA_OBJ_FILES) __done; do \
129
if [ $$file != __done ]; then \
130
rm -f $(GNUSTEP_SHARED_JAVA_INSTALLATION_DIR)/$$file ; \
134
ifneq ($(JAVA_PROPERTIES_FILES),)
135
$(ECHO_NOTHING)for file in $(JAVA_PROPERTIES_FILES) __done; do \
136
if [ $$file != __done ]; then \
137
rm -f $(GNUSTEP_SHARED_JAVA_INSTALLATION_DIR)/$$file ; \