jdk/make/common/Modules.gmk
author ohair
Wed, 02 Feb 2011 09:39:31 -0800
changeset 8022 d11e5f2eb62c
parent 7967 aa85f513e8f2
parent 8009 faa3179b2b38
permissions -rw-r--r--
Merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4524
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
     1
#
7668
d4a77089c587 6962318: Update copyright year
ohair
parents: 5506
diff changeset
     2
# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
4524
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
     4
#
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 5381
diff changeset
     7
# published by the Free Software Foundation.  Oracle designates this
4524
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
     8
# particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 5381
diff changeset
     9
# by Oracle in the LICENSE file that accompanied this code.
4524
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
    10
#
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
    11
# This code is distributed in the hope that it will be useful, but WITHOUT
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
    12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
    13
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
    14
# version 2 for more details (a copy is included in the LICENSE file that
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
    15
# accompanied this code).
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
    16
#
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
    17
# You should have received a copy of the GNU General Public License version
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
    18
# 2 along with this work; if not, write to the Free Software Foundation,
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
    19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
    20
#
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 5381
diff changeset
    21
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 5381
diff changeset
    22
# or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 5381
diff changeset
    23
# questions.
4524
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
    24
#
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
    25
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
    26
JDK_MODULE_IMAGE_DIR = $(ABS_OUTPUTDIR)/jdk-module-image
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
    27
JRE_MODULE_IMAGE_DIR = $(ABS_OUTPUTDIR)/jre-module-image
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
    28
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
    29
#
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
    30
# modules   Target to build jdk and jre module image
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
    31
#
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
    32
#           There is one jar file per module containing classes only.
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
    33
#           All module jars are currently placed under jre/lib directory.
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
    34
#
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
    35
# Open issues that need further investigation:
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
    36
# 1. Classes in jre/lib/ext/dnsns.jar are currently put in jre/lib/jndi-dns
4665
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4524
diff changeset
    37
#    module.  META-INF/services file is not installed.
4524
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
    38
# 2. Signed jars
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
    39
#    For JDK build, signed jars are copied to the build.
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
    40
#    All jars in the module image are unsigned.
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
    41
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
    42
MODULE_IMAGEBINDIR = bin
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
    43
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
    44
#
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
    45
# Targets.
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
    46
#
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
    47
INITIAL_MODULE_IMAGE_JRE=initial-module-image-jre
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
    48
INITIAL_MODULE_IMAGE_JDK=initial-module-image-jdk
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
    49
ifeq ($(PLATFORM), solaris)
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
    50
  ifeq ($(ARCH_DATA_MODEL), 64)
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
    51
    INITIAL_MODULE_IMAGE_JRE=initial-module-image-jre-sol64
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
    52
    INITIAL_MODULE_IMAGE_JDK=initial-module-image-jdk-sol64
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
    53
  endif
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
    54
endif
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
    55
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
    56
modules modules-clobber \
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
    57
initial-module-image-jre initial-module-image-jdk \
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
    58
initial-module-image-jre-sol64 initial-module-image-jdk-sol64 \
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
    59
trim-module-image-jre trim-module-image-jdk \
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
    60
process-module-image-jre process-module-image-jdk ::
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
    61
	@$(ECHO) ">>>Making "$@" @ `$(DATE)` ..."
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
    62
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
    63
# Order is important here, trim jre after jdk image is created
4665
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4524
diff changeset
    64
modules:: gen-modules \
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4524
diff changeset
    65
	 sanity-module-images post-sanity-module-images  \
4524
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
    66
	 $(INITIAL_MODULE_IMAGE_JRE) $(INITIAL_MODULE_IMAGE_JDK) \
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
    67
	 trim-module-image-jre trim-module-image-jdk \
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
    68
	 process-module-image-jre process-module-image-jdk
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
    69
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
    70
# Don't use these
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
    71
module-image-jre:: initial-module-image-jre trim-module-image-jre process-module-image-jre
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
    72
