Mercurial > hg > graal-jvmci-8
comparison make/jvmci.make @ 21920:35961ae3486f
Update jvmci.make
author | Stefan Anzinger <stefan.anzinger@oracle.com> |
---|---|
date | Thu, 11 Jun 2015 13:57:16 +0200 |
parents | 0df6a0cb4b5f |
children | 3a292e8b9e51 e701664f4168 |
comparison
equal
deleted
inserted
replaced
21919:62da3906ab7f | 21920:35961ae3486f |
---|---|
20 $(error Variable ABS_BOOTDIR must be set to a JDK installation.) | 20 $(error Variable ABS_BOOTDIR must be set to a JDK installation.) |
21 endif | 21 endif |
22 ifeq ($(MAKE_VERBOSE),) | 22 ifeq ($(MAKE_VERBOSE),) |
23 QUIETLY=@ | 23 QUIETLY=@ |
24 endif | 24 endif |
25 | |
26 # Required to construct a whitespace for use with subst | |
27 space := | |
28 space += | |
25 | 29 |
26 # Takes the option files of the options annotation processor and merges them into a single file | 30 # Takes the option files of the options annotation processor and merges them into a single file |
27 # Arguments: | 31 # Arguments: |
28 # 1: directory with contents of the JAR file | 32 # 1: directory with contents of the JAR file |
29 define process_options | 33 define process_options |
51 ((test ! -d .$(SERVICES_INF) || cp -r .$(SERVICES_INF) $(abspath $(2))) && (test ! -d .$(OPTIONS_INF) || cp -r .$(OPTIONS_INF) $(abspath $(2)))); | 55 ((test ! -d .$(SERVICES_INF) || cp -r .$(SERVICES_INF) $(abspath $(2))) && (test ! -d .$(OPTIONS_INF) || cp -r .$(OPTIONS_INF) $(abspath $(2)))); |
52 $(QUIETLY) rm -r $(TMP); | 56 $(QUIETLY) rm -r $(TMP); |
53 $(QUIETLY) cp $(1) $(2); | 57 $(QUIETLY) cp $(1) $(2); |
54 endef | 58 endef |
55 | 59 |
56 # Calls $(JAVAC) with the bootclasspath $(JDK_BOOTCLASSPATH); sources are taken from the automatic variable $? | 60 # Calls $(JAVAC) with the bootclasspath $(JDK_BOOTCLASSPATH); sources are taken from the automatic variable $^ |
57 # Arguments: | 61 # Arguments: |
58 # 1: processorpath | 62 # 1: processorpath |
59 # 2: classpath | 63 # 2: classpath |
60 # 3: resources to copy | 64 # 3: resources to copy |
61 # 4: target JAR file | 65 # 4: target JAR file |
62 define build_and_jar | 66 define build_and_jar |
63 $(info Building $(4)) | 67 $(info Building $(4)) |
64 $(eval TMP := $(shell mkdir -p $(TARGET) && mktemp -d $(TARGET)/tmp_XXXXX)) | 68 $(eval TMP := $(shell mkdir -p $(TARGET) && mktemp -d $(TARGET)/tmp_XXXXX)) |
65 $(QUIETLY) $(JAVAC) -d $(TMP) -processorpath :$(1) -bootclasspath $(JDK_BOOTCLASSPATH) -cp :$(2) $(filter %.java,$?); | 69 $(QUIETLY) $(JAVAC) -d $(TMP) -processorpath :$(1) -bootclasspath $(JDK_BOOTCLASSPATH) -cp :$(2) $(filter %.java,$^); |
66 $(QUIETLY) test "$(3)" = "" || cp -r $(3) $(TMP); | 70 $(QUIETLY) test "$(3)" = "" || cp -r $(3) $(TMP); |
67 $(QUIETLY) $(call process_options,$(TMP)); | 71 $(QUIETLY) $(call process_options,$(TMP)); |
68 $(QUIETLY) mkdir -p $(shell dirname $(4)) | 72 $(QUIETLY) mkdir -p $(shell dirname $(4)) |
69 $(QUIETLY) $(JAR) cf $(4) -C $(TMP) . | 73 $(QUIETLY) $(JAR) cf $(4) -C $(TMP) . |
70 $(QUIETLY) rm -r $(TMP); | 74 $(QUIETLY) rm -r $(TMP); |
75 endef | |
76 | |
77 # Verifies if the defs.make contain the exported files of services/ | |
78 define verify_export_def_make | |
79 $(foreach file,$(1),$(if $(shell grep '$(2)$(file)' $(3) > /dev/null && echo found), , $(error "Pattern '$(2)$(file)' not found in $(3)"))) | |
71 endef | 80 endef |
72 | 81 |
73 all: default | 82 all: default |
74 | 83 |
75 export: all | 84 export: all |
76 $(info Put $(EXPORTED_FILES) into SHARED_DIR $(SHARED_DIR)) | 85 $(info Put $(EXPORTED_FILES) into SHARED_DIR $(SHARED_DIR)) |
77 $(QUIETLY) mkdir -p $(SHARED_DIR) | 86 $(QUIETLY) mkdir -p $(SHARED_DIR) |
78 $(foreach export,$(EXPORTED_FILES),$(call extract,$(export),$(SHARED_DIR))) | 87 $(foreach export,$(EXPORTED_FILES),$(call extract,$(export),$(SHARED_DIR))) |
88 $(call verify_export_def_make,$(notdir $(wildcard $(SHARED_DIR)/services/*)),EXPORT_LIST += $$(EXPORT_JRE_LIB_JVMCI_SERVICES_DIR)/,make/defs.make) | |
89 $(call verify_export_def_make,$(notdir $(wildcard $(SHARED_DIR)/options/*)),EXPORT_LIST += $$(EXPORT_JRE_LIB_JVMCI_OPTIONS_DIR)/,make/defs.make) | |
79 .PHONY: export | 90 .PHONY: export |
80 | 91 |
81 | 92 |
82 | 93 |
83 JDK_BOOTCLASSPATH = $(ABS_BOOTDIR)/jre/lib/resources.jar:$(ABS_BOOTDIR)/jre/lib/rt.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 | 94 JDK_BOOTCLASSPATH = $(ABS_BOOTDIR)/jre/lib/resources.jar:$(ABS_BOOTDIR)/jre/lib/rt.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 |
133 JVMCI_HOTSPOT_DEP_JARS = $(TARGET)/build/jvmci-api.jar $(TARGET)/build/jvmci-service.jar jvmci/findbugs-SuppressFBWarnings.jar | 144 JVMCI_HOTSPOT_DEP_JARS = $(TARGET)/build/jvmci-api.jar $(TARGET)/build/jvmci-service.jar jvmci/findbugs-SuppressFBWarnings.jar |
134 | 145 |
135 EXPORTED_FILES += $(JVMCI_HOTSPOT_JAR) | 146 EXPORTED_FILES += $(JVMCI_HOTSPOT_JAR) |
136 | 147 |
137 $(JVMCI_OPTIONS_PROCESSOR_JAR): $(JVMCI_OPTIONS_PROCESSOR_SRC) | 148 $(JVMCI_OPTIONS_PROCESSOR_JAR): $(JVMCI_OPTIONS_PROCESSOR_SRC) |
138 $(call build_and_jar,,$(shell echo | tr ' ' ':'),jvmci/com.oracle.jvmci.options.processor/src/META-INF,$(JVMCI_OPTIONS_PROCESSOR_JAR)) | 149 $(call build_and_jar,,$(subst $(space),:,),jvmci/com.oracle.jvmci.options.processor/src/META-INF,$(JVMCI_OPTIONS_PROCESSOR_JAR)) |
139 | 150 |
140 | 151 |
141 $(JVMCI_HOTSPOTVMCONFIG_PROCESSOR_JAR): $(JVMCI_HOTSPOTVMCONFIG_PROCESSOR_SRC) | 152 $(JVMCI_HOTSPOTVMCONFIG_PROCESSOR_JAR): $(JVMCI_HOTSPOTVMCONFIG_PROCESSOR_SRC) |
142 $(call build_and_jar,,$(shell echo | tr ' ' ':'),jvmci/com.oracle.jvmci.hotspotvmconfig.processor/src/META-INF,$(JVMCI_HOTSPOTVMCONFIG_PROCESSOR_JAR)) | 153 $(call build_and_jar,,$(subst $(space),:,),jvmci/com.oracle.jvmci.hotspotvmconfig.processor/src/META-INF,$(JVMCI_HOTSPOTVMCONFIG_PROCESSOR_JAR)) |
143 | 154 |
144 | 155 |
145 $(JVMCI_SERVICE_PROCESSOR_JAR): $(JVMCI_SERVICE_PROCESSOR_SRC) | 156 $(JVMCI_SERVICE_PROCESSOR_JAR): $(JVMCI_SERVICE_PROCESSOR_SRC) |
146 $(call build_and_jar,,$(shell echo | tr ' ' ':'),jvmci/com.oracle.jvmci.service.processor/src/META-INF,$(JVMCI_SERVICE_PROCESSOR_JAR)) | 157 $(call build_and_jar,,$(subst $(space),:,),jvmci/com.oracle.jvmci.service.processor/src/META-INF,$(JVMCI_SERVICE_PROCESSOR_JAR)) |
147 | 158 |
148 | 159 |
149 $(JVMCI_API_JAR): $(JVMCI_API_SRC) $(JVMCI_OPTIONS_PROCESSOR_JAR) $(JVMCI_API_DEP_JARS) | 160 $(JVMCI_API_JAR): $(JVMCI_API_SRC) $(JVMCI_OPTIONS_PROCESSOR_JAR) $(JVMCI_API_DEP_JARS) |
150 $(call build_and_jar,$(JVMCI_OPTIONS_PROCESSOR_JAR),$(shell echo $(JVMCI_API_DEP_JARS) | tr ' ' ':'),,$(JVMCI_API_JAR)) | 161 $(call build_and_jar,$(JVMCI_OPTIONS_PROCESSOR_JAR),$(subst $(space),:,$(JVMCI_API_DEP_JARS)),,$(JVMCI_API_JAR)) |
151 | 162 |
152 | 163 |
153 $(JVMCI_SERVICE_JAR): $(JVMCI_SERVICE_SRC) $(JVMCI_SERVICE_DEP_JARS) | 164 $(JVMCI_SERVICE_JAR): $(JVMCI_SERVICE_SRC) $(JVMCI_SERVICE_DEP_JARS) |
154 $(call build_and_jar,,$(shell echo $(JVMCI_SERVICE_DEP_JARS) | tr ' ' ':'),,$(JVMCI_SERVICE_JAR)) | 165 $(call build_and_jar,,$(subst $(space),:,$(JVMCI_SERVICE_DEP_JARS)),,$(JVMCI_SERVICE_JAR)) |
155 | 166 |
156 | 167 |
157 $(JVMCI_HOTSPOT_JAR): $(JVMCI_HOTSPOT_SRC) $(JVMCI_HOTSPOTVMCONFIG_PROCESSOR_JAR) $(JVMCI_OPTIONS_PROCESSOR_JAR) $(JVMCI_SERVICE_PROCESSOR_JAR) $(JVMCI_HOTSPOT_DEP_JARS) | 168 $(JVMCI_HOTSPOT_JAR): $(JVMCI_HOTSPOT_SRC) $(JVMCI_HOTSPOTVMCONFIG_PROCESSOR_JAR) $(JVMCI_OPTIONS_PROCESSOR_JAR) $(JVMCI_SERVICE_PROCESSOR_JAR) $(JVMCI_HOTSPOT_DEP_JARS) |
158 $(call build_and_jar,$(JVMCI_HOTSPOTVMCONFIG_PROCESSOR_JAR):$(JVMCI_OPTIONS_PROCESSOR_JAR):$(JVMCI_SERVICE_PROCESSOR_JAR),$(shell echo $(JVMCI_HOTSPOT_DEP_JARS) | tr ' ' ':'),,$(JVMCI_HOTSPOT_JAR)) | 169 $(call build_and_jar,$(JVMCI_HOTSPOTVMCONFIG_PROCESSOR_JAR):$(JVMCI_OPTIONS_PROCESSOR_JAR):$(JVMCI_SERVICE_PROCESSOR_JAR),$(subst $(space),:,$(JVMCI_HOTSPOT_DEP_JARS)),,$(JVMCI_HOTSPOT_JAR)) |
159 | 170 |
160 | 171 |
161 default: $(JVMCI_API_JAR) $(JVMCI_SERVICE_JAR) $(JVMCI_HOTSPOT_JAR) | 172 default: $(JVMCI_API_JAR) $(JVMCI_SERVICE_JAR) $(JVMCI_HOTSPOT_JAR) |
162 .PHONY: default | 173 .PHONY: default |