comparison mx/mx_graal_makefile.py @ 21943:31be1c8f4905

switched to use of simple makefile assignment in jvmci.make and removed unnecessary semicolons
author Doug Simon <doug.simon@oracle.com>
date Fri, 12 Jun 2015 15:33:11 +0200
parents eac31af360db
children b121c00d3c4c
comparison
equal deleted inserted replaced
21942:ebc99adcd766 21943:31be1c8f4905
188 # Takes the provider files created by ServiceProviderProcessor (the processor 188 # Takes the provider files created by ServiceProviderProcessor (the processor
189 # for the @ServiceProvider annotation) and merges them into a single file. 189 # for the @ServiceProvider annotation) and merges them into a single file.
190 # Arguments: 190 # Arguments:
191 # 1: directory with contents of the JAR file 191 # 1: directory with contents of the JAR file
192 define process_providers 192 define process_providers
193 $(eval providers=$(1)/$(PROVIDERS_INF)) 193 $(eval providers := $(1)/$(PROVIDERS_INF))
194 $(eval services=$(1)/$(SERVICES_INF)) 194 $(eval services := $(1)/$(SERVICES_INF))
195 $(QUIETLY) test -d $(services) || mkdir -p $(services) 195 $(QUIETLY) test -d $(services) || mkdir -p $(services)
196 $(QUIETLY) test ! -d $(providers) || (cd $(providers) && for i in $$(ls); do c=$$(cat $$i); echo $$i >> $(abspath $(services))/$$c; rm $$i; done) 196 $(QUIETLY) test ! -d $(providers) || (cd $(providers) && for i in $$(ls); do c=$$(cat $$i); echo $$i >> $(abspath $(services))/$$c; rm $$i; done)
197 197
198 @# Since all projects are built together with one javac call we cannot determine 198 @# Since all projects are built together with one javac call we cannot determine
199 @# which project contains HotSpotVMConfig.inline.hpp so we hardcode it. 199 @# which project contains HotSpotVMConfig.inline.hpp so we hardcode it.
200 $(eval vmconfig=$(1)/hotspot/HotSpotVMConfig.inline.hpp) 200 $(eval vmconfig := $(1)/hotspot/HotSpotVMConfig.inline.hpp)
201 $(eval vmconfigDest=$(HS_COMMON_SRC)/../jvmci/com.oracle.jvmci.hotspot/src_gen/hotspot) 201 $(eval vmconfigDest := $(HS_COMMON_SRC)/../jvmci/com.oracle.jvmci.hotspot/src_gen/hotspot)
202 $(QUIETLY) test ! -f $(vmconfig) || (mkdir -p $(vmconfigDest) && cp $(vmconfig) $(vmconfigDest)) 202 $(QUIETLY) test ! -f $(vmconfig) || (mkdir -p $(vmconfigDest) && cp $(vmconfig) $(vmconfigDest))
203 endef 203 endef
204 204
205 # Reads the files in jvmci.options/ created by OptionProcessor (the processor for the @Option annotation) 205 # Reads the files in jvmci.options/ created by OptionProcessor (the processor for the @Option annotation)
206 # and appends to services/com.oracle.jvmci.options.Options entries for the providers 206 # and appends to services/com.oracle.jvmci.options.Options entries for the providers
207 # also created by the same processor. 207 # also created by the same processor.
208 # Arguments: 208 # Arguments:
209 # 1: directory with contents of the JAR file 209 # 1: directory with contents of the JAR file
210 define process_options 210 define process_options
211 $(eval options=$(1)/$(OPTIONS_INF)) 211 $(eval options := $(1)/$(OPTIONS_INF))
212 $(eval services=$(1)/META-INF/services) 212 $(eval services := $(1)/META-INF/services)
213 $(QUIETLY) test -d $(services) || mkdir -p $(services) 213 $(QUIETLY) test -d $(services) || mkdir -p $(services)
214 $(QUIETLY) test ! -d $(options) || (cd $(options) && for i in $$(ls); do echo $${i}_Options >> $(abspath $(services))/com.oracle.jvmci.options.Options; done) 214 $(QUIETLY) test ! -d $(options) || (cd $(options) && for i in $$(ls); do echo $${i}_Options >> $(abspath $(services))/com.oracle.jvmci.options.Options; done)
215 endef 215 endef
216 216
217 # Extracts META-INF/jvmci.services and META-INF/jvmci.options of a JAR file into a given directory 217 # Extracts META-INF/jvmci.services and META-INF/jvmci.options of a JAR file into a given directory
218 # Arguments: 218 # Arguments:
219 # 1: JAR file to extract 219 # 1: JAR file to extract
220 # 2: target directory 220 # 2: target directory (which already exists)
221 define extract 221 define extract
222 $(eval TMP := $(shell mktemp -d $(TARGET)/tmp_XXXXX)) 222 $(eval TMP := $(shell mktemp -d $(TARGET)/tmp_XXXXX))
223 $(QUIETLY) mkdir -p $(2)
224 $(QUIETLY) cd $(TMP) && $(JAR) xf $(abspath $(1)) && \\ 223 $(QUIETLY) cd $(TMP) && $(JAR) xf $(abspath $(1)) && \\
225 ((test ! -d .$(SERVICES_INF) || cp -r .$(SERVICES_INF) $(abspath $(2))) && \\ 224 ((test ! -d .$(SERVICES_INF) || cp -r .$(SERVICES_INF) $(abspath $(2))) && \\
226 (test ! -d .$(OPTIONS_INF) || cp -r .$(OPTIONS_INF) $(abspath $(2)))) 225 (test ! -d .$(OPTIONS_INF) || cp -r .$(OPTIONS_INF) $(abspath $(2))));
227 $(QUIETLY) rm -r $(TMP) 226 $(QUIETLY) rm -r $(TMP);
228 $(QUIETLY) cp $(1) $(2) 227 $(QUIETLY) cp $(1) $(2)
229 endef 228 endef
230 229
231 # Calls $(JAVAC) with the boot class path $(JDK_BOOTCLASSPATH) and sources taken from the automatic variable $^ 230 # Calls $(JAVAC) with the boot class path $(JDK_BOOTCLASSPATH) and sources taken from the automatic variable $^
232 # Arguments: 231 # Arguments:
250 # and that only existing JVMCI services and options are exported. 249 # and that only existing JVMCI services and options are exported.
251 # Arguments: 250 # Arguments:
252 # 1: list of service or option files 251 # 1: list of service or option files
253 # 2: prefix to apply to each file to create match pattern 252 # 2: prefix to apply to each file to create match pattern
254 define verify_defs_make 253 define verify_defs_make
255 $(eval defs=make/defs.make) 254 $(eval defs := make/defs.make)
256 $(eval exports=$(shell grep '$(2)' make/defs.make | sed 's:.*$(2)::g')) 255 $(eval exports := $(shell grep '$(2)' make/defs.make | sed 's:.*$(2)::g'))
257 $(foreach file,$(1),$(if $(findstring $(file),$(exports)), ,$(error "Pattern '$(2)$(file)' not found in $(defs)"))) 256 $(foreach file,$(1),$(if $(findstring $(file),$(exports)), ,$(error "Pattern '$(2)$(file)' not found in $(defs)")))
258 $(foreach export,$(exports),$(if $(findstring $(export),$(1)), ,$(error "The line '$(2)$(export)' should not be in $(defs)"))) 257 $(foreach export,$(exports),$(if $(findstring $(export),$(1)), ,$(error "The line '$(2)$(export)' should not be in $(defs)")))
259 endef 258 endef
260 259
261 all: default 260 all: default