module-image-jdk:: initial-module-image-jdk trim-module-image-jdk process-module-image-jdk
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
    73
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
    74
#
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
    75
# Paths to these files we need
8009
faa3179b2b38 6980024: Rebranding jre7/jdk7 License, Copyright, Readme
ohair
parents: 7668
diff changeset
    76
JDK_MODULE_DOCFILES   = $(IMAGE_DOCLIST_JDK:%=$(JDK_MODULE_IMAGE_DIR)/%)
faa3179b2b38 6980024: Rebranding jre7/jdk7 License, Copyright, Readme
ohair
parents: 7668
diff changeset
    77
JRE_MODULE_DOCFILES   = $(IMAGE_DOCLIST_JRE:%=$(JRE_MODULE_IMAGE_DIR)/%)
4524
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
    78
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
    79
###### RULES
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
    80
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
    81
# JDK files
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
    82
$(JDK_MODULE_IMAGE_DIR)/%: $(SHARE_JDK_DOC_SRC)/%
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
    83
	$(process-doc-file)
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
    84
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
    85
# JRE files 
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
    86
$(JRE_MODULE_IMAGE_DIR)/%: $(SHARE_JRE_DOC_SRC)/%
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
    87
	$(process-doc-file)
8009
faa3179b2b38 6980024: Rebranding jre7/jdk7 License, Copyright, Readme
ohair
parents: 7668
diff changeset
    88
ifeq ($(PLATFORM), windows)
faa3179b2b38 6980024: Rebranding jre7/jdk7 License, Copyright, Readme
ohair
parents: 7668
diff changeset
    89
$(JRE_MODULE_IMAGE_DIR)/README.txt: $(SHARE_JRE_DOC_SRC)/README
4524
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
    90
	$(process-doc-file)
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
    91
endif
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
    92
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
    93
######################################################
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
    94
# JRE Image
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
    95
######################################################
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
    96
4665
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4524
diff changeset
    97
MODULES_LIST = $(MODULES_TEMPDIR)/classlist/modules.list
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4524
diff changeset
    98
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4524
diff changeset
    99
# Modules in the jre/lib/security directory
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4524
diff changeset
   100
POLICY_MODULES = US_export_policy local_policy
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4524
diff changeset
   101
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4524
diff changeset
   102
# Modules in the modules/ext directory
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4524
diff changeset
   103
EXT_MODULES = localedata security-sunec security-sunjce
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4524
diff changeset
   104
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4524
diff changeset
   105
# Build PKCS#11 on all platforms except 64-bit Windows.
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4524
diff changeset
   106
PKCS11 = security-sunpkcs11
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4524
diff changeset
   107
ifeq ($(ARCH_DATA_MODEL), 64)
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4524
diff changeset
   108
  ifeq ($(PLATFORM), windows)
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4524
diff changeset
   109
    PKCS11 =
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4524
diff changeset
   110
  endif
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4524
diff changeset
   111
endif
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4524
diff changeset
   112
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4524
diff changeset
   113
EXT_MODULES += $(PKCS11)
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4524
diff changeset
   114
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4524
diff changeset
   115
# Build Microsoft CryptoAPI provider only on (non-64-bit) Windows platform.
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4524
diff changeset
   116
ifeq ($(PLATFORM), windows)
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4524
diff changeset
   117
  ifneq ($(ARCH_DATA_MODEL), 64)
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4524
diff changeset
   118
    EXT_MODULES += security-sunmscapi
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4524
diff changeset
   119
  endif
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4524
diff changeset
   120
endif
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4524
diff changeset
   121
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4524
diff changeset
   122
# Modules for JDK only
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4524
diff changeset
   123
