corba/make/common/Rules.gmk
author martin
Mon, 07 Dec 2009 15:32:26 -0800
changeset 4354 3a70dde80b3b
parent 3875 eea3f9d9076d
child 5555 b2b5ed3f0d0d
permissions -rw-r--r--
6905029: Broken links in Deflater and DeflaterOutputStream javadoc Summary: Fix syntax errors in @links Reviewed-by: alanb
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
4
02bb8761fcce Initial load
duke
parents:
diff changeset
    31
# Make sure the default rule is all
02bb8761fcce Initial load
duke
parents:
diff changeset
    32
rules_default_rule: all
02bb8761fcce Initial load
duke
parents:
diff changeset
    33
02bb8761fcce Initial load
duke
parents:
diff changeset
    34
#
02bb8761fcce Initial load
duke
parents:
diff changeset
    35
# Directory set up.  (Needed by deploy workspace)
02bb8761fcce Initial load
duke
parents:
diff changeset
    36
# 
02bb8761fcce Initial load
duke
parents:
diff changeset
    37
$(CLASSDESTDIR) $(CLASSHDRDIR) $(OBJDIR) $(OUTPUTDIR) $(BINDIR) $(LIBDIR) $(LIBDIR)/$(LIBARCH) $(TEMPDIR) $(EXTDIR):
02bb8761fcce Initial load
duke
parents:
diff changeset
    38
	$(MKDIR) -p $@ 
02bb8761fcce Initial load
duke
parents:
diff changeset
    39
02bb8761fcce Initial load
duke
parents:
diff changeset
    40
#
02bb8761fcce Initial load
duke
parents:
diff changeset
    41
# All source tree areas for java/properties files 
02bb8761fcce Initial load
duke
parents:
diff changeset
    42
#
02bb8761fcce Initial load
duke
parents:
diff changeset
    43
ALL_CLASSES_SRC = $(SHARE_SRC)/classes $(PLATFORM_SRC)/classes
02bb8761fcce Initial load
duke
parents:
diff changeset
    44
02bb8761fcce Initial load
duke
parents:
diff changeset
    45
#
02bb8761fcce Initial load
duke
parents:
diff changeset
    46
# If AUTO_FILES_PROPERTIES_DIRS used, automatically find properties files
02bb8761fcce Initial load
duke
parents:
diff changeset
    47
#
02bb8761fcce Initial load
duke
parents:
diff changeset
    48
ifdef AUTO_FILES_PROPERTIES_DIRS
3875
eea3f9d9076d 6883816: corba fix for missing javax/transaction/xa classes (the real fix)
ohair
parents: 3874
diff changeset
    49
  AUTO_FILES_PROPERTIES_FILTERS1  = $(SCM_DIRs) 'X-*' '*-X-*' ',*'
eea3f9d9076d 6883816: corba fix for missing javax/transaction/xa classes (the real fix)
ohair
parents: 3874
diff changeset
    50
  AUTO_FILES_PROPERTIES_FILTERS1 += $(AUTO_PROPERTIES_PRUNE)
eea3f9d9076d 6883816: corba fix for missing javax/transaction/xa classes (the real fix)
ohair
parents: 3874
diff changeset
    51
  FILES_properties_find_filters1 = $(AUTO_FILES_PROPERTIES_FILTERS1:%=-name % -prune -o)
eea3f9d9076d 6883816: corba fix for missing javax/transaction/xa classes (the real fix)
ohair
parents: 3874
diff changeset
    52
  FILES_properties_auto1 := \
