corba/make/common/Rules.gmk
author ohair
Fri, 18 Sep 2009 16:26:51 -0700
changeset 3874 02fe9a813203
parent 3871 3d528461f61d
child 3875 eea3f9d9076d
permissions -rw-r--r--
6883790: corba build problem related to wildcard and vpath, regression Reviewed-by: tbell
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4
02bb8761fcce Initial load
duke
parents:
diff changeset
     1
#
3291
805a72a26925 6862919: Update copyright year
xdono
parents: 2199
diff changeset
     2
# Copyright 1995-2009 Sun Microsystems, Inc.  All Rights Reserved.
4
02bb8761fcce Initial load
duke
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
02bb8761fcce Initial load
duke
parents:
diff changeset
     4
#
02bb8761fcce Initial load
duke
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
02bb8761fcce Initial load
duke
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
02bb8761fcce Initial load
duke
parents:
diff changeset
     7
# published by the Free Software Foundation.  Sun designates this
02bb8761fcce Initial load
duke
parents:
diff changeset
     8
# particular file as subject to the "Classpath" exception as provided
02bb8761fcce Initial load
duke
parents:
diff changeset
     9
# by Sun in the LICENSE file that accompanied this code.
02bb8761fcce Initial load
duke
parents:
diff changeset
    10
#
02bb8761fcce Initial load
duke
parents:
diff changeset
    11
# This code is distributed in the hope that it will be useful, but WITHOUT
02bb8761fcce Initial load
duke
parents:
diff changeset
    12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
02bb8761fcce Initial load
duke
parents:
diff changeset
    13
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
02bb8761fcce Initial load
duke
parents:
diff changeset
    14
# version 2 for more details (a copy is included in the LICENSE file that
02bb8761fcce Initial load
duke
parents:
diff changeset
    15
# accompanied this code).
02bb8761fcce Initial load
duke
parents:
diff changeset
    16
#
02bb8761fcce Initial load
duke
parents:
diff changeset
    17
# You should have received a copy of the GNU General Public License version
02bb8761fcce Initial load
duke
parents:
diff changeset
    18
# 2 along with this work; if not, write to the Free Software Foundation,
02bb8761fcce Initial load
duke
parents:
diff changeset
    19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
02bb8761fcce Initial load
duke
parents:
diff changeset
    20
#
02bb8761fcce Initial load
duke
parents:
diff changeset
    21
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
02bb8761fcce Initial load
duke
parents:
diff changeset
    22
# CA 95054 USA or visit www.sun.com if you need additional information or
02bb8761fcce Initial load
duke
parents:
diff changeset
    23
# have any questions.
02bb8761fcce Initial load
duke
parents:
diff changeset
    24
#
02bb8761fcce Initial load
duke
parents:
diff changeset
    25
02bb8761fcce Initial load
duke
parents:
diff changeset
    26
#
02bb8761fcce Initial load
duke
parents:
diff changeset
    27
#
02bb8761fcce Initial load
duke
parents:
diff changeset
    28
# Rules shared by all Java makefiles.
02bb8761fcce Initial load
duke
parents:
diff changeset
    29
#
3871
3d528461f61d 6875240: Reduce Makefile build time by limiting repeated exec's (mostly for cygwin building)
ohair
parents: 3291
diff changeset
    30
3d528461f61d 6875240: Reduce Makefile build time by limiting repeated exec's (mostly for cygwin building)
ohair
parents: 3291
diff changeset
    31
# Used with wildcard to look into a java package for files (assumes max 5 deep)
3d528461f61d 6875240: Reduce Makefile build time by limiting repeated exec's (mostly for cygwin building)
ohair
parents: 3291
diff changeset
    32
_WC_DIRS  = * */* */*/* */*/*/* */*/*/*/*
4
02bb8761fcce Initial load
duke
parents:
diff changeset
    33
02bb8761fcce Initial load
duke
parents:
diff changeset
    34