JDK_MODULES = tools
4524
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   124
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   125
gen-modules:
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   126
	$(CD) modules; $(MAKE) all
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   127
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   128
initial-module-image-jre-setup:
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   129
	$(RM) -r $(JRE_MODULE_IMAGE_DIR)
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   130
	$(MKDIR) -p $(JRE_MODULE_IMAGE_DIR)
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   131
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   132
# 64-bit solaris jre image contains only the 64-bit add-on files.
8009
faa3179b2b38 6980024: Rebranding jre7/jdk7 License, Copyright, Readme
ohair
parents: 7668
diff changeset
   133
initial-module-image-jre-sol64:: initial-module-image-jre-setup
4524
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   134
	@# Use tar instead of cp to preserve the symbolic links
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   135
	for dir in bin lib ; do \
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   136
	  ( $(CD) $(OUTPUTDIR) && \
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   137
		$(TAR) cf - `$(FIND) $$dir -name '$(ARCH)' -print` | \
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   138
		($(CD) $(JRE_MODULE_IMAGE_DIR) && $(TAR) xf -) ) ; \
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   139
	done
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   140
	@# Remove some files from the jre area
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   141
	for t in $(NOTJRETOOLS) ; do \
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   142
	    $(RM) $(JRE_MODULE_IMAGE_DIR)/bin$(ISA_DIR)/$$t ; \
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   143
	done
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   144
	$(RM) `$(FIND) $(JRE_MODULE_IMAGE_DIR)/lib -name 'orb.idl'`
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   145
	$(RM) `$(FIND) $(JRE_MODULE_IMAGE_DIR)/lib -name 'ir.idl'`
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   146
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   147
# Construct an initial jre image (initial jdk jre) no trimming or stripping
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   148
initial-module-image-jre:: initial-module-image-jre-setup \
8009
faa3179b2b38 6980024: Rebranding jre7/jdk7 License, Copyright, Readme
ohair
parents: 7668
diff changeset
   149
		    $(JRE_MODULE_DOCFILES) \
4524
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   150
		    $(BUILDMETAINDEX_JARFILE)
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   151
	@# Copy in bin directory
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   152
	$(CD) $(OUTPUTDIR) && $(FIND) bin -depth | $(CPIO) -pdum $(JRE_MODULE_IMAGE_DIR)
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   153
	@# CTE plugin security change require new empty directory lib/applet
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   154
	$(MKDIR) -p $(JRE_MODULE_IMAGE_DIR)/lib/applet
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   155
	@# Copy files but not .jar in lib directory 
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   156
	$(CD) $(OUTPUTDIR) && $(FIND) lib -depth | $(EGREP) -v ".jar$$" | $(CPIO) -pdum $(JRE_MODULE_IMAGE_DIR)
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   157
	@#
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   158
	@# copy modules to jre/lib
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   159
	@#
4665
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4524
diff changeset
   160
	for m in `$(NAWK) '{print $$1}' $(MODULES_LIST)` ; do \
4681
7d382dfe6e55 6916217: make/modules/Makefile requires ALT_JDK_IMPORT_PATH
mchung
parents: 4665
diff changeset
   161
	    $(CP) $(MODULES_DIR)/$$m/lib/$$m.jar $(JRE_MODULE_IMAGE_DIR)/lib ; \
4665
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4524
diff changeset
   162
	done
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4524
diff changeset
   163
	$(MKDIR) -p $(JRE_MODULE_IMAGE_DIR)/lib/ext
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4524
diff changeset
   164
	for m in $(EXT_MODULES) ; do \
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4524
diff changeset
   165
           $(MV) $(JRE_MODULE_IMAGE_DIR)/lib/$$m.jar $(JRE_MODULE_IMAGE_DIR)/lib/ext ; \
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4524
diff changeset
   166
        done
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4524
diff changeset
   167
	for m in $(POLICY_MODULES) ; do \
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4524
diff changeset
   168
           $(MV) $(JRE_MODULE_IMAGE_DIR)/lib/$$m.jar $(JRE_MODULE_IMAGE_DIR)/lib/security; \
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4524
diff changeset
   169
        done
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4524
diff changeset
   170
	@# Remove jdk modules
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4524
diff changeset
   171
	for m in $(JDK_MODULES) ; do \
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4524
diff changeset
   172
           $(RM) $(JRE_MODULE_IMAGE_DIR)/lib/$$m.jar ; \
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4524
diff changeset
   173
        done
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4524
diff changeset
   174