eea3f9d9076d 6883816: corba fix for missing javax/transaction/xa classes (the real fix)
ohair
parents: 3874
diff changeset
    53
     $(shell \
eea3f9d9076d 6883816: corba fix for missing javax/transaction/xa classes (the real fix)
ohair
parents: 3874
diff changeset
    54
        for dir in $(ALL_CLASSES_SRC) ; do \
eea3f9d9076d 6883816: corba fix for missing javax/transaction/xa classes (the real fix)
ohair
parents: 3874
diff changeset
    55
          if [ -d $$dir ] ; then \
eea3f9d9076d 6883816: corba fix for missing javax/transaction/xa classes (the real fix)
ohair
parents: 3874
diff changeset
    56
            ( $(CD) $$dir; \
eea3f9d9076d 6883816: corba fix for missing javax/transaction/xa classes (the real fix)
ohair
parents: 3874
diff changeset
    57
              for sdir in $(AUTO_FILES_PROPERTIES_DIRS); do \
eea3f9d9076d 6883816: corba fix for missing javax/transaction/xa classes (the real fix)
ohair
parents: 3874
diff changeset
    58
                if [ -d $$sdir ] ; then \
eea3f9d9076d 6883816: corba fix for missing javax/transaction/xa classes (the real fix)
ohair
parents: 3874
diff changeset
    59
                  $(FIND) $$sdir $(FILES_properties_find_filters1) \
eea3f9d9076d 6883816: corba fix for missing javax/transaction/xa classes (the real fix)
ohair
parents: 3874
diff changeset
    60
                                 -name '*.properties' -print ; \
eea3f9d9076d 6883816: corba fix for missing javax/transaction/xa classes (the real fix)
ohair
parents: 3874
diff changeset
    61
                fi ; \
eea3f9d9076d 6883816: corba fix for missing javax/transaction/xa classes (the real fix)
ohair
parents: 3874
diff changeset
    62
              done \
eea3f9d9076d 6883816: corba fix for missing javax/transaction/xa classes (the real fix)
ohair
parents: 3874
diff changeset
    63
            ); \
eea3f9d9076d 6883816: corba fix for missing javax/transaction/xa classes (the real fix)
ohair
parents: 3874
diff changeset
    64
          fi; \
eea3f9d9076d 6883816: corba fix for missing javax/transaction/xa classes (the real fix)
ohair
parents: 3874
diff changeset
    65
        done \
eea3f9d9076d 6883816: corba fix for missing javax/transaction/xa classes (the real fix)
ohair
parents: 3874
diff changeset
    66
      )
4
02bb8761fcce Initial load
duke
parents:
diff changeset
    67
else
02bb8761fcce Initial load
duke
parents:
diff changeset
    68
  FILES_properties_auto1 =
02bb8761fcce Initial load
duke
parents:
diff changeset
    69
endif # AUTO_FILES_PROPERTIES_DIRS
02bb8761fcce Initial load
duke
parents:
diff changeset
    70
02bb8761fcce Initial load
duke
parents:
diff changeset
    71
# Add any automatically found properties files to the properties file list
02bb8761fcce Initial load
duke
parents:
diff changeset
    72
FILES_properties += $(FILES_properties_auto1)
02bb8761fcce Initial load
duke
parents:
diff changeset
    73
02bb8761fcce Initial load
duke
parents:
diff changeset
    74
#
02bb8761fcce Initial load
duke
parents:
diff changeset
    75
# Get Resources help
02bb8761fcce Initial load
duke
parents:
diff changeset
    76
#
02bb8761fcce Initial load
duke
parents:
diff changeset
    77
include $(TOPDIR)/make/common/internal/Resources.gmk
02bb8761fcce Initial load
duke
parents:
diff changeset
    78
02bb8761fcce Initial load
duke
parents:
diff changeset
    79
#
02bb8761fcce Initial load
duke
parents:
diff changeset
    80
# Compiling .java files.
02bb8761fcce Initial load
duke
parents:
diff changeset
    81
#
02bb8761fcce Initial load
duke
parents:
diff changeset
    82
02bb8761fcce Initial load
duke
parents:
diff changeset
    83
#
02bb8761fcce Initial load
duke
parents:
diff changeset
    84
# Automatically add to FILES_java if AUTO_FILES_JAVA_DIRS is defined
02bb8761fcce Initial load
duke
parents:
diff changeset
    85
#
02bb8761fcce Initial load
duke
parents:
diff changeset
    86
#    There are two basic types of sources, normal source files and the
02bb8761fcce Initial load
duke
parents:
diff changeset
    87
#    generated ones. The Normal sources will be located in:
02bb8761fcce Initial load
duke
parents:
diff changeset
    88
