Fri, 28 May 2010 10:40:17 -0700
6956930: Remove unused OS_VENDOR make variable
Reviewed-by: trims
duke@1 | 1 | # |
ohair@158 | 2 | # Copyright (c) 1995, 2009, Oracle and/or its affiliates. All rights reserved. |
duke@1 | 3 | # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
duke@1 | 4 | # |
duke@1 | 5 | # This code is free software; you can redistribute it and/or modify it |
duke@1 | 6 | # under the terms of the GNU General Public License version 2 only, as |
ohair@158 | 7 | # published by the Free Software Foundation. Oracle designates this |
duke@1 | 8 | # particular file as subject to the "Classpath" exception as provided |
ohair@158 | 9 | # by Oracle in the LICENSE file that accompanied this code. |
duke@1 | 10 | # |
duke@1 | 11 | # This code is distributed in the hope that it will be useful, but WITHOUT |
duke@1 | 12 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
duke@1 | 13 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
duke@1 | 14 | # version 2 for more details (a copy is included in the LICENSE file that |
duke@1 | 15 | # accompanied this code). |
duke@1 | 16 | # |
duke@1 | 17 | # You should have received a copy of the GNU General Public License version |
duke@1 | 18 | # 2 along with this work; if not, write to the Free Software Foundation, |
duke@1 | 19 | # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
duke@1 | 20 | # |
ohair@158 | 21 | # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
ohair@158 | 22 | # or visit www.oracle.com if you need additional information or have any |
ohair@158 | 23 | # questions. |
duke@1 | 24 | # |
duke@1 | 25 | |
duke@1 | 26 | # |
duke@1 | 27 | # |
duke@1 | 28 | # Rules shared by all Java makefiles. |
duke@1 | 29 | # |
ohair@114 | 30 | |
duke@1 | 31 | # Make sure the default rule is all |
duke@1 | 32 | rules_default_rule: all |
duke@1 | 33 | |
duke@1 | 34 | # |
duke@1 | 35 | # Directory set up. (Needed by deploy workspace) |
duke@1 | 36 | # |
duke@1 | 37 | $(CLASSDESTDIR) $(CLASSHDRDIR) $(OBJDIR) $(OUTPUTDIR) $(BINDIR) $(LIBDIR) $(LIBDIR)/$(LIBARCH) $(TEMPDIR) $(EXTDIR): |
duke@1 | 38 | $(MKDIR) -p $@ |
duke@1 | 39 | |
duke@1 | 40 | # |
duke@1 | 41 | # All source tree areas for java/properties files |
duke@1 | 42 | # |
duke@1 | 43 | ALL_CLASSES_SRC = $(SHARE_SRC)/classes $(PLATFORM_SRC)/classes |
duke@1 | 44 | |
duke@1 | 45 | # |
duke@1 | 46 | # If AUTO_FILES_PROPERTIES_DIRS used, automatically find properties files |
duke@1 | 47 | # |
duke@1 | 48 | ifdef AUTO_FILES_PROPERTIES_DIRS |
ohair@118 | 49 | AUTO_FILES_PROPERTIES_FILTERS1 = $(SCM_DIRs) 'X-*' '*-X-*' ',*' |
ohair@118 | 50 | AUTO_FILES_PROPERTIES_FILTERS1 += $(AUTO_PROPERTIES_PRUNE) |
ohair@118 | 51 | FILES_properties_find_filters1 = $(AUTO_FILES_PROPERTIES_FILTERS1:%=-name % -prune -o) |
ohair@118 | 52 | FILES_properties_auto1 := \ |
ohair@118 | 53 | $(shell \ |
ohair@118 | 54 | for dir in $(ALL_CLASSES_SRC) ; do \ |
ohair@118 | 55 | if [ -d $$dir ] ; then \ |
ohair@118 | 56 | ( $(CD) $$dir; \ |
ohair@118 | 57 | for sdir in $(AUTO_FILES_PROPERTIES_DIRS); do \ |
ohair@118 | 58 | if [ -d $$sdir ] ; then \ |
ohair@118 | 59 | $(FIND) $$sdir $(FILES_properties_find_filters1) \ |
ohair@118 | 60 | -name '*.properties' -print ; \ |
ohair@118 | 61 | fi ; \ |
ohair@118 | 62 | done \ |
ohair@118 | 63 | ); \ |
ohair@118 | 64 | fi; \ |
ohair@118 | 65 | done \ |
ohair@118 | 66 | ) |
duke@1 | 67 | else |
duke@1 | 68 | FILES_properties_auto1 = |
duke@1 | 69 | endif # AUTO_FILES_PROPERTIES_DIRS |
duke@1 | 70 | |
duke@1 | 71 | # Add any automatically found properties files to the properties file list |
duke@1 | 72 | FILES_properties += $(FILES_properties_auto1) |
duke@1 | 73 | |
duke@1 | 74 | # |
duke@1 | 75 | # Get Resources help |
duke@1 | 76 | # |
duke@1 | 77 | include $(TOPDIR)/make/common/internal/Resources.gmk |
duke@1 | 78 | |
duke@1 | 79 | # |
duke@1 | 80 | # Compiling .java files. |
duke@1 | 81 | # |
duke@1 | 82 | |
duke@1 | 83 | # |
duke@1 | 84 | # Automatically add to FILES_java if AUTO_FILES_JAVA_DIRS is defined |
duke@1 | 85 | # |
duke@1 | 86 | # There are two basic types of sources, normal source files and the |
duke@1 | 87 | # generated ones. The Normal sources will be located in: |
duke@1 | 88 | # $(ALL_CLASSES_SRC) |
duke@1 | 89 | # The generated sources, which might show up late to dinner, are at: |
duke@1 | 90 | # $(GENSRCDIR) |
duke@1 | 91 | # and since they could be generated late, we need to be careful that |
duke@1 | 92 | # we look for these sources late and not use the ':=' assignment which |
duke@1 | 93 | # might miss their generation. |
duke@1 | 94 | |
duke@1 | 95 | ifdef AUTO_FILES_JAVA_DIRS |
ohair@118 | 96 | # Filter out these files or directories |
ohair@118 | 97 | AUTO_FILES_JAVA_SOURCE_FILTERS1 = $(SCM_DIRs) 'X-*' '*-X-*' '*-template.java' ',*' |
ohair@118 | 98 | AUTO_FILES_JAVA_SOURCE_FILTERS2 = |
ohair@118 | 99 | AUTO_FILES_JAVA_SOURCE_FILTERS1 += $(AUTO_JAVA_PRUNE) |
ohair@118 | 100 | AUTO_FILES_JAVA_SOURCE_FILTERS2 += $(AUTO_JAVA_PRUNE) |
duke@1 | 101 | |
ohair@118 | 102 | # First list is the normal sources that should always be there, |
ohair@118 | 103 | # by using the ':=', which means we do this processing once. |
ohair@118 | 104 | FILES_java_find_filters1 = $(AUTO_FILES_JAVA_SOURCE_FILTERS1:%=-name % -prune -o) |
ohair@118 | 105 | FILES_java_auto1 := \ |
ohair@118 | 106 | $(shell \ |
ohair@118 | 107 | for dir in $(ALL_CLASSES_SRC) ; do \ |
ohair@118 | 108 | if [ -d $$dir ] ; then \ |
ohair@118 | 109 | ( $(CD) $$dir; \ |
ohair@118 | 110 | for sdir in $(AUTO_FILES_JAVA_DIRS); do \ |
ohair@118 | 111 | if [ -d $$sdir ] ; then \ |
ohair@118 | 112 | $(FIND) $$sdir $(FILES_java_find_filters1) \ |
ohair@118 | 113 | -name '*.java' -print ; \ |
ohair@118 | 114 | fi ; \ |
ohair@118 | 115 | done \ |
ohair@118 | 116 | ); \ |
ohair@118 | 117 | fi; \ |
ohair@118 | 118 | done \ |
ohair@118 | 119 | ) |
duke@1 | 120 | # Second list is the generated sources that should be rare, but will likely |
duke@1 | 121 | # show up late and we need to look for them at the last minute, so we |
duke@1 | 122 | # cannot use the ':=' assigment here. But if this gets expanded multiple |
duke@1 | 123 | # times, the if tests should make them relatively cheap. |
ohair@118 | 124 | FILES_java_find_filters2 = $(AUTO_FILES_JAVA_SOURCE_FILTERS2:%=-name % -prune -o) |
ohair@118 | 125 | FILES_java_auto2 = \ |
ohair@118 | 126 | $(shell \ |
ohair@118 | 127 | for dir in $(GENSRCDIR); do \ |
ohair@118 | 128 | if [ -d $$dir ] ; then \ |
ohair@118 | 129 | ( $(CD) $$dir; \ |
ohair@118 | 130 | for sdir in $(AUTO_FILES_JAVA_DIRS); do \ |
ohair@118 | 131 | if [ -d $$sdir ] ; then \ |
ohair@118 | 132 | $(FIND) $$sdir $(FILES_java_find_filters2) \ |
ohair@118 | 133 | -name '*.java' -print ; \ |
ohair@118 | 134 | fi ; \ |
ohair@118 | 135 | done \ |
ohair@118 | 136 | ); \ |
ohair@118 | 137 | fi; \ |
ohair@118 | 138 | done \ |
ohair@118 | 139 | ) |
duke@1 | 140 | else |
duke@1 | 141 | FILES_java_auto1 = |
duke@1 | 142 | FILES_java_auto2 = |
duke@1 | 143 | endif |
duke@1 | 144 | |
duke@1 | 145 | # Add all found java sources to FILES_java macro (if AUTO_FILES_JAVA_DIRS used) |
duke@1 | 146 | FILES_java += $(FILES_java_auto1) $(FILES_java_auto2) |
duke@1 | 147 | |
duke@1 | 148 | # File that will hold java source names that need compiling |
duke@1 | 149 | JAVA_SOURCE_LIST=$(TEMPDIR)/.classes.list |
duke@1 | 150 | |
duke@1 | 151 | # Add a java source to the list |
duke@1 | 152 | define add-java-file |
duke@1 | 153 | $(ECHO) "$?" >> $(JAVA_SOURCE_LIST) |
duke@1 | 154 | endef |
duke@1 | 155 | |
duke@1 | 156 | $(CLASSDESTDIR)/%.class: $(GENSRCDIR)/%.java |
duke@1 | 157 | @$(add-java-file) |
duke@1 | 158 | $(CLASSDESTDIR)/%.class: $(PLATFORM_SRC)/classes/%.java |
duke@1 | 159 | @$(add-java-file) |
duke@1 | 160 | $(CLASSDESTDIR)/%.class: $(SHARE_SRC)/classes/%.java |
duke@1 | 161 | @$(add-java-file) |
duke@1 | 162 | |
duke@1 | 163 | # List of class files needed |
duke@1 | 164 | FILES_class = $(FILES_java:%.java=$(CLASSDESTDIR)/%.class) |
duke@1 | 165 | |
duke@1 | 166 | # Got to include exported files. |
duke@1 | 167 | FILES_class += $(FILES_export:%.java=$(CLASSDESTDIR)/%.class) |
duke@1 | 168 | |
duke@1 | 169 | # Construct list of java sources we need to compile |
duke@1 | 170 | source_list_prime: |
duke@1 | 171 | @$(MKDIR) -p $(TEMPDIR) |
duke@1 | 172 | # Note that we slip resources in so that compiled properties files get created: |
duke@1 | 173 | $(JAVA_SOURCE_LIST) : source_list_prime resources $(FILES_class) |
duke@1 | 174 | @$(TOUCH) $@ |
duke@1 | 175 | |
duke@1 | 176 | .delete.classlist: |
duke@1 | 177 | @$(RM) $(JAVA_SOURCE_LIST) |
duke@1 | 178 | |
duke@1 | 179 | # Make sure all newer sources are compiled (in a batch) |
duke@1 | 180 | classes : $(CLASSES_INIT) .delete.classlist .compile.classlist |
duke@1 | 181 | |
ohair@56 | 182 | # Use this javac option to force it to favor the sourcepath file classes |
ohair@56 | 183 | # rather than any bootclasspath classes. |
ohair@56 | 184 | JAVAC_PREFER_SOURCE = -Xprefer:source |
ohair@56 | 185 | |
duke@1 | 186 | .compile.classlist : $(JAVA_SOURCE_LIST) |
duke@1 | 187 | @$(MKDIR) -p $(CLASSDESTDIR) |
ohair@114 | 188 | if [ -s $(JAVA_SOURCE_LIST) ] ; then \ |
ohair@118 | 189 | $(CAT) $(JAVA_SOURCE_LIST); \ |
ohair@56 | 190 | $(JAVAC_CMD) $(JAVAC_PREFER_SOURCE) -sourcepath "$(SOURCEPATH)" -d $(CLASSDESTDIR) @$(JAVA_SOURCE_LIST); \ |
duke@1 | 191 | fi |
duke@1 | 192 | @$(java-vm-cleanup) |
duke@1 | 193 | |
duke@1 | 194 | clobber clean:: |
duke@1 | 195 | $(RM) $(JAVA_SOURCE_LIST) |
duke@1 | 196 | |
duke@1 | 197 | ifndef DONT_CLOBBER_CLASSES |
duke@1 | 198 | ifndef PACKAGE |
duke@1 | 199 | DONT_CLOBBER_CLASSES = true |
duke@1 | 200 | else |
duke@1 | 201 | DONT_CLOBBER_CLASSES = false |
duke@1 | 202 | endif |
duke@1 | 203 | endif |
duke@1 | 204 | |
duke@1 | 205 | packages.clean: |
duke@1 | 206 | ifeq ($(DONT_CLOBBER_CLASSES),false) |
duke@1 | 207 | ifdef AUTO_FILES_JAVA_DIRS |
ohair@114 | 208 | $(RM) -r $(patsubst %, $(CLASSDESTDIR)/%, $(AUTO_FILES_JAVA_DIRS)) |
duke@1 | 209 | else |
duke@1 | 210 | $(RM) -r $(CLASSDESTDIR)/$(PKGDIR) |
duke@1 | 211 | endif |
duke@1 | 212 | endif |
duke@1 | 213 | |
duke@1 | 214 | classes.clean: packages.clean |
duke@1 | 215 | $(RM) $(JAVA_SOURCE_LIST) |
duke@1 | 216 | |
duke@1 | 217 | # |
duke@1 | 218 | # C and C++ make dependencies |
duke@1 | 219 | # |
duke@1 | 220 | include $(TOPDIR)/make/common/internal/NativeCompileRules.gmk |
duke@1 | 221 | |
duke@1 | 222 | # |
duke@1 | 223 | # Running Javah to generate stuff into CClassHeaders. |
duke@1 | 224 | # |
duke@1 | 225 | |
duke@1 | 226 | ifdef FILES_export |
duke@1 | 227 | |
duke@1 | 228 | CLASSES.export = $(subst /,.,$(FILES_export:%.java=%)) |
duke@1 | 229 | CLASSES.export += $(subst /,.,$(FILES_export2:%.java=%)) |
duke@1 | 230 | CLASSES.export += $(subst /,.,$(FILES_export3:%.java=%)) |
duke@1 | 231 | CLASSES_export = $(FILES_export:%.java=$(CLASSDESTDIR)/%.class) |
duke@1 | 232 | CLASSES_export += $(FILES_export2:%.java=$(CLASSDESTDIR)/%.class) |
duke@1 | 233 | CLASSES_export += $(FILES_export3:%.java=$(CLASSDESTDIR)/%.class) |
duke@1 | 234 | |
duke@1 | 235 | # Fix when deploy workspace makefiles don't depend on this name |
duke@1 | 236 | #CLASSHDR_DOTFILE=$(CLASSHDRDIR)/.classheaders |
duke@1 | 237 | |
duke@1 | 238 | CLASSHDR_DOTFILE=$(OBJDIR)/.class.headers.$(ARCH) |
duke@1 | 239 | |
duke@1 | 240 | classheaders: classes $(CLASSHDR_DOTFILE) |
duke@1 | 241 | |
duke@1 | 242 | $(CLASSHDR_DOTFILE): $(CLASSES_export) |
duke@1 | 243 | $(prep-target) |
duke@1 | 244 | $(JAVAH_CMD) -d $(CLASSHDRDIR)/ \ |
duke@1 | 245 | $(CLASSES.export) $(subst $$,\$$,$(EXPORTED_inner)) |
duke@1 | 246 | @$(java-vm-cleanup) |
duke@1 | 247 | @$(TOUCH) $@ |
duke@1 | 248 | |
duke@1 | 249 | classheaders.clean: |
ohair@114 | 250 | $(RM) -r $(CLASSHDRDIR) $(CLASSHDR_DOTFILE) |
duke@1 | 251 | |
duke@1 | 252 | else # FILES_export |
duke@1 | 253 | |
duke@1 | 254 | classheaders: classes |
duke@1 | 255 | |
duke@1 | 256 | classheaders.clean: |
duke@1 | 257 | |
duke@1 | 258 | endif # FILES_export |
duke@1 | 259 | |
duke@1 | 260 | clean clobber:: classheaders.clean classes.clean .delete.classlist |
duke@1 | 261 | |
duke@1 | 262 | # |
duke@1 | 263 | # Default dependencies |
duke@1 | 264 | # |
duke@1 | 265 | |
duke@1 | 266 | all: build |
duke@1 | 267 | |
duke@1 | 268 | build: classheaders |
duke@1 | 269 | |
duke@1 | 270 | default: all |
duke@1 | 271 | |
duke@1 | 272 | .PHONY: all build clean clobber \ |
duke@1 | 273 | .delete.classlist classes .compile.classlist classes.clean \ |
duke@1 | 274 | classheaders classheaders.clean \ |
duke@1 | 275 | batch_compile |
duke@1 | 276 |