# Make sure the default rule is all
02bb8761fcce Initial load
duke
parents:
diff changeset
    35
rules_default_rule: all
02bb8761fcce Initial load
duke
parents:
diff changeset
    36
02bb8761fcce Initial load
duke
parents:
diff changeset
    37
#
02bb8761fcce Initial load
duke
parents:
diff changeset
    38
# Directory set up.  (Needed by deploy workspace)
02bb8761fcce Initial load
duke
parents:
diff changeset
    39
# 
02bb8761fcce Initial load
duke
parents:
diff changeset
    40
$(CLASSDESTDIR) $(CLASSHDRDIR) $(OBJDIR) $(OUTPUTDIR) $(BINDIR) $(LIBDIR) $(LIBDIR)/$(LIBARCH) $(TEMPDIR) $(EXTDIR):
02bb8761fcce Initial load
duke
parents:
diff changeset
    41
	$(MKDIR) -p $@ 
02bb8761fcce Initial load
duke
parents:
diff changeset
    42
02bb8761fcce Initial load
duke
parents:
diff changeset
    43
#
02bb8761fcce Initial load
duke
parents:
diff changeset
    44
# All source tree areas for java/properties files 
02bb8761fcce Initial load
duke
parents:
diff changeset
    45
#
02bb8761fcce Initial load
duke
parents:
diff changeset
    46
ALL_CLASSES_SRC = $(SHARE_SRC)/classes $(PLATFORM_SRC)/classes
02bb8761fcce Initial load
duke
parents:
diff changeset
    47
02bb8761fcce Initial load
duke
parents:
diff changeset
    48
#
02bb8761fcce Initial load
duke
parents:
diff changeset
    49
# If AUTO_FILES_PROPERTIES_DIRS used, automatically find properties files
02bb8761fcce Initial load
duke
parents:
diff changeset
    50
#
02bb8761fcce Initial load
duke
parents:
diff changeset
    51
ifdef AUTO_FILES_PROPERTIES_DIRS
3871
3d528461f61d 6875240: Reduce Makefile build time by limiting repeated exec's (mostly for cygwin building)
ohair
parents: 3291
diff changeset
    52
  # Wildcard all possible properties files