#         $(ALL_CLASSES_SRC)
02bb8761fcce Initial load
duke
parents:
diff changeset
    89
#    The generated sources, which might show up late to dinner, are at:
02bb8761fcce Initial load
duke
parents:
diff changeset
    90
#         $(GENSRCDIR)
02bb8761fcce Initial load
duke
parents:
diff changeset
    91
#    and since they could be generated late, we need to be careful that
02bb8761fcce Initial load
duke
parents:
diff changeset
    92
#    we look for these sources late and not use the ':=' assignment which
02bb8761fcce Initial load
duke
parents:
diff changeset
    93
#    might miss their generation.
02bb8761fcce Initial load
duke
parents:
diff changeset
    94
02bb8761fcce Initial load
duke
parents:
diff changeset
    95
ifdef AUTO_FILES_JAVA_DIRS
3875
eea3f9d9076d 6883816: corba fix for missing javax/transaction/xa classes (the real fix)
ohair
parents: 3874
diff changeset
    96
  # Filter out these files or directories
eea3f9d9076d 6883816: corba fix for missing javax/transaction/xa classes (the real fix)
ohair
parents: 3874
diff changeset
    97
  AUTO_FILES_JAVA_SOURCE_FILTERS1  = $(SCM_DIRs) 'X-*' '*-X-*' '*-template.java' ',*'
eea3f9d9076d 6883816: corba fix for missing javax/transaction/xa classes (the real fix)
ohair
parents: 3874
diff changeset
    98
  AUTO_FILES_JAVA_SOURCE_FILTERS2  = 
eea3f9d9076d 6883816: corba fix for missing javax/transaction/xa classes (the real fix)
ohair
parents: 3874
diff changeset
    99
  AUTO_FILES_JAVA_SOURCE_FILTERS1 += $(AUTO_JAVA_PRUNE)
eea3f9d9076d 6883816: corba fix for missing javax/transaction/xa classes (the real fix)
ohair
parents: 3874
diff changeset
   100
  AUTO_FILES_JAVA_SOURCE_FILTERS2 += $(AUTO_JAVA_PRUNE)
4
02bb8761fcce Initial load
duke
parents:
diff changeset
   101
3875
eea3f9d9076d 6883816: corba fix for missing javax/transaction/xa classes (the real fix)
ohair
parents: 3874
diff changeset
   102
  # First list is the normal sources that should always be there,
eea3f9d9076d 6883816: corba fix for missing javax/transaction/xa classes (the real fix)
ohair
parents: 3874
diff changeset
   103
  #   by using the ':=', which means we do this processing once.
eea3f9d9076d 6883816: corba fix for missing javax/transaction/xa classes (the real fix)
ohair
parents: 3874
diff changeset
   104
  FILES_java_find_filters1 = $(AUTO_FILES_JAVA_SOURCE_FILTERS1:%=-name % -prune -o)
eea3f9d9076d 6883816: corba fix for missing javax/transaction/xa classes (the real fix)
ohair
parents: 3874
diff changeset
   105
  FILES_java_auto1 := \
