author | duke |
Wed, 05 Jul 2017 21:51:42 +0200 | |
changeset 39088 | 69bb31538c06 |
parent 38848 | 0bc7ed792590 |
child 39929 | f6828731baa8 |
permissions | -rw-r--r-- |
37770 | 1 |
|
36506 | 2 |
# Copyright (c) 2014, Oracle and/or its affiliates. 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. Oracle designates this |
|
8 |
# particular file as subject to the "Classpath" exception as provided |
|
9 |
# by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
22 |
# or visit www.oracle.com if you need additional information or have any |
|
23 |
# questions. |
|
24 |
# |
|
25 |
||
26 |
default: all |
|
27 |
||
28 |
include $(SPEC) |
|
29 |
include MakeBase.gmk |
|
30 |
include Modules.gmk |
|
31 |
||
32 |
ifeq ($(MODULE), ) |
|
33 |
$(error MODULE must be set when calling CreateJmods.gmk) |
|
34 |
endif |
|
35 |
||
36 |
################################################################################ |
|
37 |
||
37770 | 38 |
JMODS_DIR := $(IMAGES_OUTPUTDIR)/jmods |
39 |
||
36506 | 40 |
LIBS_DIR := $(firstword $(wildcard $(addsuffix /$(MODULE), \ |
41 |
$(SUPPORT_OUTPUTDIR)/modules_libs-stripped $(IMPORT_MODULES_LIBS)))) |
|
42 |
CMDS_DIR := $(firstword $(wildcard $(addsuffix /$(MODULE), \ |
|
43 |
$(SUPPORT_OUTPUTDIR)/modules_cmds-stripped $(IMPORT_MODULES_CMDS)))) |
|
44 |
CONF_DIR := $(firstword $(wildcard $(addsuffix /$(MODULE), \ |
|
45 |
$(SUPPORT_OUTPUTDIR)/modules_conf $(IMPORT_MODULES_CONF)))) |
|
46 |
CLASSES_DIR := $(wildcard $(JDK_OUTPUTDIR)/modules/$(MODULE)) |
|
47 |
||
48 |
$(eval $(call FillCacheFind, \ |
|
49 |
$(LIBS_DIR) $(CMDS_DIR) $(CONF_DIR) $(CLASSES_DIR) \ |
|
50 |
)) |
|
51 |
||
52 |
ifneq ($(LIBS_DIR), ) |
|
53 |
JMOD_FLAGS += --libs $(LIBS_DIR) |
|
54 |
DEPS += $(call CacheFind, $(LIBS_DIR)) |
|
55 |
endif |
|
56 |
ifneq ($(CMDS_DIR), ) |
|
57 |
JMOD_FLAGS += --cmds $(CMDS_DIR) |
|
58 |
DEPS += $(call CacheFind, $(CMDS_DIR)) |
|
59 |
endif |
|
60 |
ifneq ($(CONF_DIR), ) |
|
61 |
JMOD_FLAGS += --config $(CONF_DIR) |
|
62 |
DEPS += $(call CacheFind, $(CONF_DIR)) |
|
63 |
endif |
|
64 |
ifneq ($(CLASSES_DIR), ) |
|
65 |
JMOD_FLAGS += --class-path $(CLASSES_DIR) |
|
66 |
DEPS += $(call CacheFind, $(CLASSES_DIR)) |
|
67 |
endif |
|
68 |
||
37764
63e0379dd186
8154956: Module system implementation refresh (4/2016)
alanb
parents:
36506
diff
changeset
|
69 |
# Add dependencies on other jmod files. Only java.base needs access to other |
63e0379dd186
8154956: Module system implementation refresh (4/2016)
alanb
parents:
36506
diff
changeset
|
70 |
# jmods. |
63e0379dd186
8154956: Module system implementation refresh (4/2016)
alanb
parents:
36506
diff
changeset
|
71 |
ifeq ($(MODULE), java.base) |
37975
551c5d86de79
8155786: Determine modules depending on upgradeable modules directly and indirectly
erikj
parents:
37770
diff
changeset
|
72 |
ALL_UPGRADEABLE_MODULES = $(call FindAllUpgradeableModules) |
37770 | 73 |
# When creating a BUILDJDK, we don't need to add hashes to java.base |
74 |
ifneq ($(CREATING_BUILDJDK), true) |
|
75 |
DEPS += $(patsubst %, $(JMODS_DIR)/%.jmod, \ |
|
37975
551c5d86de79
8155786: Determine modules depending on upgradeable modules directly and indirectly
erikj
parents:
37770
diff
changeset
|
76 |
$(filter-out java.base $(ALL_UPGRADEABLE_MODULES), $(call FindAllModules))) |
37764
63e0379dd186
8154956: Module system implementation refresh (4/2016)
alanb
parents:
36506
diff
changeset
|
77 |
|
37975
551c5d86de79
8155786: Determine modules depending on upgradeable modules directly and indirectly
erikj
parents:
37770
diff
changeset
|
78 |
EXCLUDE_PATTERN := $(strip $(subst $(SPACE),|,$(strip $(ALL_UPGRADEABLE_MODULES)))) |
37764
63e0379dd186
8154956: Module system implementation refresh (4/2016)
alanb
parents:
36506
diff
changeset
|
79 |
|
37770 | 80 |
JMOD_FLAGS += --modulepath $(JMODS_DIR) \ |
81 |
--hash-modules '^(?!$(EXCLUDE_PATTERN))' |
|
82 |
endif |
|
37764
63e0379dd186
8154956: Module system implementation refresh (4/2016)
alanb
parents:
36506
diff
changeset
|
83 |
endif |
36506 | 84 |
|
38848
0bc7ed792590
8144911: Consider having modifications to jdk.jlink trigger recreation of all jmods
erikj
parents:
37975
diff
changeset
|
85 |
# Changes to the jmod tool itself should also trigger a rebuild of all jmods |
0bc7ed792590
8144911: Consider having modifications to jdk.jlink trigger recreation of all jmods
erikj
parents:
37975
diff
changeset
|
86 |
DEPS += $(JMOD_CMD) |
0bc7ed792590
8144911: Consider having modifications to jdk.jlink trigger recreation of all jmods
erikj
parents:
37975
diff
changeset
|
87 |
ifeq ($(EXTERNAL_BUILDJDK), false) |
0bc7ed792590
8144911: Consider having modifications to jdk.jlink trigger recreation of all jmods
erikj
parents:
37975
diff
changeset
|
88 |
DEPS += $(call CacheFind, $(JDK_OUTPUTDIR)/modules/jdk.jlink/jdk/tools/jmod) |
0bc7ed792590
8144911: Consider having modifications to jdk.jlink trigger recreation of all jmods
erikj
parents:
37975
diff
changeset
|
89 |
endif |
0bc7ed792590
8144911: Consider having modifications to jdk.jlink trigger recreation of all jmods
erikj
parents:
37975
diff
changeset
|
90 |
|
36506 | 91 |
# TODO: What about headers? |
92 |
# Create jmods in a temp dir and then move them into place to keep the |
|
93 |
# module path in $(IMAGES_OUTPUTDIR)/jmods valid at all times. |
|
37770 | 94 |
$(JMODS_DIR)/$(MODULE).jmod: $(DEPS) |
95 |
$(call LogWarn, Creating $(patsubst $(OUTPUT_ROOT)/%, %, $@)) |
|
36506 | 96 |
$(call MakeDir, $(@D) $(SUPPORT_OUTPUTDIR)/jmods) |
97 |
$(RM) $@ $(SUPPORT_OUTPUTDIR)/jmods/$(notdir $@) |
|
98 |
$(JMOD) create \ |
|
99 |
--module-version $(VERSION_SHORT) \ |
|
100 |
--os-name $(REQUIRED_OS_NAME) \ |
|
101 |
--os-arch $(OPENJDK_TARGET_CPU_LEGACY) \ |
|
102 |
--os-version $(REQUIRED_OS_VERSION) \ |
|
37770 | 103 |
--modulepath $(JMODS_DIR) \ |
37653 | 104 |
--exclude '**{_the.*,*.diz,*.debuginfo,*.dSYM/**,*.pdb,*.map}' \ |
36506 | 105 |
$(JMOD_FLAGS) $(SUPPORT_OUTPUTDIR)/jmods/$(notdir $@) |
106 |
$(MV) $(SUPPORT_OUTPUTDIR)/jmods/$(notdir $@) $@ |
|
107 |
||
108 |
TARGETS += $(IMAGES_OUTPUTDIR)/jmods/$(MODULE).jmod |
|
109 |
||
110 |
################################################################################ |
|
111 |
||
112 |
all: $(TARGETS) |
|
113 |
||
114 |
################################################################################ |