3d528461f61d 6875240: Reduce Makefile build time by limiting repeated exec's (mostly for cygwin building)
ohair
parents: 3291
diff changeset
    53
  _WC_PROP_FILES = $(patsubst %, %/*.properties, $(_WC_DIRS))
3d528461f61d 6875240: Reduce Makefile build time by limiting repeated exec's (mostly for cygwin building)
ohair
parents: 3291
diff changeset
    54
  # Wildcard package directories for this Makefile
3d528461f61d 6875240: Reduce Makefile build time by limiting repeated exec's (mostly for cygwin building)
ohair
parents: 3291
diff changeset
    55
  _AUTO_WC_PROP_FILES = $(foreach dir, $(AUTO_FILES_PROPERTIES_DIRS), \
3d528461f61d 6875240: Reduce Makefile build time by limiting repeated exec's (mostly for cygwin building)
ohair
parents: 3291
diff changeset
    56
          $(patsubst %, $(dir)/%, $(_WC_PROP_FILES)) )
3d528461f61d 6875240: Reduce Makefile build time by limiting repeated exec's (mostly for cygwin building)
ohair
parents: 3291
diff changeset
    57
  # Wildcard all source directories
3d528461f61d 6875240: Reduce Makefile build time by limiting repeated exec's (mostly for cygwin building)
ohair
parents: 3291
diff changeset
    58
  _AUTO_WC_ALL_PROP_FILES1 = $(foreach dir, $(ALL_CLASSES_SRC), \
3d528461f61d 6875240: Reduce Makefile build time by limiting repeated exec's (mostly for cygwin building)
ohair
parents: 3291
diff changeset
    59
          $(patsubst %, $(dir)/%,  $(_AUTO_WC_PROP_FILES)) )
3d528461f61d 6875240: Reduce Makefile build time by limiting repeated exec's (mostly for cygwin building)
ohair
parents: 3291
diff changeset
    60
  # Find all files meeting this pattern
3d528461f61d 6875240: Reduce Makefile build time by limiting repeated exec's (mostly for cygwin building)
ohair
parents: 3291
diff changeset
    61
  FILES_properties_auto1 := $(wildcard $(_AUTO_WC_ALL_PROP_FILES1))
4
02bb8761fcce Initial load
duke
parents:
diff changeset
    62
else
02bb8761fcce Initial load
duke
parents:
diff changeset
    63
  FILES_properties_auto1 =
02bb8761fcce Initial load
duke
parents:
diff changeset
    64
endif # AUTO_FILES_PROPERTIES_DIRS
02bb8761fcce Initial load
duke
parents:
diff changeset
    65
02bb8761fcce Initial load
duke
parents:
diff changeset
    66
# Add any automatically found properties files to the properties file list
02bb8761fcce Initial load
duke
parents:
diff changeset
    67
FILES_properties += $(FILES_properties_auto1)
02bb8761fcce Initial load
duke
parents:
diff changeset
    68
02bb8761fcce Initial load
duke
parents:
diff changeset
    69
#
02bb8761fcce Initial load
duke
parents:
diff changeset
    70
# Get Resources help
02bb8761fcce Initial load
duke
parents:
diff changeset
    71
#
02bb8761fcce Initial load
duke
parents:
diff changeset
    72
include $(TOPDIR)/make/common/internal/Resources.gmk
02bb8761fcce Initial load
duke
parents:
diff changeset
    73
02bb8761fcce Initial load
duke
parents:
diff changeset
    74
#
02bb8761fcce Initial load
duke
parents:
diff changeset
    75
# Compiling .java files.
02bb8761fcce Initial load
duke
parents:
diff changeset
    76
#
02bb8761fcce Initial load
duke
parents:
diff changeset
    77
02bb8761fcce Initial load
duke
parents:
diff changeset
    78
#
02bb8761fcce Initial load
duke
parents:
diff changeset
    79
# Automatically add to FILES_java if AUTO_FILES_JAVA_DIRS is defined
02bb8761fcce Initial load
duke
parents:
diff changeset
    80
#
02bb8761fcce Initial load
duke
parents:
diff changeset
    81
#    There are two basic types of sources, normal source files and the
02bb8761fcce Initial load
duke
parents:
diff changeset
    82
#    generated ones. The Normal sources will be located in:
02bb8761fcce Initial load
duke
parents:
diff changeset
    83
#         $(ALL_CLASSES_SRC)
02bb8761fcce Initial load
duke
parents:
diff changeset
    84
#    The generated sources, which might show up late to dinner, are at:
02bb8761fcce Initial load
duke
parents:
diff changeset
    85
#         $(GENSRCDIR)
02bb8761fcce Initial load
duke
parents:
diff changeset
    86
#    and since they could be generated late, we need to be careful that
02bb8761fcce Initial load
duke
parents:
diff changeset
    87
#    we look for these sources late and not use the ':=' assignment which
02bb8761fcce Initial load
duke
parents:
diff changeset
    88
#    might miss their generation.
02bb8761fcce Initial load
duke
parents:
diff changeset
    89
02bb8761fcce Initial load
duke
parents:
diff changeset
    90
ifdef AUTO_FILES_JAVA_DIRS
3871
3d528461f61d 6875240: Reduce Makefile build time by limiting repeated exec's (mostly for cygwin building)
ohair
parents: 3291
diff changeset
    91
  # Wildcard all possible java files
3d528461f61d 6875240: Reduce Makefile build time by limiting repeated exec's (mostly for cygwin building)
ohair
parents: 3291
diff changeset
    92
  _WC_JAVA_FILES = $(patsubst %, %/*.java, $(_WC_DIRS))
3d528461f61d 6875240: Reduce Makefile build time by limiting repeated exec's (mostly for cygwin building)
ohair
parents: 3291
diff changeset
    93
  # Wildcard package directories for this Makefile
3d528461f61d 6875240: Reduce Makefile build time by limiting repeated exec's (mostly for cygwin building)
ohair
parents: 3291
diff changeset
    94
  _AUTO_WC_JAVA_FILES = $(foreach dir, $(AUTO_FILES_JAVA_DIRS), \
3d528461f61d 6875240: Reduce Makefile build time by limiting repeated exec's (mostly for cygwin building)
ohair
parents: 3291
diff changeset
    95
          $(patsubst %, $(dir)/%, $(_WC_JAVA_FILES)) )
3d528461f61d 6875240: Reduce Makefile build time by limiting repeated exec's (mostly for cygwin building)
ohair
parents: 3291
diff changeset
    96
  # Wildcard all source directories
3d528461f61d 6875240: Reduce Makefile build time by limiting repeated exec's (mostly for cygwin building)
ohair
parents: 3291
diff changeset
    97
  _AUTO_WC_ALL_JAVA_FILES1 = $(foreach dir, $(ALL_CLASSES_SRC), \
3d528461f61d 6875240: Reduce Makefile build time by limiting repeated exec's (mostly for cygwin building)
ohair
parents: 3291
diff changeset
    98
          $(patsubst %, $(dir)/%,  $(_AUTO_WC_JAVA_FILES)) )
3d528461f61d 6875240: Reduce Makefile build time by limiting repeated exec's (mostly for cygwin building)
ohair
parents: 3291
diff changeset
    99
  # Find all files meeting this pattern
3d528461f61d 6875240: Reduce Makefile build time by limiting repeated exec's (mostly for cygwin building)
ohair
parents: 3291
diff changeset
   100
  FILES_java_auto1 := $(wildcard $(_AUTO_WC_ALL_JAVA_FILES1))
4
02bb8761fcce Initial load
duke
parents:
diff changeset
   101
02bb8761fcce Initial load
duke
parents:
diff changeset
   102
  # Second list is the generated sources that should be rare, but will likely
02bb8761fcce Initial load
duke
parents:
diff changeset
   103
  #   show up late and we need to look for them at the last minute, so we
02bb8761fcce Initial load
duke
parents:
diff changeset
   104
  #   cannot use the ':=' assigment here. But if this gets expanded multiple
02bb8761fcce Initial load
duke
parents:
diff changeset
   105
  #   times, the if tests should make them relatively cheap.
3871
3d528461f61d 6875240: Reduce Makefile build time by limiting repeated exec's (mostly for cygwin building)
ohair
parents: 3291
diff changeset
   106
  # Wildcard the generated source directories
3d528461f61d 6875240: Reduce Makefile build time by limiting repeated exec's (mostly for cygwin building)
ohair
parents: 3291
diff changeset
   107
  _AUTO_WC_ALL_JAVA_FILES2 = $(patsubst %, $(GENSRCDIR)/%, $(_AUTO_WC_JAVA_FILES))
3d528461f61d 6875240: Reduce Makefile build time by limiting repeated exec's (mostly for cygwin building)
ohair
parents: 3291
diff changeset
   108
  # Find all files meeting this pattern
3d528461f61d 6875240: Reduce Makefile build time by limiting repeated exec's (mostly for cygwin building)
ohair
parents: 3291
diff changeset
   109
  FILES_java_auto2 = $(wildcard $(_AUTO_WC_ALL_JAVA_FILES2))
4
02bb8761fcce Initial load
duke
parents:
diff changeset
   110
else
02bb8761fcce Initial load
duke
parents:
diff changeset
   111
  FILES_java_auto1 =
02bb8761fcce Initial load
duke
parents:
diff changeset
   112
  FILES_java_auto2 =
02bb8761fcce Initial load
duke
parents:
diff changeset
   113
endif
02bb8761fcce Initial load
duke
parents:
diff changeset
   114
02bb8761fcce Initial load
duke
parents:
diff changeset
   115
# Add all found java sources to FILES_java macro (if AUTO_FILES_JAVA_DIRS used)
02bb8761fcce Initial load
duke
parents:
diff changeset
   116
FILES_java += $(FILES_java_auto1) $(FILES_java_auto2)
02bb8761fcce Initial load
duke
parents:
diff changeset
   117
02bb8761fcce Initial load
duke
parents:
diff changeset
   118
# File that will hold java source names that need compiling
02bb8761fcce Initial load
duke
parents:
diff changeset
   119
JAVA_SOURCE_LIST=$(TEMPDIR)/.classes.list
02bb8761fcce Initial load
duke
parents:
diff changeset
   120
02bb8761fcce Initial load
duke
parents:
diff changeset
   121
# Add a java source to the list
02bb8761fcce Initial load
duke
parents:
diff changeset
   122
define add-java-file
02bb8761fcce Initial load
duke
parents:
diff changeset
   123
$(ECHO) "$?" >> $(JAVA_SOURCE_LIST)
02bb8761fcce Initial load
duke
parents:
diff changeset
   124
endef
02bb8761fcce Initial load
duke
parents:
diff changeset
   125
02bb8761fcce Initial load
duke
parents:
diff changeset
   126
$(CLASSDESTDIR)/%.class: $(GENSRCDIR)/%.java
02bb8761fcce Initial load
duke
parents:
diff changeset
   127
	@$(add-java-file)
02bb8761fcce Initial load
duke
parents:
diff changeset
   128
$(CLASSDESTDIR)/%.class: $(PLATFORM_SRC)/classes/%.java
02bb8761fcce Initial load
duke
parents:
diff changeset
   129
	@$(add-java-file)
02bb8761fcce Initial load
duke
parents:
diff changeset
   130
$(CLASSDESTDIR)/%.class: $(SHARE_SRC)/classes/%.java
02bb8761fcce Initial load
duke
parents:
diff changeset
   131
	@$(add-java-file)
02bb8761fcce Initial load
duke
parents:
diff changeset
   132
02bb8761fcce Initial load
duke
parents:
diff changeset
   133
# List of class files needed
02bb8761fcce Initial load
duke
parents:
diff changeset
   134
FILES_class = $(FILES_java:%.java=$(CLASSDESTDIR)/%.class)
02bb8761fcce Initial load
duke
parents:
diff changeset
   135
02bb8761fcce Initial load
duke
parents:
diff changeset
   136
# Got to include exported files.
02bb8761fcce Initial load
duke
parents:
diff changeset
   137
FILES_class += $(FILES_export:%.java=$(CLASSDESTDIR)/%.class)
02bb8761fcce Initial load
duke
parents:
diff changeset
   138
02bb8761fcce Initial load
duke
parents:
diff changeset
   139
# Construct list of java sources we need to compile
02bb8761fcce Initial load
duke
parents:
diff changeset
   140
source_list_prime:
02bb8761fcce Initial load
duke
parents:
diff changeset
   141
	@$(MKDIR) -p $(TEMPDIR)
02bb8761fcce Initial load
duke
parents:
diff changeset
   142
# Note that we slip resources in so that compiled properties files get created:
02bb8761fcce Initial load
duke
parents:
diff changeset
   143
$(JAVA_SOURCE_LIST) : source_list_prime resources $(FILES_class)
02bb8761fcce Initial load
duke
parents:
diff changeset
   144
	@$(TOUCH) $@
02bb8761fcce Initial load
duke
parents:
diff changeset
   145
02bb8761fcce Initial load
duke
parents:
diff changeset
   146
.delete.classlist:
02bb8761fcce Initial load
duke
parents:
diff changeset
   147
	@$(RM) $(JAVA_SOURCE_LIST)
02bb8761fcce Initial load
duke
parents:
diff changeset
   148
02bb8761fcce Initial load
duke
parents:
diff changeset
   149
# Make sure all newer sources are compiled (in a batch)
02bb8761fcce Initial load
duke
parents:
diff changeset
   150
classes : $(CLASSES_INIT) .delete.classlist .compile.classlist
02bb8761fcce Initial load
duke
parents:
diff changeset
   151
2199
05f4bf151242 6790292: BOOTDIR of jdk6 u12 will not work with jdk7 builds
ohair
parents: 4
diff changeset
   152
# Use this javac option to force it to favor the sourcepath file classes
05f4bf151242 6790292: BOOTDIR of jdk6 u12 will not work with jdk7 builds
ohair
parents: 4
diff changeset
   153
#   rather than any bootclasspath classes.
05f4bf151242 6790292: BOOTDIR of jdk6 u12 will not work with jdk7 builds
ohair
parents: 4
diff changeset
   154
JAVAC_PREFER_SOURCE = -Xprefer:source
05f4bf151242 6790292: BOOTDIR of jdk6 u12 will not work with jdk7 builds
ohair
parents: 4
diff changeset
   155
4
02bb8761fcce Initial load
duke
parents:
diff changeset
   156
.compile.classlist : $(JAVA_SOURCE_LIST)
02bb8761fcce Initial load
duke
parents:
diff changeset
   157
	@$(MKDIR) -p $(CLASSDESTDIR)
3871
3d528461f61d 6875240: Reduce Makefile build time by limiting repeated exec's (mostly for cygwin building)
ohair
parents: 3291
diff changeset
   158
	if [ -s $(JAVA_SOURCE_LIST) ] ; then \
3874
02fe9a813203 6883790: corba build problem related to wildcard and vpath, regression
ohair
parents: 3871
diff changeset
   159
          $(CAT) $(JAVA_SOURCE_LIST); \
2199
05f4bf151242 6790292: BOOTDIR of jdk6 u12 will not work with jdk7 builds
ohair
parents: 4
diff changeset
   160
	  $(JAVAC_CMD) $(JAVAC_PREFER_SOURCE) -sourcepath "$(SOURCEPATH)" -d $(CLASSDESTDIR) @$(JAVA_SOURCE_LIST); \
4
02bb8761fcce Initial load
duke
parents:
diff changeset
   161
	fi
02bb8761fcce Initial load
duke
parents:
diff changeset
   162
	@$(java-vm-cleanup)
02bb8761fcce Initial load
duke
parents:
diff changeset
   163
02bb8761fcce Initial load
duke
parents:
diff changeset
   164
clobber clean::
02bb8761fcce Initial load
duke
parents:
diff changeset
   165
	$(RM) $(JAVA_SOURCE_LIST)
02bb8761fcce Initial load
duke
parents:
diff changeset
   166
02bb8761fcce Initial load
duke
parents:
diff changeset
   167
ifndef DONT_CLOBBER_CLASSES
02bb8761fcce Initial load
duke
parents:
diff changeset
   168
  ifndef PACKAGE
02bb8761fcce Initial load
duke
parents:
diff changeset
   169
    DONT_CLOBBER_CLASSES = true
02bb8761fcce Initial load
duke
parents:
diff changeset
   170
  else
02bb8761fcce Initial load
duke
parents:
diff changeset
   171
    DONT_CLOBBER_CLASSES = false
02bb8761fcce Initial load
duke
parents:
diff changeset
   172
  endif
02bb8761fcce Initial load
duke
parents:
diff changeset
   173
endif
02bb8761fcce Initial load
duke
parents:
diff changeset
   174
02bb8761fcce Initial load
duke
parents:
diff changeset
   175
packages.clean:
02bb8761fcce Initial load
duke
parents:
diff changeset
   176
ifeq ($(DONT_CLOBBER_CLASSES),false)
02bb8761fcce Initial load
duke
parents:
diff changeset
   177
  ifdef AUTO_FILES_JAVA_DIRS
3871
3d528461f61d 6875240: Reduce Makefile build time by limiting repeated exec's (mostly for cygwin building)
ohair
parents: 3291
diff changeset
   178
	$(RM) -r $(patsubst %, $(CLASSDESTDIR)/%, $(AUTO_FILES_JAVA_DIRS))
4
02bb8761fcce Initial load
duke
parents:
diff changeset
   179
  else
02bb8761fcce Initial load
duke
parents:
diff changeset
   180
	$(RM) -r $(CLASSDESTDIR)/$(PKGDIR)
02bb8761fcce Initial load
duke
parents:
diff changeset
   181
  endif
02bb8761fcce Initial load
duke
parents:
diff changeset
   182
endif
02bb8761fcce Initial load
duke
parents:
diff changeset
   183
02bb8761fcce Initial load
duke
parents:
diff changeset
   184
classes.clean: packages.clean
02bb8761fcce Initial load
duke
parents:
diff changeset
   185
	$(RM) $(JAVA_SOURCE_LIST)
02bb8761fcce Initial load
duke
parents:
diff changeset
   186
02bb8761fcce Initial load
duke
parents:
diff changeset
   187
#
02bb8761fcce Initial load
duke
parents:
diff changeset
   188
# C and C++ make dependencies
02bb8761fcce Initial load
duke
parents:
diff changeset
   189
#
02bb8761fcce Initial load
duke
parents:
diff changeset
   190
include $(TOPDIR)/make/common/internal/NativeCompileRules.gmk
02bb8761fcce Initial load
duke
parents:
diff changeset
   191
02bb8761fcce Initial load
duke
parents:
diff changeset
   192
#
02bb8761fcce Initial load
duke
parents:
diff changeset
   193
# Running Javah to generate stuff into CClassHeaders.
02bb8761fcce Initial load
duke
parents:
diff changeset
   194
#
02bb8761fcce Initial load
duke
parents:
diff changeset
   195
02bb8761fcce Initial load
duke
parents:
diff changeset
   196
ifdef FILES_export
02bb8761fcce Initial load
duke
parents:
diff changeset
   197
02bb8761fcce Initial load
duke
parents:
diff changeset
   198
CLASSES.export  = $(subst /,.,$(FILES_export:%.java=%))
02bb8761fcce Initial load
duke
parents:
diff changeset
   199
CLASSES.export += $(subst /,.,$(FILES_export2:%.java=%))
02bb8761fcce Initial load
duke
parents:
diff changeset
   200
CLASSES.export += $(subst /,.,$(FILES_export3:%.java=%))
02bb8761fcce Initial load
duke
parents:
diff changeset
   201
CLASSES_export  = $(FILES_export:%.java=$(CLASSDESTDIR)/%.class)
02bb8761fcce Initial load
duke
parents:
diff changeset
   202
CLASSES_export += $(FILES_export2:%.java=$(CLASSDESTDIR)/%.class)
02bb8761fcce Initial load
duke
parents:
diff changeset
   203
CLASSES_export += $(FILES_export3:%.java=$(CLASSDESTDIR)/%.class)
02bb8761fcce Initial load
duke
parents:
diff changeset
   204
02bb8761fcce Initial load
duke
parents:
diff changeset
   205
# Fix when deploy workspace makefiles don't depend on this name
02bb8761fcce Initial load
duke
parents:
diff changeset
   206
#CLASSHDR_DOTFILE=$(CLASSHDRDIR)/.classheaders
02bb8761fcce Initial load
duke
parents:
diff changeset
   207
02bb8761fcce Initial load
duke
parents:
diff changeset
   208
CLASSHDR_DOTFILE=$(OBJDIR)/.class.headers.$(ARCH)
02bb8761fcce Initial load
duke
parents:
diff changeset
   209
02bb8761fcce Initial load
duke
parents:
diff changeset
   210
classheaders: classes $(CLASSHDR_DOTFILE)
02bb8761fcce Initial load
duke
parents:
diff changeset
   211
02bb8761fcce Initial load
duke
parents:
diff changeset
   212
$(CLASSHDR_DOTFILE): $(CLASSES_export)
02bb8761fcce Initial load
duke
parents:
diff changeset
   213
	$(prep-target)
02bb8761fcce Initial load
duke
parents:
diff changeset
   214
	$(JAVAH_CMD) -d $(CLASSHDRDIR)/ \
02bb8761fcce Initial load
duke
parents:
diff changeset
   215
		$(CLASSES.export) $(subst $$,\$$,$(EXPORTED_inner))
02bb8761fcce Initial load
duke
parents:
diff changeset
   216
	@$(java-vm-cleanup)
02bb8761fcce Initial load
duke
parents:
diff changeset
   217
	@$(TOUCH) $@
02bb8761fcce Initial load
duke
parents:
diff changeset
   218
02bb8761fcce Initial load
duke
parents:
diff changeset
   219
classheaders.clean:
3871
3d528461f61d 6875240: Reduce Makefile build time by limiting repeated exec's (mostly for cygwin building)
ohair
parents: 3291
diff changeset
   220
	$(RM) -r $(CLASSHDRDIR) $(CLASSHDR_DOTFILE)
4
02bb8761fcce Initial load
duke
parents:
diff changeset
   221
02bb8761fcce Initial load
duke
parents:
diff changeset
   222
else # FILES_export
02bb8761fcce Initial load
duke
parents:
diff changeset
   223
02bb8761fcce Initial load
duke
parents:
diff changeset
   224
classheaders: classes
02bb8761fcce Initial load
duke
parents:
diff changeset
   225
02bb8761fcce Initial load
duke
parents:
diff changeset
   226
classheaders.clean: 
02bb8761fcce Initial load
duke
parents:
diff changeset
   227
02bb8761fcce Initial load
duke
parents:
diff changeset
   228
endif # FILES_export
02bb8761fcce Initial load
duke
parents:
diff changeset
   229
02bb8761fcce Initial load
duke
parents:
diff changeset
   230
clean clobber:: classheaders.clean classes.clean .delete.classlist
02bb8761fcce Initial load
duke
parents:
diff changeset
   231
02bb8761fcce Initial load
duke
parents:
diff changeset
   232
# 
02bb8761fcce Initial load
duke
parents:
diff changeset
   233
# Default dependencies
02bb8761fcce Initial load
duke
parents:
diff changeset
   234
#
02bb8761fcce Initial load
duke
parents:
diff changeset
   235
02bb8761fcce Initial load
duke
parents:
diff changeset
   236
all: build
02bb8761fcce Initial load
duke
parents:
diff changeset
   237
02bb8761fcce Initial load
duke
parents:
diff changeset
   238
build: classheaders
02bb8761fcce Initial load
duke
parents:
diff changeset
   239
02bb8761fcce Initial load
duke
parents:
diff changeset
   240
default: all
02bb8761fcce Initial load
duke
parents:
diff changeset
   241
02bb8761fcce Initial load
duke
parents:
diff changeset
   242
.PHONY: all build clean clobber \
02bb8761fcce Initial load
duke
parents:
diff changeset
   243
        .delete.classlist classes .compile.classlist classes.clean \
02bb8761fcce Initial load
duke
parents:
diff changeset
   244
	 classheaders classheaders.clean \
02bb8761fcce Initial load
duke
parents:
diff changeset
   245
	 batch_compile
02bb8761fcce Initial load
duke
parents:
diff changeset
   246