4524
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   175
	@# Make sure all directories are read/execute for everyone
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   176
	$(CHMOD) a+rx `$(FIND) $(JRE_MODULE_IMAGE_DIR) -type d`
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   177
	@# Remove some files from the jre area
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   178
	for t in $(NOTJRETOOLS) ; do \
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   179
	    $(RM) $(JRE_MODULE_IMAGE_DIR)/bin$(ISA_DIR)/$$t ; \
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   180
	done
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   181
	@# Remove orb.idl and ir.idl from jre
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   182
	$(FIND) $(JRE_MODULE_IMAGE_DIR)/lib -name 'orb.idl' -exec $(RM) \{} \;
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   183
	$(FIND) $(JRE_MODULE_IMAGE_DIR)/lib -name 'ir.idl' -exec $(RM) \{} \;
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   184
	@# Generate meta-index to make boot and extension class loaders lazier
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   185
	$(CD) $(JRE_MODULE_IMAGE_DIR)/lib && \
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   186
	    $(BOOT_JAVA_CMD) -jar $(BUILDMETAINDEX_JARFILE) \
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   187
		-o meta-index *.jar
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   188
	@$(CD) $(JRE_MODULE_IMAGE_DIR)/lib && $(java-vm-cleanup)
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   189
	$(CD) $(JRE_MODULE_IMAGE_DIR)/lib/ext && \
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   190
	    $(BOOT_JAVA_CMD) -jar $(BUILDMETAINDEX_JARFILE) \
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   191
		-o meta-index *.jar
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   192
	@$(CD) $(JRE_MODULE_IMAGE_DIR)/lib/ext && $(java-vm-cleanup)
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   193
ifeq ($(PLATFORM), windows)
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   194
	@# Remove certain *.lib files
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   195
	$(CD) $(JRE_MODULE_IMAGE_DIR)/lib && \
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   196
            $(RM) java.$(LIB_SUFFIX) jvm.$(LIB_SUFFIX) \
7967
aa85f513e8f2 6993732: Remove the HPI
alanb
parents: 7668
diff changeset
   197
                  awt.$(LIB_SUFFIX) jawt.$(LIB_SUFFIX)
