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