eea3f9d9076d 6883816: corba fix for missing javax/transaction/xa classes (the real fix)
ohair
parents: 3874
diff changeset
   106
     $(shell \
eea3f9d9076d 6883816: corba fix for missing javax/transaction/xa classes (the real fix)
ohair
parents: 3874
diff changeset
   107
        for dir in $(ALL_CLASSES_SRC) ; do \
eea3f9d9076d 6883816: corba fix for missing javax/transaction/xa classes (the real fix)
ohair
parents: 3874
diff changeset
   108
          if [ -d $$dir ] ; then \
eea3f9d9076d 6883816: corba fix for missing javax/transaction/xa classes (the real fix)
ohair
parents: 3874
diff changeset
   109
            ( $(CD) $$dir; \
eea3f9d9076d 6883816: corba fix for missing javax/transaction/xa classes (the real fix)
ohair
parents: 3874
diff changeset
   110
              for sdir in $(AUTO_FILES_JAVA_DIRS); do \
eea3f9d9076d 6883816: corba fix for missing javax/transaction/xa classes (the real fix)
ohair
parents: 3874
diff changeset
   111
                if [ -d $$sdir ] ; then \
eea3f9d9076d 6883816: corba fix for missing javax/transaction/xa classes (the real fix)
ohair
parents: 3874
diff changeset
   112
                  $(FIND) $$sdir $(FILES_java_find_filters1) \
eea3f9d9076d 6883816: corba fix for missing javax/transaction/xa classes (the real fix)
ohair
parents: 3874
diff changeset
   113
                                 -name '*.java' -print ; \
eea3f9d9076d 6883816: corba fix for missing javax/transaction/xa classes (the real fix)
ohair
parents: 3874
diff changeset
   114
                fi ; \
eea3f9d9076d 6883816: corba fix for missing javax/transaction/xa classes (the real fix)
ohair
parents: 3874
diff changeset
   115
              done \
eea3f9d9076d 6883816: corba fix for missing javax/transaction/xa classes (the real fix)
ohair
parents: 3874
diff changeset
   116
            ); \
eea3f9d9076d 6883816: corba fix for missing javax/transaction/xa classes (the real fix)
ohair
parents: 3874
diff changeset
   117
          fi; \
eea3f9d9076d 6883816: corba fix for missing javax/transaction/xa classes (the real fix)
ohair
parents: 3874
diff changeset
   118
        done \
eea3f9d9076d 6883816: corba fix for missing javax/transaction/xa classes (the real fix)
ohair
parents: 3874
diff changeset
   119
      )
4
02bb8761fcce Initial load
duke
parents:
diff changeset
   120
  # Second list is the generated sources that should be rare, but will likely
02bb8761fcce Initial load
duke
parents:
diff changeset
   121
  #   show up late and we need to look for them at the last minute, so we
02bb8761fcce Initial load
duke
parents:
diff changeset
   122
  #   cannot use the ':=' assigment here. But if this gets expanded multiple
02bb8761fcce Initial load
duke
parents:
diff changeset
   123
  #   times, the if tests should make them relatively cheap.
3875
eea3f9d9076d 6883816: corba fix for missing javax/transaction/xa classes (the real fix)
ohair
parents: 3874
diff changeset
   124
  FILES_java_find_filters2 = $(AUTO_FILES_JAVA_SOURCE_FILTERS2:%=-name % -prune -o)
eea3f9d9076d 6883816: corba fix for missing javax/transaction/xa classes (the real fix)
ohair
parents: 3874
diff changeset
   125
  FILES_java_auto2 = \
eea3f9d9076d 6883816: corba fix for missing javax/transaction/xa classes (the real fix)
ohair
parents: 3874
diff changeset
   126
     $(shell \
eea3f9d9076d 6883816: corba fix for missing javax/transaction/xa classes (the real fix)
ohair
parents: 3874
diff changeset
   127
        for dir in $(GENSRCDIR); do \
eea3f9d9076d 6883816: corba fix for missing javax/transaction/xa classes (the real fix)
ohair
parents: 3874
diff changeset
   128
          if [ -d $$dir ] ; then \
eea3f9d9076d 6883816: corba fix for missing javax/transaction/xa classes (the real fix)
ohair
parents: 3874
diff changeset
   129
            ( $(CD) $$dir; \
eea3f9d9076d 6883816: corba fix for missing javax/transaction/xa classes (the real fix)
ohair
parents: 3874
diff changeset
   130
              for sdir in $(AUTO_FILES_JAVA_DIRS); do \
eea3f9d9076d 6883816: corba fix for missing javax/transaction/xa classes (the real fix)
ohair
parents: 3874
diff changeset
   131
                if [ -d $$sdir ] ; then \
eea3f9d9076d 6883816: corba fix for missing javax/transaction/xa classes (the real fix)
ohair
parents: 3874
diff changeset
   132
                  $(FIND) $$sdir $(FILES_java_find_filters2) \
eea3f9d9076d 6883816: corba fix for missing javax/transaction/xa classes (the real fix)
ohair
parents: 3874
diff changeset
   133
                                 -name '*.java' -print ; \
eea3f9d9076d 6883816: corba fix for missing javax/transaction/xa classes (the real fix)
ohair
parents: 3874
diff changeset
   134
                fi ; \
eea3f9d9076d 6883816: corba fix for missing javax/transaction/xa classes (the real fix)
ohair
parents: 3874
diff changeset
   135
              done \
eea3f9d9076d 6883816: corba fix for missing javax/transaction/xa classes (the real fix)
ohair
parents: 3874
diff changeset
   136
            ); \
eea3f9d9076d 6883816: corba fix for missing javax/transaction/xa classes (the real fix)
ohair
parents: 3874
diff changeset
   137
          fi; \
eea3f9d9076d 6883816: corba fix for missing javax/transaction/xa classes (the real fix)
ohair
parents: 3874
diff changeset
   138
        done \
eea3f9d9076d 6883816: corba fix for missing javax/transaction/xa classes (the real fix)
ohair
parents: 3874
diff changeset
   139
      )
