1 #
   2 # Copyright 2010 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 # Variables for modules build
  28 #
  29 
  30 # jdk modules generated from make/modules/Makefile
  31 # - this combines one or more submodules
  32 MODULEPATH_DIR         = $(OUTPUTDIR)/modules
  33 ABS_MODULEPATH_DIR     = $(ABS_OUTPUTDIR)/modules
  34 
  35 # Submodules
  36 # Files are copied to its own MODULE during the jdk builds
  37 SUBMODULES_DIR      = $(OUTPUTDIR)/submodules
  38 ABS_SUBMODULES_DIR  = $(ABS_OUTPUTDIR)/submodules
  39 
  40 
  41 # genmoduleslist - files generated from make/modules/Makefile
  42 MODULEINFO_DIR = $(OUTPUTDIR)/moduleinfo
  43 ABS_MODULEINFO_DIR = $(ABS_OUTPUTDIR)/moduleinfo
  44 MODULEINFO_SRC = $(MODULEINFO_DIR)/src
  45 
  46 MODULE_CLASSLIST_DIR = $(ABS_MODULEINFO_DIR)/classlist
  47 MODULES_LIST = $(MODULE_CLASSLIST_DIR)/modules.list
  48 
  49 # Temporary files
  50 MODULES_TEMPDIR     = $(OUTPUTDIR)/tmp/modules
  51 ABS_MODULES_TEMPDIR = $(ABS_OUTPUTDIR)/tmp/modules
  52 
  53 # incremental build marker file
  54 MODULES_UPDATE_MARKER = $(SUBMODULES_DIR)/.modules.update
  55 
  56 # Information for building platform modules
  57 BASE_MODULE = jdk.base
  58 JIGSAW_MODULE_LIB = $(ABS_OUTPUTDIR)/lib/modules
  59 
  60 # RELEASE is JDK_VERSION and -MILESTONE if MILESTONE is set
  61 ifneq ($(MILESTONE),fcs)
  62   MODULE_VERSION = ${JDK_MINOR_VERSION}-ea
  63 else
  64   MODULE_VERSION = ${JDK_MINOR_VERSION}
  65 endif
  66 
  67 # Modules for imports
  68 CORBA_MODULE             = jdk.corba
  69 JTA_MODULE               = jdk.jta
  70 XML_MODULE               = jdk.jaxp
  71 XERCES_MODULE            = jdk.jaxp
  72 XALAN_MODULE             = jdk.jaxp
  73 JAXWS_MODULE             = jdk.jaxws
  74 JX_ANNOTATION_MODULE     = jdk.jx.annotations
  75 RMIC_MODULE              = jdk.tools
  76 COMPILER_MODULE          = jdk.compiler
  77 JAVAC_MODULE             = jdk.devtools
  78 JAVAP_MODULE             = jdk.devtools
  79 JAVAH_MODULE             = jdk.devtools
  80 JAVADOC_MODULE           = jdk.devtools
  81 APT_MODULE               = jdk.apt
  82 MIRROR_MODULE            = jdk.mirror
  83 
  84 # idlj is grouped with the corba runtime
  85 IDLJ_MODULE              = jdk.corba
  86 
  87 JDK_BASE_MODULE          = jdk.base
  88 BASE_TOOLS_MODULE        = jdk.tools.base
  89 JRE_TOOLS_MODULE         = jdk.tools.jre
  90 TOOLS_MODULE             = jdk.tools
  91 JAXWS_TOOLS_MODULE       = jdk.tools.jaxws
  92 CORBA_TOOLS_MODULE       = jdk.corba
  93 RMI_TOOLS_MODULE         = jdk.rmi
  94 KERBEROS_TOOLS_MODULE    = jdk.kerberos
  95 
  96 
  97 # Modules for JDK only
  98 JDK_MODULES = $(MODULE_CLASSLIST_DIR)/jdk.modules.list
  99 JRE_MODULES = $(MODULE_CLASSLIST_DIR)/jdk.jre.modules.list
 100 JDK_BASE_MODULES = $(MODULE_CLASSLIST_DIR)/$(BASE_TOOLS_MODULE).modules.list
 101 JRE_BASE_MODULES = $(MODULE_CLASSLIST_DIR)/$(JDK_BASE_MODULE).modules.list
 102 
 103 #
 104 # Build units may or may not define MODULE.  Default to "other".
 105 #
 106 # MODULE variable defines the lowest-level module name that
 107 # might or might not be the name of the modules created in
 108 # the modules build (see make/modules/modules.config and
 109 # modules.group).
 110 #
 111 
 112 ifndef MODULE
 113   MODULE = other
 114 endif
 115 override MODULE_DEST_DIR = $(SUBMODULES_DIR)/$(strip $(MODULE))
 116 
 117 MODULE_PATH_PATTERN = -e 's%.*\/classes\/%classes\/%' \
 118                       -e 's%.*\/$(UNIQUE_PATH_PATTERN)\/%classes\/%' \
 119                       -e 's%.*\/lib\/%lib\/%' \
 120                       -e 's%.*\/bin\/%bin\/%' \
 121                       -e 's%.*\/include\/%include\/%' \
 122                       -e 's%.*\/demo\/%demo\/%' \
 123                       -e 's%.*\/sample\/%sample\/%'
 124 
 125 # Gets the module destination corresponding to the specified directory
 126 define GetModuleDest
 127 $(shell $(ECHO) $1 | $(SED) $(MODULE_PATH_PATTERN) | \
 128     $(NAWK) '{print "$(MODULE_DEST_DIR)/"$$0}')
 129 endef
 130 
 131 define GetBaseModuleDest
 132 $(shell $(ECHO) $1 | $(SED) $(MODULE_PATH_PATTERN) | \
 133     $(NAWK) '{print "$(SUBMODULES_DIR)/base/"$$0}')
 134 endef
 135 
 136 define TouchModule
 137 $(ECHO) $(MODULE) >> $(MODULES_UPDATE_MARKER)
 138 endef
 139 
 140 # 
 141 # Minimize module library footprint. For now this applies to
 142 # both the JRE and JDK images that the build generates.
 143 #
 144 ifeq ($(MINIMIZE_MLIB_FOOTPRINT),true)
 145     JMOD_CREATE_ARGS += -z
 146     JMOD_INSTALL_ARGS += -G
 147 endif
 148