~ubuntu-branches/ubuntu/edgy/sope/edgy

« back to all changes in this revision

Viewing changes to gnustep-make/Instance/Shared/java.make

  • Committer: Bazaar Package Importer
  • Author(s): Sebastian Ley
  • Date: 2005-08-19 16:53:31 UTC
  • Revision ID: james.westby@ubuntu.com-20050819165331-hs683wz1osm708pw
Tags: upstream-4.4rc.2
ImportĀ upstreamĀ versionĀ 4.4rc.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#
 
2
#   Shared/java.make
 
3
#
 
4
#   Makefile fragment with rules to compile and install java files,
 
5
#   with associated property files.
 
6
#
 
7
#   Copyright (C) 2000, 2002 Free Software Foundation, Inc.
 
8
#
 
9
#   Author:  Nicola Pero <nicola@brainstorm.co.uk> 
 
10
#
 
11
#   This file is part of the GNUstep Makefile Package.
 
12
#
 
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.
 
17
#   
 
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.
 
22
 
 
23
#
 
24
# input variables:
 
25
#
 
26
#  JAVA_OBJ_FILES, JAVA_JNI_OBJ_FILES, SUBPROJECT_OBJ_FILES :
 
27
#  the list of object files (built by Instance/rules.make)
 
28
#
 
29
#  $(GNUSTEP_INSTANCE)_JAVA_PROPERTIES_FILES : the list of .properties files
 
30
#  to install together with the .java files
 
31
#
 
32
#  GNUSTEP_SHARED_JAVA_INSTALLATION_DIR : the base directory where to
 
33
#  install the files.
 
34
#
 
35
 
 
36
#
 
37
# public targets:
 
38
 
39
#  shared-instance-java-all 
 
40
#  shared-instance-java-install
 
41
#  shared-instance-java-uninstall
 
42
#  shared-instance-java-clean
 
43
#
 
44
 
 
45
 
 
46
.PHONY: \
 
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
 
52
 
 
53
 
 
54
shared-instance-java-all: $(JAVA_OBJ_FILES) \
 
55
                         $(JAVA_JNI_OBJ_FILES) \
 
56
                         $(SUBPROJECT_OBJ_FILES)
 
57
 
 
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
 
64
# glance.
 
65
 
 
66
# Build efficiently the list of possible inner/nested classes 
 
67
 
 
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))
 
72
 
 
73
# Finally we need to escape the $s before passing the filenames to the
 
74
# shell
 
75
ADDITIONAL_JAVA_OBJ_FILES = $(subst $$,\$$,$(UNESCAPED_ADD_JAVA_OBJ_FILES))
 
76
 
 
77
JAVA_PROPERTIES_FILES = $($(GNUSTEP_INSTANCE)_JAVA_PROPERTIES_FILES)
 
78
 
 
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 ; \
 
85
          fi; \
 
86
        done$(END_ECHO)
 
87
endif
 
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 ; \
 
93
          fi; \
 
94
        done$(END_ECHO)
 
95
endif
 
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 ; \
 
101
          fi; \
 
102
        done$(END_ECHO)
 
103
endif
 
104
 
 
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)
 
109
endif
 
110
 
 
111
$(GNUSTEP_SHARED_JAVA_INSTALLATION_DIR):
 
112
        $(ECHO_CREATING)$(MKINSTALLDIRS) $@$(END_ECHO)
 
113
 
 
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)
 
118
 
 
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 ; \
 
124
          fi; \
 
125
        done$(END_ECHO)
 
126
endif
 
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 ; \
 
131
          fi; \
 
132
        done$(END_ECHO)
 
133
endif
 
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 ; \
 
138
          fi; \
 
139
        done$(END_ECHO)
 
140
endif