jdk/make/java/redist/Makefile
changeset 2 90ce3da70b43
child 1776 33e9405ab91b
equal deleted inserted replaced
0:fd16c54261b3 2:90ce3da70b43
       
     1 #
       
     2 # Copyright 1997-2007 Sun Microsystems, Inc.  All Rights Reserved.
       
     3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
       
     4 #
       
     5 # This code is free software; you can redistribute it and/or modify it
       
     6 # under the terms of the GNU General Public License version 2 only, as
       
     7 # published by the Free Software Foundation.  Sun designates this
       
     8 # particular file as subject to the "Classpath" exception as provided
       
     9 # by Sun in the LICENSE file that accompanied this code.
       
    10 #
       
    11 # This code is distributed in the hope that it will be useful, but WITHOUT
       
    12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
       
    13 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
       
    14 # version 2 for more details (a copy is included in the LICENSE file that
       
    15 # accompanied this code).
       
    16 #
       
    17 # You should have received a copy of the GNU General Public License version
       
    18 # 2 along with this work; if not, write to the Free Software Foundation,
       
    19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
       
    20 #
       
    21 # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
       
    22 # CA 95054 USA or visit www.sun.com if you need additional information or
       
    23 # have any questions.
       
    24 #
       
    25 
       
    26 #
       
    27 # Imports files exported by a hotspot build or provided from an external
       
    28 #   location into the OUTPUTDIR, and also primes the OUTPUTDIR with files
       
    29 #   that are provided inside this workspace.
       
    30 #
       
    31 # IMPORT_LIST contains the list of destination files that are copied 
       
    32 #     from external places (outside this workspace).
       
    33 #
       
    34 # INTERNAL_IMPORT_LIST is the list of destination files from BUILDDIR.
       
    35 # 
       
    36 
       
    37 BUILDDIR = ../..
       
    38 PRODUCT  = java
       
    39 include $(BUILDDIR)/common/Defs.gmk
       
    40 
       
    41 SERVER_LOCATION = server
       
    42 CLIENT_LOCATION = client
       
    43 
       
    44 DB_SUFFIX = _db
       
    45 
       
    46 ifeq ($(PLATFORM), windows)
       
    47   LIB_LOCATION = $(BINDIR)
       
    48 else
       
    49   LIB_LOCATION = $(LIBDIR)/$(LIBARCH)
       
    50 endif
       
    51 
       
    52 JVM_NAME               = $(LIB_PREFIX)jvm.$(LIBRARY_SUFFIX)
       
    53 JVMLIB_NAME            = $(LIB_PREFIX)jvm.$(LIB_SUFFIX)
       
    54 JVMMAP_NAME            = $(LIB_PREFIX)jvm.map
       
    55 JVMPDB_NAME            = $(LIB_PREFIX)jvm.pdb
       
    56 LIBJSIG_NAME           = $(LIB_PREFIX)jsig.$(LIBRARY_SUFFIX)
       
    57 JVMDB_NAME             = $(LIB_PREFIX)jvm$(DB_SUFFIX).$(LIBRARY_SUFFIX)
       
    58 
       
    59 CLASSSHARINGDATA_DIR   = $(BUILDDIR)/tools/sharing
       
    60 
       
    61 # Needed to do file copy
       
    62 ABS_BUILDDIR :=$(call FullPath,$(BUILDDIR))
       
    63 
       
    64 all: build
       
    65 
       
    66 # List of files created here or coming from BUILDDIR area (this workspace)
       
    67 INTERNAL_IMPORT_LIST = $(LIBDIR)/classlist
       
    68 
       
    69 # List of files coming from outside this workspace
       
    70 IMPORT_LIST = $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVM_NAME) \
       
    71               $(LIB_LOCATION)/$(SERVER_LOCATION)/Xusage.txt
       
    72 
       
    73 # INCLUDE_SA is false on platforms where SA is not supported.
       
    74 # On platforms where it is supported, we want to allow it to
       
    75 # not be present, at least temporarily.  So,
       
    76 # if the SA files (well, just sa-jdi.jar) do not exist 
       
    77 # in the HOTSPOT_IMPORT_PATH, then we won't build SA.
       
    78 SA_EXISTS := $(shell if [ -r $(HOTSPOT_IMPORT_PATH)/lib/sa-jdi.jar ] ; then \
       
    79                           $(ECHO) true; \
       
    80                         else \
       
    81                           $(ECHO) false; \
       
    82                         fi)
       
    83 
       
    84 ifeq ($(SA_EXISTS), false)
       
    85   INCLUDE_SA := false
       
    86 endif
       
    87 
       
    88 ifeq ($(INCLUDE_SA), true)
       
    89   IMPORT_LIST += $(LIBDIR)/sa-jdi.jar \
       
    90                  $(LIB_LOCATION)/$(SALIB_NAME)
       
    91   ifeq ($(PLATFORM), windows)
       
    92     IMPORT_LIST += $(LIB_LOCATION)/$(SAMAP_NAME) \
       
    93                    $(LIB_LOCATION)/$(SAPDB_NAME)
       
    94   endif
       
    95 endif # INCLUDE_SA
       
    96 
       
    97 # Hotspot client is only available on 32-bit builds
       
    98 ifeq ($(ARCH_DATA_MODEL), 32)
       
    99   IMPORT_LIST += $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVM_NAME) \
       
   100                  $(LIB_LOCATION)/$(CLIENT_LOCATION)/Xusage.txt
       
   101 endif
       
   102 
       
   103 ifeq ($(PLATFORM), windows)
       
   104 #  Windows     vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv  Windows
       
   105 
       
   106 IMPORT_LIST += $(MS_RUNTIME_LIBRARIES:%=$(BINDIR)/%)
       
   107 
       
   108 # NOTE: These might actually come from BUILDDIR, depends on the settings.
       
   109 $(BINDIR)/msvcrt.dll: $(MSVCRT_DLL_PATH)/msvcrt.dll
       
   110 	$(install-import-file)
       
   111 	$(CHMOD) a+x $@
       
   112 $(BINDIR)/msvcr71.dll: $(MSVCR71_DLL_PATH)/msvcr71.dll
       
   113 	$(install-import-file)
       
   114 	$(CHMOD) a+x $@
       
   115 
       
   116 # Get the hotspot .map and .pdb files for client and server
       
   117 IMPORT_LIST += \
       
   118 	$(LIBDIR)/$(JVMLIB_NAME) \
       
   119 	$(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMMAP_NAME) \
       
   120 	$(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMPDB_NAME)
       
   121 
       
   122 # Hotspot client is only available on 32-bit builds
       
   123 ifeq ($(ARCH_DATA_MODEL), 32)
       
   124   IMPORT_LIST += $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMMAP_NAME) \
       
   125                  $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMPDB_NAME)
       
   126 endif
       
   127 
       
   128 $(LIBDIR)/$(JVMLIB_NAME): $(HOTSPOT_LIB_PATH)/$(JVMLIB_NAME)
       
   129 	$(install-import-file)
       
   130 
       
   131 # it is OK for the .map and .pdb files to not exist, so do not force a 
       
   132 # dependency on them from the bootstrap location, and allow the copy to fail.
       
   133 $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMMAP_NAME):
       
   134 	@$(prep-target)
       
   135 	-$(CP) $(HOTSPOT_CLIENT_PATH)/$(JVMMAP_NAME)  $@
       
   136 
       
   137 $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMMAP_NAME):
       
   138 	@$(prep-target)
       
   139 	-$(CP) $(HOTSPOT_SERVER_PATH)/$(JVMMAP_NAME) $@
       
   140 
       
   141 $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMPDB_NAME):
       
   142 	@$(prep-target)
       
   143 	-$(CP) $(HOTSPOT_CLIENT_PATH)/$(JVMPDB_NAME)  $@
       
   144 
       
   145 $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMPDB_NAME): 
       
   146 	@$(prep-target)
       
   147 	-$(CP) $(HOTSPOT_SERVER_PATH)/$(JVMPDB_NAME) $@
       
   148 
       
   149 #  Windows     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  Windows
       
   150 else # PLATFORM
       
   151 #  NOT Windows vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv  NOT Windows
       
   152 
       
   153 IMPORT_LIST += \
       
   154         $(LIB_LOCATION)/$(LIBJSIG_NAME) \
       
   155 	$(LIB_LOCATION)/$(SERVER_LOCATION)/$(LIBJSIG_NAME)
       
   156 
       
   157 ifeq ($(PLATFORM), solaris)
       
   158   IMPORT_LIST += $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMDB_NAME)
       
   159 endif 
       
   160 
       
   161 ifeq ($(ARCH_DATA_MODEL), 32)
       
   162 
       
   163 IMPORT_LIST += $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(LIBJSIG_NAME)
       
   164 
       
   165 ifeq ($(PLATFORM), solaris)
       
   166 #  solaris   vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv  solaris
       
   167 
       
   168 ifeq ($(ARCH), sparc)
       
   169   IMPORT_LIST += $(LIB_LOCATION)/$(SERVER_LOCATION)/64/$(JVMDB_NAME)
       
   170 endif
       
   171 
       
   172 IMPORT_LIST += $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMDB_NAME)
       
   173 
       
   174 ifeq ($(ARCH), sparc)
       
   175   IMPORT_LIST += $(LIB_LOCATION)/$(CLIENT_LOCATION)/64/$(JVMDB_NAME)
       
   176 endif
       
   177 
       
   178 # For backwards compatability, make a link of the 32-bit client JVM to $(LIBDIR)
       
   179 IMPORT_LIST += $(LIB_LOCATION)/$(JVM_NAME)
       
   180 
       
   181 # create a link from lib/libjvm.so to client/libjvm.so
       
   182 $(LIB_LOCATION)/$(JVM_NAME): $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVM_NAME)
       
   183 	@$(prep-target)
       
   184 	$(LN) -s $(CLIENT_LOCATION)/$(JVM_NAME) $@
       
   185 
       
   186 #  solaris   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ solaris
       
   187 endif # 32bit solaris
       
   188 
       
   189 endif # 32bit
       
   190 
       
   191 #  NOT Windows ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ NOT Windows
       
   192 
       
   193 endif # PLATFORM
       
   194 
       
   195 $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVM_NAME): $(HOTSPOT_CLIENT_PATH)/$(JVM_NAME)
       
   196 	$(install-import-file)
       
   197 
       
   198 $(LIB_LOCATION)/$(LIBJSIG_NAME): $(HOTSPOT_SERVER_PATH)/$(LIBJSIG_NAME)
       
   199 	$(install-import-file)
       
   200 
       
   201 $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(LIBJSIG_NAME) \
       
   202 $(LIB_LOCATION)/$(SERVER_LOCATION)/$(LIBJSIG_NAME):
       
   203 	@$(prep-target)
       
   204 	$(LN) -s ../$(LIBJSIG_NAME) $@
       
   205 
       
   206 $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMDB_NAME): $(HOTSPOT_CLIENT_PATH)/$(JVMDB_NAME)
       
   207 	$(install-import-file)
       
   208 
       
   209 $(LIB_LOCATION)/$(CLIENT_LOCATION)/64/$(JVMDB_NAME): $(HOTSPOT_CLIENT_PATH)/64/$(JVMDB_NAME)
       
   210 	$(install-import-file)
       
   211 
       
   212 $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMDB_NAME): $(HOTSPOT_SERVER_PATH)/$(JVMDB_NAME)
       
   213 	$(install-import-file)
       
   214 
       
   215 $(LIB_LOCATION)/$(SERVER_LOCATION)/64/$(JVMDB_NAME): $(HOTSPOT_SERVER_PATH)/64/$(JVMDB_NAME)
       
   216 	$(install-import-file)
       
   217 
       
   218 $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVM_NAME): $(HOTSPOT_SERVER_PATH)/$(JVM_NAME)
       
   219 	$(install-import-file)
       
   220 
       
   221 $(LIB_LOCATION)/$(SERVER_LOCATION)/Xusage.txt : $(HOTSPOT_SERVER_PATH)/Xusage.txt
       
   222 	$(install-import-file)
       
   223 
       
   224 $(LIB_LOCATION)/$(CLIENT_LOCATION)/Xusage.txt : $(HOTSPOT_CLIENT_PATH)/Xusage.txt
       
   225 	$(install-import-file)
       
   226 
       
   227 ifeq ($(INCLUDE_SA), true)
       
   228 # The Serviceability Agent is built in the Hotspot workspace.
       
   229 # It contains two files:
       
   230 #  - sa-jdi.jar:  This goes into the same dir as tools.jar.
       
   231 #  - a shared library:  sawindbg.dll on windows / libproc.sa on unix
       
   232 #		        This goes into the same dir as the other
       
   233 #			shared libs, eg. libjdwp.so.
       
   234 $(LIBDIR)/sa-jdi.jar: $(HOTSPOT_IMPORT_PATH)/lib/sa-jdi.jar
       
   235 	$(install-import-file)
       
   236 
       
   237 $(LIB_LOCATION)/$(SALIB_NAME): $(HOTSPOT_SALIB_PATH)/$(SALIB_NAME)
       
   238 	$(install-import-file)
       
   239 
       
   240 ifeq ($(PLATFORM), windows)
       
   241 $(LIB_LOCATION)/$(SAPDB_NAME): $(HOTSPOT_SALIB_PATH)/$(SAPDB_NAME)
       
   242 	$(install-import-file)
       
   243 
       
   244 $(LIB_LOCATION)/$(SAMAP_NAME): $(HOTSPOT_SALIB_PATH)/$(SAMAP_NAME)
       
   245 	$(install-import-file)
       
   246 endif # windows
       
   247 endif # INCLUDE_SA
       
   248 
       
   249 #
       
   250 # Specific to OpenJDK building
       
   251 #
       
   252 ifdef OPENJDK
       
   253 
       
   254 include $(BUILDDIR)/common/internal/BinaryPlugs.gmk
       
   255 
       
   256 build: import-binary-plugs
       
   257 
       
   258 else # !OPENJDK
       
   259 
       
   260 INTERNAL_IMPORT_LIST += \
       
   261             $(LIBDIR)/security/US_export_policy.jar \
       
   262             $(LIBDIR)/security/local_policy.jar \
       
   263             $(LIBDIR)/jce.jar
       
   264 
       
   265 $(LIBDIR)/jce.jar: \
       
   266 	    $(BUILDDIR)/closed/tools/crypto/jce/jce.jar
       
   267 	$(install-file)
       
   268 $(LIBDIR)/security/US_export_policy.jar: \
       
   269 	    $(BUILDDIR)/closed/tools/crypto/jce/US_export_policy.jar
       
   270 	$(install-file)
       
   271 $(LIBDIR)/security/local_policy.jar: \
       
   272 	    $(BUILDDIR)/closed/tools/crypto/jce/local_policy.jar
       
   273 	$(install-file)
       
   274 
       
   275 endif # OPENJDK
       
   276 
       
   277 ADDJSUM_JARFILE = $(BUILDTOOLJARDIR)/addjsum.jar
       
   278 
       
   279 # Construct classlist file
       
   280 $(LIBDIR)/classlist: \
       
   281     $(CLASSSHARINGDATA_DIR)/classlist.$(PLATFORM) \
       
   282     $(ADDJSUM_JARFILE)
       
   283 	@$(prep-target)
       
   284 	@$(RM) -f $@.temp
       
   285 	$(BOOT_JAVA_CMD) -jar $(ADDJSUM_JARFILE) \
       
   286 	    $(CLASSSHARINGDATA_DIR)/classlist.$(PLATFORM) $@.temp
       
   287 	$(MV) $@.temp $@
       
   288 
       
   289 ifndef OPENJDK
       
   290 
       
   291 # Lucida font files are not included in the OpenJDK distribution.
       
   292 # Get names of font files
       
   293 include FILES.gmk
       
   294 
       
   295 # Copy font files into OUTPUTDIR area
       
   296 
       
   297 FONTFILES = $(SHARED_FONTFILES)
       
   298 FONTSDIR  = $(LIBDIR)/fonts
       
   299 FONTSDIRFILE  = $(FONTSDIR)/fonts.dir
       
   300 INTERNAL_IMPORT_LIST += $(FONTFILES) 
       
   301 
       
   302 ifneq ($(PLATFORM), windows)
       
   303   INTERNAL_IMPORT_LIST += $(FONTSDIRFILE)
       
   304 endif
       
   305 
       
   306 $(LIBDIR)/fonts/%.ttf: $(CLOSED_SRC)/share/lib/fonts/%.ttf
       
   307 	$(install-file)
       
   308 
       
   309 $(FONTSDIRFILE): $(PLATFORM_SRC)/classes/sun/awt/motif/java.fonts.dir
       
   310 	$(install-file)
       
   311 
       
   312 ifeq ($(PLATFORM), linux)
       
   313 
       
   314 # The oblique fonts are only needed/wanted on Linux.
       
   315 
       
   316 OBLFONTSDIR  = $(LIBDIR)/oblique-fonts
       
   317 OBLFONTSDIRFILE	 = $(OBLFONTSDIR)/fonts.dir
       
   318 INTERNAL_IMPORT_LIST += $(OBLIQUE_FONTFILES) $(OBLFONTSDIRFILE)
       
   319 
       
   320 $(LIBDIR)/oblique-fonts/%.ttf: $(CLOSED_SRC)/share/lib/fonts/oblique/%.ttf
       
   321 	$(install-file)
       
   322 
       
   323 $(OBLFONTSDIRFILE): $(PLATFORM_SRC)/classes/sun/awt/motif/java.oblique-fonts.dir
       
   324 	$(install-file)
       
   325 
       
   326 endif # linux
       
   327 endif # !OPENJDK
       
   328 
       
   329 # Import internal files (ones that are stashed in this source tree)
       
   330 import_internal_files : $(INTERNAL_IMPORT_LIST)
       
   331 
       
   332 # Import files from the JDK that we are not building
       
   333 import_files: $(IMPORT_LIST)
       
   334 
       
   335 # Get component information variables and rules
       
   336 include $(BUILDDIR)/common/internal/ImportComponents.gmk
       
   337 
       
   338 # Security files we need to import
       
   339 SEC_FILES_ZIP=$(ABS_BUILDDIR)/tools/crypto/sec-bin.zip
       
   340 SEC_FILES_WIN_ZIP=$(ABS_BUILDDIR)/tools/crypto/sec-windows-bin.zip
       
   341 JGSS_WIN32_FILES_ZIP=$(ABS_BUILDDIR)/tools/crypto/jgss-windows-i586-bin.zip
       
   342 JGSS_WIN64_FILES_ZIP=$(ABS_BUILDDIR)/tools/crypto/jgss-windows-x64-bin.zip
       
   343 
       
   344 # Unzip zip file $2 into directory $1 (if $2 exists)
       
   345 #   Warning: $2 must be absolute path not relative
       
   346 define SecUnzipper
       
   347 if [ -f $2 ] ; then \
       
   348   $(MKDIR) -p $1; \
       
   349   $(ECHO) "( $(CD) $1 && $(UNZIP) -o $2 )"; \
       
   350   ( $(CD) $1 && $(UNZIP) -o $2 ); \
       
   351 fi
       
   352 endef
       
   353 
       
   354 # If sec-bin exists, unpack it into the build directory
       
   355 #   Also, the library recompile build indirectly depends on two SSL classes,
       
   356 #   so copy those as well   FIXUP
       
   357 #   if sec-windows-bin exists, unpack it into the build directory
       
   358 #   if JGSS files exists, unpack it into the build directory
       
   359 $(TEMPDIR)/security_imported:
       
   360 	@$(prep-target)
       
   361 	@$(call SecUnzipper,$(OUTPUTDIR),$(SEC_FILES_ZIP))
       
   362 ifeq ($(PLATFORM), windows)
       
   363 	@$(call SecUnzipper,$(OUTPUTDIR),$(SEC_FILES_WIN_ZIP))
       
   364 endif
       
   365 ifeq ($(PLATFORM), windows)
       
   366     ifeq ($(ARCH_DATA_MODEL), 32)
       
   367 	@$(call SecUnzipper,$(OUTPUTDIR),$(JGSS_WIN32_FILES_ZIP))
       
   368     else
       
   369 	@$(call SecUnzipper,$(OUTPUTDIR),$(JGSS_WIN64_FILES_ZIP))
       
   370     endif
       
   371 endif
       
   372 	@$(ECHO) "Imported on `$(DATE)`" > $@
       
   373 
       
   374 # Import all files from other components
       
   375 $(TEMPDIR)/components_imported:
       
   376 	@$(prep-target)
       
   377 	$(call import-component-binaries,$(ABS_OUTPUTDIR))
       
   378 	$(call import-component-sources,$(IMPORTSRCDIR))
       
   379 	$(call import-component-docs,$(IMPORTDOCDIR))
       
   380 	$(call import-component-classes,$(CLASSDESTDIR))
       
   381 	@$(ECHO) "Imported on `$(DATE)`" > $@
       
   382 
       
   383 # Do pretty much everything
       
   384 build : import_files \
       
   385 	import_internal_files \
       
   386 	$(TEMPDIR)/components_imported \
       
   387 	$(TEMPDIR)/security_imported
       
   388 
       
   389 # Clean up what we imported (except for component files)
       
   390 clean clobber::
       
   391 	$(RM) $(IMPORT_LIST)
       
   392 	$(RM) $(INTERNAL_IMPORT_LIST)
       
   393 	$(call import-component-sources-clean,$(IMPORTSRCDIR))
       
   394 	$(call import-component-docs-clean,$(IMPORTDOCDIR))
       
   395 	$(call import-component-classes-clean,$(CLASSDESTDIR))
       
   396 	$(RM) $(TEMPDIR)/components_imported
       
   397 	$(RM) $(TEMPDIR)/security_imported
       
   398 
       
   399 .PHONY: import_files import_internal_files
       
   400