4
02bb8761fcce Initial load
duke
parents:
diff changeset
   140
else
02bb8761fcce Initial load
duke
parents:
diff changeset
   141
  FILES_java_auto1 =
02bb8761fcce Initial load
duke
parents:
diff changeset
   142
  FILES_java_auto2 =
02bb8761fcce Initial load
duke
parents:
diff changeset
   143
endif
02bb8761fcce Initial load
duke
parents:
diff changeset
   144
02bb8761fcce Initial load
duke
parents:
diff changeset
   145
# Add all found java sources to FILES_java macro (if AUTO_FILES_JAVA_DIRS used)
02bb8761fcce Initial load
duke
parents:
diff changeset
   146
FILES_java += $(FILES_java_auto1) $(FILES_java_auto2)
02bb8761fcce Initial load
duke
parents:
diff changeset
   147
02bb8761fcce Initial load
duke
parents:
diff changeset
   148
# File that will hold java source names that need compiling
02bb8761fcce Initial load
duke
parents:
diff changeset
   149
JAVA_SOURCE_LIST=$(TEMPDIR)/.classes.list
02bb8761fcce Initial load
duke
parents:
diff changeset
   150
02bb8761fcce Initial load
duke
parents:
diff changeset
   151
# Add a java source to the list
02bb8761fcce Initial load
duke
parents:
diff changeset
   152
define add-java-file
02bb8761fcce Initial load
duke
parents:
diff changeset
   153
$(ECHO) "$?" >> $(JAVA_SOURCE_LIST)
02bb8761fcce Initial load
duke
parents:
diff changeset
   154
endef
02bb8761fcce Initial load
duke
parents:
diff changeset
   155
02bb8761fcce Initial load
duke
parents:
diff changeset
   156
$(CLASSDESTDIR)/%.class: $(GENSRCDIR)/%.java
02bb8761fcce Initial load
duke
parents:
diff changeset
   157
	@$(add-java-file)
02bb8761fcce Initial load
duke
parents:
diff changeset
   158
$(CLASSDESTDIR)/%.class: $(PLATFORM_SRC)/classes/%.java
02bb8761fcce Initial load
duke
parents:
diff changeset
   159
	@$(add-java-file)
02bb8761fcce Initial load
duke
parents:
diff changeset
   160
$(CLASSDESTDIR)/%.class: $(SHARE_SRC)/classes/%.java
02bb8761fcce Initial load
duke
parents:
diff changeset
   161
	@$(add-java-file)
02bb8761fcce Initial load
duke
parents:
diff changeset
   162
02bb8761fcce Initial load
duke
parents:
diff changeset
   163
# List of class files needed
02bb8761fcce Initial load
duke
parents:
diff changeset
   164
FILES_class = $(FILES_java:%.java=$(CLASSDESTDIR)/%.class)
02bb8761fcce Initial load
duke
parents:
diff changeset
   165
02bb8761fcce Initial load
duke
parents:
diff changeset
   166
# Got to include exported files.
02bb8761fcce Initial load
duke
parents:
diff changeset
   167
