author | avstepan |
Wed, 21 Dec 2016 17:34:41 +0300 | |
changeset 43074 | 7f676353195d |
parent 41874 | 07c3c4f1eb63 |
child 42517 | d3485deb09eb |
child 42505 | 11439b0c0792 |
permissions | -rw-r--r-- |
37770 | 1 |
|
39929
f6828731baa8
8160334: Building --with-parfait= fails with No rule to make target 'PARFAIT_NATIVEJMOD
erikj
parents:
38848
diff
changeset
|
2 |
# Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. |
36506 | 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 |
41874
07c3c4f1eb63
8168108: lib/classlist should be packaged in java.base.jmod
erikj
parents:
41532
diff
changeset
|
39 |
JMODS_TEMPDIR := $(SUPPORT_OUTPUTDIR)/jmods |
37770 | 40 |
|
36506 | 41 |
LIBS_DIR := $(firstword $(wildcard $(addsuffix /$(MODULE), \ |
41260 | 42 |
$(SUPPORT_OUTPUTDIR)/modules_libs $(IMPORT_MODULES_LIBS)))) |
36506 | 43 |
CMDS_DIR := $(firstword $(wildcard $(addsuffix /$(MODULE), \ |
41260 | 44 |
$(SUPPORT_OUTPUTDIR)/modules_cmds $(IMPORT_MODULES_CMDS)))) |
36506 | 45 |
CONF_DIR := $(firstword $(wildcard $(addsuffix /$(MODULE), \ |
46 |
$(SUPPORT_OUTPUTDIR)/modules_conf $(IMPORT_MODULES_CONF)))) |
|
47 |
CLASSES_DIR := $(wildcard $(JDK_OUTPUTDIR)/modules/$(MODULE)) |
|
41532
76dffc133464
8167558: Add new JMOD section for header files and man pages
mchung
parents:
41260
diff
changeset
|
48 |
INCLUDE_HEADERS_DIR := $(firstword $(wildcard $(addsuffix /$(MODULE), \ |
76dffc133464
8167558: Add new JMOD section for header files and man pages
mchung
parents:
41260
diff
changeset
|
49 |
$(SUPPORT_OUTPUTDIR)/modules_include $(IMPORT_MODULES_INCLUDE_HEADERS)))) |
76dffc133464
8167558: Add new JMOD section for header files and man pages
mchung
parents:
41260
diff
changeset
|
50 |
MAN_DIR := $(firstword $(wildcard $(addsuffix /$(MODULE), \ |
76dffc133464
8167558: Add new JMOD section for header files and man pages
mchung
parents:
41260
diff
changeset
|
51 |
$(SUPPORT_OUTPUTDIR)/modules_man $(IMPORT_MODULES_MAN)))) |
36506 | 52 |
|
53 |
$(eval $(call FillCacheFind, \ |
|
54 |
$(LIBS_DIR) $(CMDS_DIR) $(CONF_DIR) $(CLASSES_DIR) \ |
|
55 |
)) |
|
56 |
||
57 |
ifneq ($(LIBS_DIR), ) |
|
58 |
JMOD_FLAGS += --libs $(LIBS_DIR) |
|
59 |
DEPS += $(call CacheFind, $(LIBS_DIR)) |
|
60 |
endif |
|
61 |
ifneq ($(CMDS_DIR), ) |
|
62 |
JMOD_FLAGS += --cmds $(CMDS_DIR) |
|
63 |
DEPS += $(call CacheFind, $(CMDS_DIR)) |
|
64 |
endif |
|
65 |
ifneq ($(CONF_DIR), ) |
|
66 |
JMOD_FLAGS += --config $(CONF_DIR) |
|
67 |
DEPS += $(call CacheFind, $(CONF_DIR)) |
|
68 |
endif |
|
69 |
ifneq ($(CLASSES_DIR), ) |
|
70 |
JMOD_FLAGS += --class-path $(CLASSES_DIR) |
|
71 |
DEPS += $(call CacheFind, $(CLASSES_DIR)) |
|
72 |
endif |
|
41532
76dffc133464
8167558: Add new JMOD section for header files and man pages
mchung
parents:
41260
diff
changeset
|
73 |
ifneq ($(INCLUDE_HEADERS_DIR), ) |
76dffc133464
8167558: Add new JMOD section for header files and man pages
mchung
parents:
41260
diff
changeset
|
74 |
JMOD_FLAGS += --header-files $(INCLUDE_HEADERS_DIR) |
76dffc133464
8167558: Add new JMOD section for header files and man pages
mchung
parents:
41260
diff
changeset
|
75 |
DEPS += $(call CacheFind, $(INCLUDE_HEADERS_DIR)) |
76dffc133464
8167558: Add new JMOD section for header files and man pages
mchung
parents:
41260
diff
changeset
|
76 |
endif |
76dffc133464
8167558: Add new JMOD section for header files and man pages
mchung
parents:
41260
diff
changeset
|
77 |
ifneq ($(MAN_DIR), ) |
76dffc133464
8167558: Add new JMOD section for header files and man pages
mchung
parents:
41260
diff
changeset
|
78 |
JMOD_FLAGS += --man-pages $(MAN_DIR) |
76dffc133464
8167558: Add new JMOD section for header files and man pages
mchung
parents:
41260
diff
changeset
|
79 |
DEPS += $(call CacheFind, $(MAN_DIR)) |
76dffc133464
8167558: Add new JMOD section for header files and man pages
mchung
parents:
41260
diff
changeset
|
80 |
endif |
36506 | 81 |
|
37764
63e0379dd186
8154956: Module system implementation refresh (4/2016)
alanb
parents:
36506
diff
changeset
|
82 |
# 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
|
83 |
# jmods. |
63e0379dd186
8154956: Module system implementation refresh (4/2016)
alanb
parents:
36506
diff
changeset
|
84 |
ifeq ($(MODULE), java.base) |
37770 | 85 |
# When creating a BUILDJDK, we don't need to add hashes to java.base |
86 |
ifneq ($(CREATING_BUILDJDK), true) |
|
41874
07c3c4f1eb63
8168108: lib/classlist should be packaged in java.base.jmod
erikj
parents:
41532
diff
changeset
|
87 |
# When creating interim versions of jmods, skip hashes |
07c3c4f1eb63
8168108: lib/classlist should be packaged in java.base.jmod
erikj
parents:
41532
diff
changeset
|
88 |
ifneq ($(INTERIM_JMOD), true) |
07c3c4f1eb63
8168108: lib/classlist should be packaged in java.base.jmod
erikj
parents:
41532
diff
changeset
|
89 |
ALL_UPGRADEABLE_MODULES := $(call FindAllUpgradeableModules) |
07c3c4f1eb63
8168108: lib/classlist should be packaged in java.base.jmod
erikj
parents:
41532
diff
changeset
|
90 |
DEPS += $(patsubst %, $(JMODS_DIR)/%.jmod, \ |
07c3c4f1eb63
8168108: lib/classlist should be packaged in java.base.jmod
erikj
parents:
41532
diff
changeset
|
91 |
$(filter-out java.base $(ALL_UPGRADEABLE_MODULES), $(call FindAllModules))) |
37764
63e0379dd186
8154956: Module system implementation refresh (4/2016)
alanb
parents:
36506
diff
changeset
|
92 |
|
41874
07c3c4f1eb63
8168108: lib/classlist should be packaged in java.base.jmod
erikj
parents:
41532
diff
changeset
|
93 |
EXCLUDE_PATTERN := $(strip $(subst $(SPACE),|,$(strip $(ALL_UPGRADEABLE_MODULES)))) |
37764
63e0379dd186
8154956: Module system implementation refresh (4/2016)
alanb
parents:
36506
diff
changeset
|
94 |
|
41874
07c3c4f1eb63
8168108: lib/classlist should be packaged in java.base.jmod
erikj
parents:
41532
diff
changeset
|
95 |
JMOD_FLAGS += --module-path $(JMODS_DIR) \ |
07c3c4f1eb63
8168108: lib/classlist should be packaged in java.base.jmod
erikj
parents:
41532
diff
changeset
|
96 |
--hash-modules '^(?!$(EXCLUDE_PATTERN))' |
07c3c4f1eb63
8168108: lib/classlist should be packaged in java.base.jmod
erikj
parents:
41532
diff
changeset
|
97 |
endif |
37770 | 98 |
endif |
37764
63e0379dd186
8154956: Module system implementation refresh (4/2016)
alanb
parents:
36506
diff
changeset
|
99 |
endif |
36506 | 100 |
|
39929
f6828731baa8
8160334: Building --with-parfait= fails with No rule to make target 'PARFAIT_NATIVEJMOD
erikj
parents:
38848
diff
changeset
|
101 |
# Changes to the jmod tool itself should also trigger a rebuild of all jmods. |
f6828731baa8
8160334: Building --with-parfait= fails with No rule to make target 'PARFAIT_NATIVEJMOD
erikj
parents:
38848
diff
changeset
|
102 |
# The variable JMOD_CMD could contain an environment variable assignment before |
f6828731baa8
8160334: Building --with-parfait= fails with No rule to make target 'PARFAIT_NATIVEJMOD
erikj
parents:
38848
diff
changeset
|
103 |
# the actual command. Filter that out using wildcard before adding to DEPS. |
f6828731baa8
8160334: Building --with-parfait= fails with No rule to make target 'PARFAIT_NATIVEJMOD
erikj
parents:
38848
diff
changeset
|
104 |
DEPS += $(wildcard $(JMOD_CMD)) |
38848
0bc7ed792590
8144911: Consider having modifications to jdk.jlink trigger recreation of all jmods
erikj
parents:
37975
diff
changeset
|
105 |
ifeq ($(EXTERNAL_BUILDJDK), false) |
0bc7ed792590
8144911: Consider having modifications to jdk.jlink trigger recreation of all jmods
erikj
parents:
37975
diff
changeset
|
106 |
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
|
107 |
endif |
0bc7ed792590
8144911: Consider having modifications to jdk.jlink trigger recreation of all jmods
erikj
parents:
37975
diff
changeset
|
108 |
|
41874
07c3c4f1eb63
8168108: lib/classlist should be packaged in java.base.jmod
erikj
parents:
41532
diff
changeset
|
109 |
# If creating interim versions of jmods, certain files need to be filtered out |
07c3c4f1eb63
8168108: lib/classlist should be packaged in java.base.jmod
erikj
parents:
41532
diff
changeset
|
110 |
# to avoid false incremental rebuilds. |
07c3c4f1eb63
8168108: lib/classlist should be packaged in java.base.jmod
erikj
parents:
41532
diff
changeset
|
111 |
ifeq ($(INTERIM_JMOD), true) |
07c3c4f1eb63
8168108: lib/classlist should be packaged in java.base.jmod
erikj
parents:
41532
diff
changeset
|
112 |
DEPS := $(filter-out $(SUPPORT_OUTPUTDIR)/modules_libs/java.base/classlist, $(DEPS)) |
07c3c4f1eb63
8168108: lib/classlist should be packaged in java.base.jmod
erikj
parents:
41532
diff
changeset
|
113 |
endif |
07c3c4f1eb63
8168108: lib/classlist should be packaged in java.base.jmod
erikj
parents:
41532
diff
changeset
|
114 |
|
36506 | 115 |
# TODO: What about headers? |
116 |
# Create jmods in a temp dir and then move them into place to keep the |
|
117 |
# module path in $(IMAGES_OUTPUTDIR)/jmods valid at all times. |
|
37770 | 118 |
$(JMODS_DIR)/$(MODULE).jmod: $(DEPS) |
119 |
$(call LogWarn, Creating $(patsubst $(OUTPUT_ROOT)/%, %, $@)) |
|
41874
07c3c4f1eb63
8168108: lib/classlist should be packaged in java.base.jmod
erikj
parents:
41532
diff
changeset
|
120 |
$(call MakeDir, $(JMODS_DIR) $(JMODS_TEMPDIR)) |
07c3c4f1eb63
8168108: lib/classlist should be packaged in java.base.jmod
erikj
parents:
41532
diff
changeset
|
121 |
$(RM) $@ $(JMODS_TEMPDIR)/$(notdir $@) |
36506 | 122 |
$(JMOD) create \ |
123 |
--module-version $(VERSION_SHORT) \ |
|
124 |
--os-name $(REQUIRED_OS_NAME) \ |
|
125 |
--os-arch $(OPENJDK_TARGET_CPU_LEGACY) \ |
|
126 |
--os-version $(REQUIRED_OS_VERSION) \ |
|
40241
59abac94e4f2
8136930: Simplify use of module-system options by custom launchers
mchung
parents:
39929
diff
changeset
|
127 |
--module-path $(JMODS_DIR) \ |
41532
76dffc133464
8167558: Add new JMOD section for header files and man pages
mchung
parents:
41260
diff
changeset
|
128 |
--exclude '**{_the.*,*.diz,*.debuginfo,*.dSYM/**,*.dSYM,*.pdb,*.map}' \ |
41874
07c3c4f1eb63
8168108: lib/classlist should be packaged in java.base.jmod
erikj
parents:
41532
diff
changeset
|
129 |
$(JMOD_FLAGS) $(JMODS_TEMPDIR)/$(notdir $@) |
07c3c4f1eb63
8168108: lib/classlist should be packaged in java.base.jmod
erikj
parents:
41532
diff
changeset
|
130 |
$(MV) $(JMODS_TEMPDIR)/$(notdir $@) $@ |
36506 | 131 |
|
41874
07c3c4f1eb63
8168108: lib/classlist should be packaged in java.base.jmod
erikj
parents:
41532
diff
changeset
|
132 |
TARGETS += $(JMODS_DIR)/$(MODULE).jmod |
36506 | 133 |
|
134 |
################################################################################ |
|
135 |
||
136 |
all: $(TARGETS) |
|
137 |
||
138 |
################################################################################ |