4524
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   198
  ifeq ($(ARCH_DATA_MODEL), 32)
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   199
	@# The Java Kernel JRE image ships with a special VM.  It is not included
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   200
	@# in the full JRE image, so remove it.  Also, is it only for 32-bit windows.
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   201
	$(CD) $(JRE_MODULE_IMAGE_DIR)/bin && $(RM) -r kernel
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   202
  endif
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   203
endif # Windows
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   204
ifneq ($(PLATFORM), windows)
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   205
	$(call copy-man-pages,$(JRE_MODULE_IMAGE_DIR),$(JRE_MAN_PAGES))
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   206
endif # !windows
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   207
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   208
# Trim out any extra files not for the jre shipment but wanted in the jdk jre.
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   209
#   (Note the jdk WILL want the jre image before this trimming)
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   210
#   Removes server VM on Windows 32bit.
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   211
#   Remove certain shared libraries that should not be in the jre image
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   212
#      but should be in the jdk jre image.
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   213
trim-module-image-jre::
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   214
ifeq ($(PLATFORM), windows)
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   215
  ifeq ($(ARCH_DATA_MODEL), 32)
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   216
	$(RM) -r $(JRE_MODULE_IMAGE_DIR)/bin/server
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   217
  endif
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   218
  ifdef NOTJRE_SHARED_LIBS
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   219
	for l in $(NOTJRE_SHARED_LIBS) ; do \
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   220
	    $(RM) $(JRE_MODULE_IMAGE_DIR)/bin/$$l ; \
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   221
	done ;
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   222
  endif
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   223
else # PLATFORM
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   224
  ifdef NOTJRE_SHARED_LIBS
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   225
	for l in $(NOTJRE_SHARED_LIBS) ; do \
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   226
	    $(RM) $(JRE_MODULE_IMAGE_DIR)/lib/$(LIBARCH)/$$l ; \
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   227
	done ;
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   228
  endif
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   229
endif # PLATFORM
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   230
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   231
# Get list of all Elf files in the jre
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   232
JRE_MODULE_ELF_LIST=$(MODULES_TEMPDIR)/jre-elf-files.list
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   233
$(JRE_MODULE_ELF_LIST):
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   234
	@$(prep-target)
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   235
ifneq ($(PLATFORM), windows)
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   236
	$(RM) $@
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   237
	$(FIND) $(JRE_MODULE_IMAGE_DIR)/lib -type f -name \*.$(LIB_SUFFIX) >> $@
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   238
	$(FILE) `$(FIND) $(JRE_MODULE_IMAGE_DIR)/bin -type f -name \*$(EXE_SUFFIX)` \
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   239
	    | $(EGREP) 'ELF' | $(CUT) -d':' -f1 >> $@
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   240
endif
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   241
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   242
# Post process the image (strips and mcs on Elf files we are shipping)
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   243
#   (Note the jdk WILL want the jre image before this processing)
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   244
process-module-image-jre:: $(JRE_MODULE_ELF_LIST)
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   245
ifneq ($(POST_STRIP_PROCESS), )
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   246
	for f in `$(CAT) $(JRE_MODULE_ELF_LIST)`; do \
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   247
	  $(CHMOD) u+w $${f}; \
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   248
	  $(ECHO) $(POST_STRIP_PROCESS) $${f}; \
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   249
	  $(POST_STRIP_PROCESS) $${f}; \
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   250
	  $(CHMOD) go-w $${f}; \
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   251
	done
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   252
endif
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   253
ifneq ($(POST_MCS_PROCESS), )
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   254
	for f in `$(CAT) $(JRE_MODULE_ELF_LIST)`; do \
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   255
	  $(CHMOD) u+w $${f}; \
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   256
	  $(ECHO) $(POST_MCS_PROCESS) $${f}; \
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   257
	  $(POST_MCS_PROCESS) $${f}; \
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   258
	  $(CHMOD) go-w $${f}; \
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   259
	done
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   260
endif
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   261
	$(RM) $(JRE_MODULE_ELF_LIST)
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   262
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   263
######################################################
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   264
# JDK Image
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   265
######################################################
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   266
# Note: cpio ($(CPIO)) sometimes leaves directories without rx access.
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   267
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   268
initial-module-image-jdk-setup:
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   269
	$(RM) -r $(JDK_MODULE_IMAGE_DIR)
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   270
	$(MKDIR) -p $(JDK_MODULE_IMAGE_DIR)/jre
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   271
	($(CD) $(JRE_MODULE_IMAGE_DIR) && $(FIND) . -depth -print \
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   272
	      | $(CPIO) -pdum $(JDK_MODULE_IMAGE_DIR)/jre )
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   273
	$(RM) -rf $(JDK_MODULE_IMAGE_DIR)/jre/man
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   274
	$(CHMOD) a+rx `$(FIND) $(JDK_MODULE_IMAGE_DIR) -type d`
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   275
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   276
initial-module-image-jdk64-bindemos:
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   277
	for dir in bin demo ; do \
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   278
	  ( $(CD) $(OUTPUTDIR) && \
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   279
		$(TAR) cf - `$(FIND) $$dir -name '$(LIBARCH)' -print` | \
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   280
		($(CD) $(JDK_MODULE_IMAGE_DIR) && $(TAR) xf -) ) ; \
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   281
        done
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   282
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   283
# Solaris 64 bit image is special
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   284
initial-module-image-jdk-sol64:: initial-module-image-jdk-setup \
8009
faa3179b2b38 6980024: Rebranding jre7/jdk7 License, Copyright, Readme
ohair
parents: 7668
diff changeset
   285
			  initial-module-image-jdk64-bindemos