FILES_class += $(FILES_export:%.java=$(CLASSDESTDIR)/%.class)
02bb8761fcce Initial load
duke
parents:
diff changeset
   168
02bb8761fcce Initial load
duke
parents:
diff changeset
   169
# Construct list of java sources we need to compile
02bb8761fcce Initial load
duke
parents:
diff changeset
   170
source_list_prime:
02bb8761fcce Initial load
duke
parents:
diff changeset
   171
	@$(MKDIR) -p $(TEMPDIR)
02bb8761fcce Initial load
duke
parents:
diff changeset
   172
# Note that we slip resources in so that compiled properties files get created:
02bb8761fcce Initial load
duke
parents:
diff changeset
   173
$(JAVA_SOURCE_LIST) : source_list_prime resources $(FILES_class)
02bb8761fcce Initial load
duke
parents:
diff changeset
   174
	@$(TOUCH) $@
02bb8761fcce Initial load
duke
parents:
diff changeset
   175
02bb8761fcce Initial load
duke
parents:
diff changeset
   176
.delete.classlist:
02bb8761fcce Initial load
duke
parents:
diff changeset
   177
	@$(RM) $(JAVA_SOURCE_LIST)
02bb8761fcce Initial load
duke
parents:
diff changeset
   178
02bb8761fcce Initial load
duke
parents:
diff changeset
   179
# Make sure all newer sources are compiled (in a batch)
02bb8761fcce Initial load
duke
parents:
diff changeset
   180
classes : $(CLASSES_INIT) .delete.classlist .compile.classlist
02bb8761fcce Initial load
duke
parents:
diff changeset
   181
2199
05f4bf151242 6790292: BOOTDIR of jdk6 u12 will not work with jdk7 builds
ohair
parents: 4
diff changeset
   182
# 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
   183
#   rather than any bootclasspath classes.
05f4bf151242 6790292: BOOTDIR of jdk6 u12 will not work with jdk7 builds
ohair
parents: 4
diff changeset
   184
JAVAC_PREFER_SOURCE = -Xprefer:source
05f4bf151242 6790292: BOOTDIR of jdk6 u12 will not work with jdk7 builds
ohair
parents: 4
diff changeset
   185
4
02bb8761fcce Initial load
duke
parents:
diff changeset
   186
.compile.classlist : $(JAVA_SOURCE_LIST)
02bb8761fcce Initial load
duke
parents:
diff changeset
   187
	@$(MKDIR) -p $(CLASSDESTDIR)
3871
3d528461f61d 6875240: Reduce Makefile build time by limiting repeated exec's (mostly for cygwin building)
ohair
parents: 3291
diff changeset
   188
	if [ -s $(JAVA_SOURCE_LIST) ] ; then \
3875
eea3f9d9076d 6883816: corba fix for missing javax/transaction/xa classes (the real fix)
ohair
parents: 3874
diff changeset
   189
	  $(CAT) $(JAVA_SOURCE_LIST); \
2199
05f4bf151242 6790292: BOOTDIR of jdk6 u12 will not work with jdk7 builds
ohair
parents: 4
diff changeset
   190
	  $(JAVAC_CMD) $(JAVAC_PREFER_SOURCE) -sourcepath "$(SOURCEPATH)" -d $(CLASSDESTDIR) @$(JAVA_SOURCE_LIST); \
4
02bb8761fcce Initial load
duke
parents:
diff changeset
   191
	fi
02bb8761fcce Initial load
duke
parents:
diff changeset
   192
	@$(java-vm-cleanup)
02bb8761fcce Initial load
duke
parents:
diff changeset
   193
02bb8761fcce Initial load
duke
parents:
diff changeset
   194
clobber clean::
02bb8761fcce Initial load
duke
parents:
diff changeset
   195
	$(RM) $(JAVA_SOURCE_LIST)
02bb8761fcce Initial load
duke
parents:
diff changeset
   196
02bb8761fcce Initial load
duke
parents:
diff changeset
   197
ifndef DONT_CLOBBER_CLASSES
02bb8761fcce Initial load
duke
parents:
diff changeset
   198
  ifndef PACKAGE
