Mercurial > hg > graal-jvmci-8
comparison make/jvmci.make @ 22761:f2206f5bb62e
removed @ServiceProvider mechanism (GRAAL-1380)
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Wed, 30 Dec 2015 17:55:07 +0100 |
parents | 577a4a8caa72 |
children | a920338dd4d4 |
comparison
equal
deleted
inserted
replaced
22760:4cf1946f59fc | 22761:f2206f5bb62e |
---|---|
8 JAR=$(ABS_BOOTDIR)/bin/jar | 8 JAR=$(ABS_BOOTDIR)/bin/jar |
9 | 9 |
10 HS_COMMON_SRC=. | 10 HS_COMMON_SRC=. |
11 | 11 |
12 # Directories, where the generated property-files reside within the JAR files | 12 # Directories, where the generated property-files reside within the JAR files |
13 PROVIDERS_INF=/META-INF/jvmci.providers | |
14 SERVICES_INF=/META-INF/jvmci.services | 13 SERVICES_INF=/META-INF/jvmci.services |
15 OPTIONS_INF=/META-INF/jvmci.options | |
16 | 14 |
17 JARS = $(foreach dist,$(DISTRIBUTIONS),$($(dist)_JAR)) | 15 JARS = $(foreach dist,$(DISTRIBUTIONS),$($(dist)_JAR)) |
18 | 16 |
19 ifeq ($(ABS_BOOTDIR),) | 17 ifeq ($(ABS_BOOTDIR),) |
20 $(error Variable ABS_BOOTDIR must be set to a JDK installation.) | 18 $(error Variable ABS_BOOTDIR must be set to a JDK installation.) |
24 endif | 22 endif |
25 | 23 |
26 # Required to construct a whitespace for use with subst | 24 # Required to construct a whitespace for use with subst |
27 space := | 25 space := |
28 space += | 26 space += |
29 | |
30 # Takes the provider files created by ServiceProviderProcessor (the processor | |
31 # for the @ServiceProvider annotation) and merges them into a single file. | |
32 # Arguments: | |
33 # 1: directory with contents of the JAR file | |
34 define process_providers | |
35 $(eval providers := $(1)/$(PROVIDERS_INF)) | |
36 $(eval services := $(1)/$(SERVICES_INF)) | |
37 $(QUIETLY) test -d $(services) || mkdir -p $(services) | |
38 $(QUIETLY) test ! -d $(providers) || (cd $(providers) && for i in $$(ls); do c=$$(cat $$i); echo $$i >> $(abspath $(services))/$$c; rm $$i; done) | |
39 | |
40 @# Since all projects are built together with one javac call we cannot determine | |
41 @# which project contains HotSpotVMConfig.inline.hpp so we hardcode it. | |
42 $(eval vmconfig := $(1)/hotspot/HotSpotVMConfig.inline.hpp) | |
43 $(eval vmconfigDest := $(HS_COMMON_SRC)/../mxbuild/jvmci/jdk.vm.ci.hotspot/src_gen/hotspot) | |
44 $(QUIETLY) test ! -f $(vmconfig) || (mkdir -p $(vmconfigDest) && cp $(vmconfig) $(vmconfigDest)) | |
45 endef | |
46 | 27 |
47 # Extracts META-INF/jvmci.services from a JAR file into a given directory | 28 # Extracts META-INF/jvmci.services from a JAR file into a given directory |
48 # Arguments: | 29 # Arguments: |
49 # 1: JAR file to extract | 30 # 1: JAR file to extract |
50 # 2: target directory (which already exists) | 31 # 2: target directory (which already exists) |
65 define build_and_jar | 46 define build_and_jar |
66 $(info Building $(4)) | 47 $(info Building $(4)) |
67 $(eval TMP := $(shell mkdir -p $(TARGET) && mktemp -d $(TARGET)/tmp_XXXXX)) | 48 $(eval TMP := $(shell mkdir -p $(TARGET) && mktemp -d $(TARGET)/tmp_XXXXX)) |
68 $(QUIETLY) $(JAVAC) -d $(TMP) -processorpath :$(1) -bootclasspath $(JDK_BOOTCLASSPATH) -cp :$(2) $(filter %.java,$^) | 49 $(QUIETLY) $(JAVAC) -d $(TMP) -processorpath :$(1) -bootclasspath $(JDK_BOOTCLASSPATH) -cp :$(2) $(filter %.java,$^) |
69 $(QUIETLY) test "$(3)" = "" || cp -r $(3) $(TMP) | 50 $(QUIETLY) test "$(3)" = "" || cp -r $(3) $(TMP) |
70 $(QUIETLY) $(call process_providers,$(TMP)) | 51 |
52 @# Since all projects are built together with one javac call we cannot determine | |
53 @# which project contains HotSpotVMConfig.inline.hpp so we hardcode it. | |
54 $(eval vmconfig := $(TMP)/hotspot/HotSpotVMConfig.inline.hpp) | |
55 $(eval vmconfigDest := $(HS_COMMON_SRC)/../mxbuild/jvmci/jdk.vm.ci.hotspot/src_gen/hotspot) | |
56 $(QUIETLY) test ! -f $(vmconfig) || (mkdir -p $(vmconfigDest) && cp $(vmconfig) $(vmconfigDest)) | |
57 | |
71 $(QUIETLY) mkdir -p $(shell dirname $(4)) | 58 $(QUIETLY) mkdir -p $(shell dirname $(4)) |
72 $(QUIETLY) $(JAR) -0cf $(4) -C $(TMP) . | 59 $(QUIETLY) $(JAR) -0cf $(4) -C $(TMP) . |
73 $(QUIETLY) rm -r $(TMP) | 60 $(QUIETLY) rm -r $(TMP) |
74 endef | 61 endef |
75 | 62 |
105 | 92 |
106 | 93 |
107 | 94 |
108 JDK_BOOTCLASSPATH = $(ABS_BOOTDIR)/jre/lib/resources.jar:$(ABS_BOOTDIR)/jre/lib/rt.jar:$(ABS_BOOTDIR)/jre/lib/sunrsasign.jar:$(ABS_BOOTDIR)/jre/lib/jsse.jar:$(ABS_BOOTDIR)/jre/lib/jce.jar:$(ABS_BOOTDIR)/jre/lib/charsets.jar:$(ABS_BOOTDIR)/jre/lib/jfr.jar:$(ABS_BOOTDIR)/jre/classes | 95 JDK_BOOTCLASSPATH = $(ABS_BOOTDIR)/jre/lib/resources.jar:$(ABS_BOOTDIR)/jre/lib/rt.jar:$(ABS_BOOTDIR)/jre/lib/sunrsasign.jar:$(ABS_BOOTDIR)/jre/lib/jsse.jar:$(ABS_BOOTDIR)/jre/lib/jce.jar:$(ABS_BOOTDIR)/jre/lib/charsets.jar:$(ABS_BOOTDIR)/jre/lib/jfr.jar:$(ABS_BOOTDIR)/jre/classes |
109 | 96 |
110 JVMCI_SERVICE_SRC += $(shell find jvmci/jdk.vm.ci.service/src -type f 2> /dev/null) | 97 JVMCI_SERVICES_SRC += $(shell find jvmci/jdk.vm.ci.services/src -type f 2> /dev/null) |
111 | 98 |
112 JVMCI_SERVICE_JAR = $(TARGET)/jvmci-service.jar | 99 JVMCI_SERVICES_JAR = $(TARGET)/jvmci-services.jar |
113 | 100 |
114 EXPORTED_FILES += $(JVMCI_SERVICE_JAR) | 101 EXPORTED_FILES += $(JVMCI_SERVICES_JAR) |
115 | 102 |
116 JVMCI_API_SRC += $(shell find jvmci/jdk.vm.ci.inittimer/src -type f 2> /dev/null) | 103 JVMCI_API_SRC += $(shell find jvmci/jdk.vm.ci.inittimer/src -type f 2> /dev/null) |
117 JVMCI_API_SRC += $(shell find jvmci/jdk.vm.ci.meta/src -type f 2> /dev/null) | 104 JVMCI_API_SRC += $(shell find jvmci/jdk.vm.ci.meta/src -type f 2> /dev/null) |
118 JVMCI_API_SRC += $(shell find jvmci/jdk.vm.ci.code/src -type f 2> /dev/null) | 105 JVMCI_API_SRC += $(shell find jvmci/jdk.vm.ci.code/src -type f 2> /dev/null) |
119 JVMCI_API_SRC += $(shell find jvmci/jdk.vm.ci.runtime/src -type f 2> /dev/null) | 106 JVMCI_API_SRC += $(shell find jvmci/jdk.vm.ci.runtime/src -type f 2> /dev/null) |
122 JVMCI_API_SRC += $(shell find jvmci/jdk.vm.ci.amd64/src -type f 2> /dev/null) | 109 JVMCI_API_SRC += $(shell find jvmci/jdk.vm.ci.amd64/src -type f 2> /dev/null) |
123 JVMCI_API_SRC += $(shell find jvmci/jdk.vm.ci.sparc/src -type f 2> /dev/null) | 110 JVMCI_API_SRC += $(shell find jvmci/jdk.vm.ci.sparc/src -type f 2> /dev/null) |
124 | 111 |
125 JVMCI_API_JAR = $(TARGET)/jvmci-api.jar | 112 JVMCI_API_JAR = $(TARGET)/jvmci-api.jar |
126 | 113 |
127 JVMCI_API_DEP_JARS = $(TARGET)/jvmci-service.jar | 114 JVMCI_API_DEP_JARS = $(TARGET)/jvmci-services.jar |
128 | 115 |
129 EXPORTED_FILES += $(JVMCI_API_JAR) | 116 EXPORTED_FILES += $(JVMCI_API_JAR) |
130 | |
131 JVMCI_SERVICE_PROCESSOR_SRC += $(shell find jvmci/jdk.vm.ci.service.processor/src -type f 2> /dev/null) | |
132 | |
133 JVMCI_SERVICE_PROCESSOR_JAR = $(TARGET)/jvmci-service-processor.jar | |
134 | |
135 JVMCI_SERVICE_PROCESSOR_DEP_JARS = $(TARGET)/jvmci-service.jar | |
136 | 117 |
137 JVMCI_HOTSPOTVMCONFIG_SRC += $(shell find jvmci/jdk.vm.ci.hotspotvmconfig/src -type f 2> /dev/null) | 118 JVMCI_HOTSPOTVMCONFIG_SRC += $(shell find jvmci/jdk.vm.ci.hotspotvmconfig/src -type f 2> /dev/null) |
138 | 119 |
139 JVMCI_HOTSPOTVMCONFIG_JAR = $(TARGET)/jvmci-hotspotvmconfig.jar | 120 JVMCI_HOTSPOTVMCONFIG_JAR = $(TARGET)/jvmci-hotspotvmconfig.jar |
140 | 121 |
142 | 123 |
143 JVMCI_HOTSPOTVMCONFIG_PROCESSOR_SRC += $(shell find jvmci/jdk.vm.ci.hotspotvmconfig.processor/src -type f 2> /dev/null) | 124 JVMCI_HOTSPOTVMCONFIG_PROCESSOR_SRC += $(shell find jvmci/jdk.vm.ci.hotspotvmconfig.processor/src -type f 2> /dev/null) |
144 | 125 |
145 JVMCI_HOTSPOTVMCONFIG_PROCESSOR_JAR = $(TARGET)/jvmci-hotspotvmconfig-processor.jar | 126 JVMCI_HOTSPOTVMCONFIG_PROCESSOR_JAR = $(TARGET)/jvmci-hotspotvmconfig-processor.jar |
146 | 127 |
147 JVMCI_HOTSPOTVMCONFIG_PROCESSOR_DEP_JARS = $(TARGET)/jvmci-service.jar $(TARGET)/jvmci-api.jar $(TARGET)/jvmci-hotspotvmconfig.jar | 128 JVMCI_HOTSPOTVMCONFIG_PROCESSOR_DEP_JARS = $(TARGET)/jvmci-services.jar $(TARGET)/jvmci-api.jar $(TARGET)/jvmci-hotspotvmconfig.jar |
148 | 129 |
149 JVMCI_HOTSPOT_SRC += $(shell find jvmci/jdk.vm.ci.hotspot/src -type f 2> /dev/null) | 130 JVMCI_HOTSPOT_SRC += $(shell find jvmci/jdk.vm.ci.hotspot/src -type f 2> /dev/null) |
150 JVMCI_HOTSPOT_SRC += $(shell find jvmci/jdk.vm.ci.hotspot.aarch64/src -type f 2> /dev/null) | 131 JVMCI_HOTSPOT_SRC += $(shell find jvmci/jdk.vm.ci.hotspot.aarch64/src -type f 2> /dev/null) |
151 JVMCI_HOTSPOT_SRC += $(shell find jvmci/jdk.vm.ci.hotspot.amd64/src -type f 2> /dev/null) | 132 JVMCI_HOTSPOT_SRC += $(shell find jvmci/jdk.vm.ci.hotspot.amd64/src -type f 2> /dev/null) |
152 JVMCI_HOTSPOT_SRC += $(shell find jvmci/jdk.vm.ci.hotspot.sparc/src -type f 2> /dev/null) | 133 JVMCI_HOTSPOT_SRC += $(shell find jvmci/jdk.vm.ci.hotspot.sparc/src -type f 2> /dev/null) |
154 JVMCI_HOTSPOT_SRC += $(shell find jvmci/jdk.vm.ci.hotspot.jfr/src -type f 2> /dev/null) | 135 JVMCI_HOTSPOT_SRC += $(shell find jvmci/jdk.vm.ci.hotspot.jfr/src -type f 2> /dev/null) |
155 endif | 136 endif |
156 | 137 |
157 JVMCI_HOTSPOT_JAR = $(TARGET)/jvmci-hotspot.jar | 138 JVMCI_HOTSPOT_JAR = $(TARGET)/jvmci-hotspot.jar |
158 | 139 |
159 JVMCI_HOTSPOT_DEP_JARS = $(TARGET)/jvmci-hotspotvmconfig.jar $(TARGET)/jvmci-service.jar $(TARGET)/jvmci-api.jar | 140 JVMCI_HOTSPOT_DEP_JARS = $(TARGET)/jvmci-hotspotvmconfig.jar $(TARGET)/jvmci-services.jar $(TARGET)/jvmci-api.jar |
160 | 141 |
161 EXPORTED_FILES += $(JVMCI_HOTSPOT_JAR) | 142 EXPORTED_FILES += $(JVMCI_HOTSPOT_JAR) |
162 | 143 |
163 DISTRIBUTIONS = JVMCI_SERVICE JVMCI_API JVMCI_SERVICE_PROCESSOR JVMCI_HOTSPOTVMCONFIG JVMCI_HOTSPOTVMCONFIG_PROCESSOR JVMCI_HOTSPOT | 144 DISTRIBUTIONS = JVMCI_SERVICES JVMCI_API JVMCI_HOTSPOTVMCONFIG JVMCI_HOTSPOTVMCONFIG_PROCESSOR JVMCI_HOTSPOT |
164 | 145 |
165 $(JVMCI_SERVICE_JAR): $(JVMCI_SERVICE_SRC) | 146 $(JVMCI_SERVICES_JAR): $(JVMCI_SERVICES_SRC) |
166 $(call build_and_jar,,$(subst $(space),:,),,$(JVMCI_SERVICE_JAR)) | 147 $(call build_and_jar,,$(subst $(space),:,),,$(JVMCI_SERVICES_JAR)) |
167 | 148 |
168 | 149 |
169 $(JVMCI_API_JAR): $(JVMCI_API_SRC) $(JVMCI_API_DEP_JARS) | 150 $(JVMCI_API_JAR): $(JVMCI_API_SRC) $(JVMCI_API_DEP_JARS) |
170 $(call build_and_jar,,$(subst $(space),:,$(JVMCI_API_DEP_JARS)),,$(JVMCI_API_JAR)) | 151 $(call build_and_jar,,$(subst $(space),:,$(JVMCI_API_DEP_JARS)),,$(JVMCI_API_JAR)) |
171 | |
172 | |
173 $(JVMCI_SERVICE_PROCESSOR_JAR): $(JVMCI_SERVICE_PROCESSOR_SRC) $(JVMCI_SERVICE_PROCESSOR_DEP_JARS) | |
174 $(call build_and_jar,,$(subst $(space),:,$(JVMCI_SERVICE_PROCESSOR_DEP_JARS)),jvmci/jdk.vm.ci.service.processor/src/META-INF,$(JVMCI_SERVICE_PROCESSOR_JAR)) | |
175 | 152 |
176 | 153 |
177 $(JVMCI_HOTSPOTVMCONFIG_JAR): $(JVMCI_HOTSPOTVMCONFIG_SRC) | 154 $(JVMCI_HOTSPOTVMCONFIG_JAR): $(JVMCI_HOTSPOTVMCONFIG_SRC) |
178 $(call build_and_jar,,$(subst $(space),:,),,$(JVMCI_HOTSPOTVMCONFIG_JAR)) | 155 $(call build_and_jar,,$(subst $(space),:,),,$(JVMCI_HOTSPOTVMCONFIG_JAR)) |
179 | 156 |
180 | 157 |
181 $(JVMCI_HOTSPOTVMCONFIG_PROCESSOR_JAR): $(JVMCI_HOTSPOTVMCONFIG_PROCESSOR_SRC) $(JVMCI_HOTSPOTVMCONFIG_PROCESSOR_DEP_JARS) | 158 $(JVMCI_HOTSPOTVMCONFIG_PROCESSOR_JAR): $(JVMCI_HOTSPOTVMCONFIG_PROCESSOR_SRC) $(JVMCI_HOTSPOTVMCONFIG_PROCESSOR_DEP_JARS) |
182 $(call build_and_jar,,$(subst $(space),:,$(JVMCI_HOTSPOTVMCONFIG_PROCESSOR_DEP_JARS)),jvmci/jdk.vm.ci.hotspotvmconfig.processor/src/META-INF,$(JVMCI_HOTSPOTVMCONFIG_PROCESSOR_JAR)) | 159 $(call build_and_jar,,$(subst $(space),:,$(JVMCI_HOTSPOTVMCONFIG_PROCESSOR_DEP_JARS)),jvmci/jdk.vm.ci.hotspotvmconfig.processor/src/META-INF,$(JVMCI_HOTSPOTVMCONFIG_PROCESSOR_JAR)) |
183 | 160 |
184 | 161 |
185 $(JVMCI_HOTSPOT_JAR): $(JVMCI_HOTSPOT_SRC) $(JVMCI_HOTSPOTVMCONFIG_PROCESSOR_JAR) $(JVMCI_SERVICE_PROCESSOR_JAR) $(JVMCI_HOTSPOT_DEP_JARS) | 162 $(JVMCI_HOTSPOT_JAR): $(JVMCI_HOTSPOT_SRC) $(JVMCI_HOTSPOTVMCONFIG_PROCESSOR_JAR) $(JVMCI_HOTSPOT_DEP_JARS) |
186 $(call build_and_jar,$(JVMCI_HOTSPOTVMCONFIG_PROCESSOR_JAR):$(JVMCI_SERVICE_PROCESSOR_JAR):$(subst $(space),:,$(JVMCI_HOTSPOTVMCONFIG_PROCESSOR_DEP_JARS)):$(subst $(space),:,$(JVMCI_SERVICE_PROCESSOR_DEP_JARS)),$(subst $(space),:,$(JVMCI_HOTSPOT_DEP_JARS)),,$(JVMCI_HOTSPOT_JAR)) | 163 $(call build_and_jar,$(JVMCI_HOTSPOTVMCONFIG_PROCESSOR_JAR):$(subst $(space),:,$(JVMCI_HOTSPOTVMCONFIG_PROCESSOR_DEP_JARS)),$(subst $(space),:,$(JVMCI_HOTSPOT_DEP_JARS)),jvmci/jdk.vm.ci.hotspot.aarch64/src/META-INF jvmci/jdk.vm.ci.hotspot.amd64/src/META-INF jvmci/jdk.vm.ci.hotspot.sparc/src/META-INF jvmci/jdk.vm.ci.hotspot.jfr/src/META-INF,$(JVMCI_HOTSPOT_JAR)) |
187 | 164 |
188 | 165 |
189 default: $(JVMCI_SERVICE_JAR) $(JVMCI_API_JAR) $(JVMCI_HOTSPOT_JAR) $(JVMCI_HOTSPOTVMCONFIG_JAR) | 166 default: $(JVMCI_SERVICES_JAR) $(JVMCI_API_JAR) $(JVMCI_HOTSPOT_JAR) $(JVMCI_HOTSPOTVMCONFIG_JAR) |
190 .PHONY: default | 167 .PHONY: default |