4524
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   286
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   287
# DB files to add
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   288
ifeq ($(OPENJDK),true)
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   289
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   290
initial-module-image-jdk-db:
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   291
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   292
else
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   293
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   294
# Create the list of db *.zip files to bundle with jdk
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   295
ABS_DB_PATH  :=$(call FullPath,$(CLOSED_SHARE_SRC)/db)
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   296
DB_ZIP_LIST = $(shell $(LS) $(ABS_DB_PATH)/*.zip 2>/dev/null)
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   297
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   298
initial-module-image-jdk-db: $(DB_ZIP_LIST)
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   299
	$(MKDIR) -p $(JDK_MODULE_IMAGE_DIR)/db
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   300
	for d in $(DB_ZIP_LIST); do \
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   301
          ($(CD) $(JDK_MODULE_IMAGE_DIR)/db && $(UNZIP) -o $$d); \
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   302
	done
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   303
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   304
endif
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   305
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   306
# Standard jdk image
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   307
initial-module-image-jdk:: initial-module-image-jdk-setup \
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   308
		    initial-module-image-jdk-db \
8009
faa3179b2b38 6980024: Rebranding jre7/jdk7 License, Copyright, Readme
ohair
parents: 7668
diff changeset
   309
		    $(JDK_MODULE_DOCFILES)
4524
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   310
	$(MKDIR) $(JDK_MODULE_IMAGE_DIR)/lib
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   311
	@#
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   312
	@# copy jdk modules to jdk/lib
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   313
	@#
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   314
	$(MKDIR) -p $(JDK_MODULE_IMAGE_DIR)/lib
4665
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4524
diff changeset
   315
	for m in $(JDK_MODULES) ; do \
4681
7d382dfe6e55 6916217: make/modules/Makefile requires ALT_JDK_IMPORT_PATH
mchung
parents: 4665
diff changeset
   316
	    $(CP) $(MODULES_DIR)/$$m/lib/$$m.jar $(JDK_MODULE_IMAGE_DIR)/lib ; \
4665
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4524
diff changeset
   317
        done
4524
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   318
  ifeq ($(PLATFORM), windows)
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   319
	@#
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   320
	@# lib/
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   321
	@#
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   322
	$(CP) $(LIBDIR)/$(LIB_PREFIX)jvm.$(LIB_SUFFIX) $(JDK_MODULE_IMAGE_DIR)/lib
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   323
	$(CP) $(LIBDIR)/$(LIB_PREFIX)jawt.$(LIB_SUFFIX) $(JDK_MODULE_IMAGE_DIR)/lib
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   324
	@#
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   325
	@# bin/
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   326
	@#
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   327
	@# copy all EXE files and only certain DLL files from BINDIR
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   328
	$(MKDIR) -p $(JDK_MODULE_IMAGE_DIR)/bin
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   329
	$(CP) $(BINDIR)/*$(EXE_SUFFIX) $(JDK_MODULE_IMAGE_DIR)/bin
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   330
	$(CP) $(BINDIR)/jli.$(LIBRARY_SUFFIX) $(JDK_MODULE_IMAGE_DIR)/bin
5381
d6d64a42ff51 6931180: Migration to recent versions of MS Platform SDK
prr
parents: 4681
diff changeset
   331
    ifeq ($(COMPILER_VERSION), VS2010)
d6d64a42ff51 6931180: Migration to recent versions of MS Platform SDK
prr
parents: 4681
diff changeset
   332
	$(CP) $(BINDIR)/msvc*100.$(LIBRARY_SUFFIX) $(JDK_MODULE_IMAGE_DIR)/bin
d6d64a42ff51 6931180: Migration to recent versions of MS Platform SDK
prr
parents: 4681
diff changeset
   333
    endif
4524
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   334
    ifeq ($(ARCH_DATA_MODEL), 32)
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   335
      ifeq ($(COMPILER_VERSION), VS2003)
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   336
	$(CP) $(BINDIR)/msvc*71.$(LIBRARY_SUFFIX) $(JDK_MODULE_IMAGE_DIR)/bin
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   337
      endif
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   338
    endif
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   339
  else # PLATFORM
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   340
	@#
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   341
	@# bin/
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   342
	@#
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   343
	($(CD) $(BINDIR)/.. && $(TAR) cf - \
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   344
	    `$(FIND) bin \( -type f -o -type l \) -print `) | \
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   345
	    ($(CD) $(JDK_MODULE_IMAGE_DIR) && $(TAR) xf -)
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   346
  endif # PLATFORM
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   347
	@#
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   348
	@# lib/ct.sym
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   349
	@#
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   350
	$(MKDIR) -p $(OUTPUTDIR)/symbols/META-INF/sym
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   351
	$(JAVAC_CMD) -XDprocess.packages -proc:only \
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   352
	    -processor com.sun.tools.javac.sym.CreateSymbols \
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   353
	    -Acom.sun.tools.javac.sym.Jar=$(RT_JAR) \
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   354
	    -Acom.sun.tools.javac.sym.Dest=$(OUTPUTDIR)/symbols/META-INF/sym/rt.jar \
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   355
	    $(CORE_PKGS) $(NON_CORE_PKGS) $(EXCLUDE_PROPWARN_PKGS)
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   356
	$(BOOT_JAR_CMD) c0f $(LIBDIR)/ct.sym \
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   357
	    -C $(OUTPUTDIR)/symbols META-INF $(BOOT_JAR_JFLAGS)
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   358
	@$(java-vm-cleanup)
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   359
	$(CP) $(LIBDIR)/ct.sym $(JDK_MODULE_IMAGE_DIR)/lib/ct.sym
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   360
	@#
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   361
	@# CORBA supported orb.idl and ir.idl should be copied to lib
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   362
	@#
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   363
	$(CP) $(LIBDIR)/orb.idl $(JDK_MODULE_IMAGE_DIR)/lib/orb.idl
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   364
	$(CP) $(LIBDIR)/ir.idl $(JDK_MODULE_IMAGE_DIR)/lib/ir.idl
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   365
  ifeq ($(PLATFORM), linux)
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   366
	@#
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   367
	@# on Linux copy jexec from jre/lib to /lib
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   368
	@#
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   369
	$(CP) $(LIBDIR)/jexec $(JDK_MODULE_IMAGE_DIR)/lib/jexec
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   370
  endif # PLATFORM
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   371
	@#
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   372
	@# demo, include
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   373
	@#
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   374
	$(CP) -r -f $(DEMODIR) $(JDK_MODULE_IMAGE_DIR)
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   375
	$(CP) -r -f $(SAMPLEDIR) $(JDK_MODULE_IMAGE_DIR)
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   376
	$(CP) -r $(INCLUDEDIR) $(JDK_MODULE_IMAGE_DIR)
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   377
	@#
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   378
	@# Swing BeanInfo generation
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   379
	@#
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   380
	$(CD) javax/swing/beaninfo && $(MAKE) JDK_IMAGE_DIR=$(JDK_MODULE_IMAGE_DIR) swing-1.2-beans
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   381
ifneq ($(PLATFORM), windows)
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   382
	$(call copy-man-pages,$(JDK_MODULE_IMAGE_DIR),$(JDK_MAN_PAGES))
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   383
endif # !windows
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   384
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   385
# Trim out files we don't want to ship
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   386
trim-module-image-jdk::
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   387
	@# Remove tools that should not be part of SDK.
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   388
	for t in $(NOTJDKTOOLS); do \
7967
aa85f513e8f2 6993732: Remove the HPI
alanb
parents: 7668
diff changeset
   389
	    $(RM) $(JDK_MODULE_IMAGE_DIR)/bin/$${t}$(EXE_SUFFIX); \
4524
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   390
	done
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   391
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   392
# Get list of Elf files in the jdk
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   393
JDK_MODULE_ELF_LIST=$(MODULES_TEMPDIR)/jdk-elf-files.list
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   394
$(JDK_MODULE_ELF_LIST):
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   395
	@$(prep-target)
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   396
ifneq ($(PLATFORM), windows)
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   397
	$(RM) $@
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   398
	$(FIND) $(JDK_MODULE_IMAGE_DIR)/jre/lib -type f -name \*.$(LIB_SUFFIX) >> $@
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   399
	$(FILE) `$(FIND) $(JDK_MODULE_IMAGE_DIR)/jre/bin -type f -name \*$(EXE_SUFFIX)` \
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   400
	    | $(EGREP) 'ELF' | $(CUT) -d':' -f1 >> $@
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   401
	file `$(FIND) $(JDK_MODULE_IMAGE_DIR)/bin -type f -name \*$(EXE_SUFFIX)` \
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   402
	    | $(EGREP) 'ELF' | $(CUT) -d':' -f1 >> $@
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   403
endif
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   404
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   405
# Post process the image (strips and mcs on files we are shipping)
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   406
process-module-image-jdk:: $(JDK_MODULE_ELF_LIST)
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   407
ifneq ($(POST_STRIP_PROCESS), )
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   408
	for f in `$(CAT) $(JDK_MODULE_ELF_LIST)`; do \
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   409
	  $(CHMOD) u+w $${f}; \
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   410
	  $(ECHO) $(POST_STRIP_PROCESS) $${f}; \
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   411
	  $(POST_STRIP_PROCESS) $${f}; \
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   412
	  $(CHMOD) go-w $${f}; \
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   413
	done
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   414
endif
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   415
ifneq ($(POST_MCS_PROCESS), )
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   416
	for f in `$(CAT) $(JDK_MODULE_ELF_LIST)`; do \
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   417
	  $(CHMOD) u+w $${f}; \
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   418
	  $(ECHO) $(POST_MCS_PROCESS) $${f}; \
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   419
	  $(POST_MCS_PROCESS) $${f}; \
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   420
	  $(CHMOD) go-w $${f}; \
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   421
	done
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   422
endif
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   423
	$(RM) $(JDK_MODULE_ELF_LIST)
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   424
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   425
######################################################
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   426
# clobber
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   427
######################################################
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   428
modules-clobber::
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   429
	$(RM) -r $(JDK_MODULE_IMAGE_DIR)
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   430
	$(RM) -r $(JRE_MODULE_IMAGE_DIR)
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   431
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   432
#
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   433
# TODO - nop for now
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   434
sanity-module-images post-sanity-module-images:
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   435
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   436
modules modules-clobber::
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   437
	@$(ECHO) ">>>Finished making "$@" @ `$(DATE)` ..."
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   438
	@$(java-vm-cleanup)
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   439
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   440
.PHONY: modules module-image-jre module-image-jdk \
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   441
	initial-module-image-jre initial-module-image-jdk \
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   442
	initial-module-image-jre-sol64 initial-module-image-jdk-sol64 \
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   443
        initial-module-image-jdk-setup \
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   444
	initial-module-image-jdk-db \
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   445
        initial-module-image-jdk64-bindemos \
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   446
        initial-module-image-jre-setup \
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   447
	trim-module-image-jre trim-module-image-jdk \
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   448
	process-module-image-jre process-module-image-jdk \
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   449
	install-previous-jre install-previous-jdk \
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   450
	modules-clobber
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   451
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   452
# Force rule
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   453
FRC:
697144bd8b04 6909572: Add a new target for building modules
mchung
parents:
diff changeset
   454