02bb8761fcce Initial load
duke
parents:
diff changeset
   199
    DONT_CLOBBER_CLASSES = true
02bb8761fcce Initial load
duke
parents:
diff changeset
   200
  else
02bb8761fcce Initial load
duke
parents:
diff changeset
   201
    DONT_CLOBBER_CLASSES = false
02bb8761fcce Initial load
duke
parents:
diff changeset
   202
  endif
02bb8761fcce Initial load
duke
parents:
diff changeset
   203
endif
02bb8761fcce Initial load
duke
parents:
diff changeset
   204
02bb8761fcce Initial load
duke
parents:
diff changeset
   205
packages.clean:
02bb8761fcce Initial load
duke
parents:
diff changeset
   206
ifeq ($(DONT_CLOBBER_CLASSES),false)
02bb8761fcce Initial load
duke
parents:
diff changeset
   207
  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
   208
	$(RM) -r $(patsubst %, $(CLASSDESTDIR)/%, $(AUTO_FILES_JAVA_DIRS))
4
02bb8761fcce Initial load
duke
parents:
diff changeset
   209
  else
02bb8761fcce Initial load
duke
parents:
diff changeset
   210
	$(RM) -r $(CLASSDESTDIR)/$(PKGDIR)
02bb8761fcce Initial load
duke
parents:
diff changeset
   211
  endif
02bb8761fcce Initial load
duke
parents:
diff changeset
   212
endif
02bb8761fcce Initial load
duke
parents:
diff changeset
   213
02bb8761fcce Initial load
duke
parents:
diff changeset
   214
classes.clean: packages.clean
02bb8761fcce Initial load
duke
parents:
diff changeset
   215
	$(RM) $(JAVA_SOURCE_LIST)
02bb8761fcce Initial load
duke
parents:
diff changeset
   216
02bb8761fcce Initial load
duke
parents:
diff changeset
   217
#
02bb8761fcce Initial load
duke
parents:
diff changeset
   218
# C and C++ make dependencies
02bb8761fcce Initial load
duke
parents:
diff changeset
   219
#
02bb8761fcce Initial load
duke
parents:
diff changeset
   220
include $(TOPDIR)/make/common/internal/NativeCompileRules.gmk
02bb8761fcce Initial load
duke
parents:
diff changeset
   221
02bb8761fcce Initial load
duke
parents:
diff changeset
   222
#
02bb8761fcce Initial load
duke
parents:
diff changeset
   223
# Running Javah to generate stuff into CClassHeaders.
02bb8761fcce Initial load
duke
parents:
diff changeset
   224
#
02bb8761fcce Initial load
duke
parents:
diff changeset
   225
02bb8761fcce Initial load
duke
parents:
diff changeset
   226
ifdef FILES_export
02bb8761fcce Initial load
duke
parents:
diff changeset
   227
02bb8761fcce Initial load
duke
parents:
diff changeset
   228
CLASSES.export  = $(subst /,.,$(FILES_export:%.java=%))
02bb8761fcce Initial load
duke
parents:
diff changeset
   229
CLASSES.export += $(subst /,.,$(FILES_export2:%.java=%))
02bb8761fcce Initial load
duke
parents:
diff changeset
   230
CLASSES.export += $(subst /,.,$(FILES_export3:%.java=%))
02bb8761fcce Initial load
duke
parents:
diff changeset
   231
CLASSES_export  = $(FILES_export:%.java=$(CLASSDESTDIR)/%.class)
02bb8761fcce Initial load
duke
parents:
diff changeset
   232
CLASSES_export += $(FILES_export2:%.java=$(CLASSDESTDIR)/%.class)
02bb8761fcce Initial load
duke
parents:
diff changeset
   233
CLASSES_export += $(FILES_export3:%.java=$(CLASSDESTDIR)/%.class)
02bb8761fcce Initial load
duke
parents:
diff changeset
   234
02bb8761fcce Initial load
duke
parents:
diff changeset
   235
# Fix when deploy workspace makefiles don't depend on this name
02bb8761fcce Initial load
duke
parents:
diff changeset
   236
#CLASSHDR_DOTFILE=$(CLASSHDRDIR)/.classheaders
02bb8761fcce Initial load
duke
parents:
diff changeset
   237
02bb8761fcce Initial load
duke
parents:
diff changeset
   238
CLASSHDR_DOTFILE=$(OBJDIR)/.class.headers.$(ARCH)
02bb8761fcce Initial load
duke
parents:
diff changeset
   239
02bb8761fcce Initial load
duke
parents:
diff changeset
   240
classheaders: classes $(CLASSHDR_DOTFILE)
02bb8761fcce Initial load
duke
parents:
diff changeset
   241
02bb8761fcce Initial load
duke
parents:
diff changeset
   242
$(CLASSHDR_DOTFILE): $(CLASSES_export)
02bb8761fcce Initial load
duke
parents:
diff changeset
   243
	$(prep-target)
02bb8761fcce Initial load
duke
parents:
diff changeset
   244
	$(JAVAH_CMD) -d $(CLASSHDRDIR)/ \
02bb8761fcce Initial load
duke
parents:
diff changeset
   245
		$(CLASSES.export) $(subst $$,\$$,$(EXPORTED_inner))
02bb8761fcce Initial load
duke
parents:
diff changeset
   246
	@$(java-vm-cleanup)
02bb8761fcce Initial load
duke
parents:
diff changeset
   247
	@$(TOUCH) $@
02bb8761fcce Initial load
duke
parents:
diff changeset
   248
02bb8761fcce Initial load
duke
parents:
diff changeset
   249
classheaders.clean:
3871
3d528461f61d 6875240: Reduce Makefile build time by limiting repeated exec's (mostly for cygwin building)
ohair
parents: 3291
diff changeset
   250
	$(RM) -r $(CLASSHDRDIR) $(CLASSHDR_DOTFILE)
4
02bb8761fcce Initial load
duke
parents:
diff changeset
   251
02bb8761fcce Initial load
duke
parents:
diff changeset
   252
else # FILES_export
02bb8761fcce Initial load
duke
parents:
diff changeset
   253
02bb8761fcce Initial load
duke
parents:
diff changeset
   254
classheaders: classes
02bb8761fcce Initial load
duke
parents:
diff changeset
   255
02bb8761fcce Initial load
duke
parents:
diff changeset
   256
classheaders.clean: 
02bb8761fcce Initial load
duke
parents:
diff changeset
   257
02bb8761fcce Initial load
duke
parents:
diff changeset
   258
endif # FILES_export
02bb8761fcce Initial load
duke
parents:
diff changeset
   259
02bb8761fcce Initial load
duke
parents:
diff changeset
   260
clean clobber:: classheaders.clean classes.clean .delete.classlist
02bb8761fcce Initial load
duke
parents:
diff changeset
   261
02bb8761fcce Initial load
duke
parents:
diff changeset
   262
# 
02bb8761fcce Initial load
duke
parents:
diff changeset
   263
# Default dependencies
02bb8761fcce Initial load
duke
parents:
diff changeset
   264
#
02bb8761fcce Initial load
duke
parents:
diff changeset
   265
02bb8761fcce Initial load
duke
parents:
diff changeset
   266
all: build
02bb8761fcce Initial load
duke
parents:
diff changeset
   267
02bb8761fcce Initial load
duke
parents:
diff changeset
   268
build: classheaders
02bb8761fcce Initial load
duke
parents:
diff changeset
   269
02bb8761fcce Initial load
duke
parents:
diff changeset
   270
default: all
02bb8761fcce Initial load
duke
parents:
diff changeset
   271
02bb8761fcce Initial load
duke
parents:
diff changeset
   272
.PHONY: all build clean clobber \
02bb8761fcce Initial load
duke
parents:
diff changeset
   273
        .delete.classlist classes .compile.classlist classes.clean \
02bb8761fcce Initial load
duke
parents:
diff changeset
   274
	 classheaders classheaders.clean \
02bb8761fcce Initial load
duke
parents:
diff changeset
   275
	 batch_compile
02bb8761fcce Initial load
duke
parents:
diff changeset
   276