Mercurial > hg > graal-jvmci-8
comparison make/jvmci.make @ 22398:4f6caa445b92
moved JVMCI option parsing back into Java
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Tue, 04 Aug 2015 00:47:34 +0200 |
parents | 528eeeca785e |
children | f45c8b5add13 |
comparison
equal
deleted
inserted
replaced
22397:7202e96981c6 | 22398:4f6caa445b92 |
---|---|
51 # 1: directory with contents of the JAR file | 51 # 1: directory with contents of the JAR file |
52 define process_options | 52 define process_options |
53 $(eval options := $(1)/$(OPTIONS_INF)) | 53 $(eval options := $(1)/$(OPTIONS_INF)) |
54 $(eval services := $(1)/META-INF/services) | 54 $(eval services := $(1)/META-INF/services) |
55 $(QUIETLY) test -d $(services) || mkdir -p $(services) | 55 $(QUIETLY) test -d $(services) || mkdir -p $(services) |
56 $(QUIETLY) test ! -d $(options) || (cd $(options) && for i in $$(ls); do echo $${i}_Options >> $(abspath $(services))/jdk.internal.jvmci.options.Options; done) | 56 $(QUIETLY) test ! -d $(options) || (cd $(options) && for i in $$(ls); do echo $${i}_OptionDescriptors >> $(abspath $(services))/jdk.internal.jvmci.options.Options; done) |
57 endef | 57 endef |
58 | 58 |
59 # Extracts META-INF/jvmci.services and META-INF/jvmci.options of a JAR file into a given directory | 59 # Extracts META-INF/jvmci.services from a JAR file into a given directory |
60 # Arguments: | 60 # Arguments: |
61 # 1: JAR file to extract | 61 # 1: JAR file to extract |
62 # 2: target directory (which already exists) | 62 # 2: target directory (which already exists) |
63 define extract | 63 define extract |
64 $(eval TMP := $(shell mktemp -d $(TARGET)/tmp_XXXXX)) | 64 $(eval TMP := $(shell mktemp -d $(TARGET)/tmp_XXXXX)) |
65 $(QUIETLY) cd $(TMP) && $(JAR) xf $(abspath $(1)) && \ | 65 $(QUIETLY) cd $(TMP) && $(JAR) xf $(abspath $(1)) && \ |
66 ((test ! -d .$(SERVICES_INF) || cp -r .$(SERVICES_INF) $(abspath $(2))) && \ | 66 (test ! -d .$(SERVICES_INF) || cp -r .$(SERVICES_INF) $(abspath $(2))); |
67 (test ! -d .$(OPTIONS_INF) || cp -r .$(OPTIONS_INF) $(abspath $(2)))); | |
68 $(QUIETLY) rm -r $(TMP); | 67 $(QUIETLY) rm -r $(TMP); |
69 $(QUIETLY) cp $(1) $(2) | 68 $(QUIETLY) cp $(1) $(2) |
70 endef | 69 endef |
71 | 70 |
72 # Calls $(JAVAC) with the boot class path $(JDK_BOOTCLASSPATH) and sources taken from the automatic variable $^ | 71 # Calls $(JAVAC) with the boot class path $(JDK_BOOTCLASSPATH) and sources taken from the automatic variable $^ |
85 $(QUIETLY) mkdir -p $(shell dirname $(4)) | 84 $(QUIETLY) mkdir -p $(shell dirname $(4)) |
86 $(QUIETLY) $(JAR) -0cf $(4) -C $(TMP) . | 85 $(QUIETLY) $(JAR) -0cf $(4) -C $(TMP) . |
87 $(QUIETLY) rm -r $(TMP) | 86 $(QUIETLY) rm -r $(TMP) |
88 endef | 87 endef |
89 | 88 |
90 # Verifies that make/defs.make contains an appropriate line for each JVMCI service or option | 89 # Verifies that make/defs.make contains an appropriate line for each JVMCI service |
91 # and that only existing JVMCI services and options are exported. | 90 # and that only existing JVMCI services are exported. |
92 # Arguments: | 91 # Arguments: |
93 # 1: list of service or option files | 92 # 1: list of service files |
94 # 2: variable name for directory of service or option files | 93 # 2: variable name for directory of service files |
95 define verify_defs_make | 94 define verify_defs_make |
96 $(eval defs := make/defs.make) | 95 $(eval defs := make/defs.make) |
97 $(eval uncondPattern := EXPORT_LIST += $$$$($(2))/) | 96 $(eval uncondPattern := EXPORT_LIST += $$$$($(2))/) |
98 $(eval condPattern := CONDITIONAL_EXPORT_LIST += $$$$($(2))/) | 97 $(eval condPattern := CONDITIONAL_EXPORT_LIST += $$$$($(2))/) |
99 $(eval unconditionalExports := $(shell grep '^EXPORT_LIST += $$($2)' make/defs.make | sed 's:.*($(2))/::g')) | 98 $(eval unconditionalExports := $(shell grep '^EXPORT_LIST += $$($2)' make/defs.make | sed 's:.*($(2))/::g')) |
108 $(shell mkdir -p $(SHARED_DIR)) | 107 $(shell mkdir -p $(SHARED_DIR)) |
109 $(foreach export,$(EXPORTED_FILES),$(call extract,$(export),$(SHARED_DIR))) | 108 $(foreach export,$(EXPORTED_FILES),$(call extract,$(export),$(SHARED_DIR))) |
110 | 109 |
111 export: all | 110 export: all |
112 $(call verify_defs_make,$(notdir $(wildcard $(SHARED_DIR)/jvmci.services/*)),EXPORT_JRE_LIB_JVMCI_SERVICES_DIR) | 111 $(call verify_defs_make,$(notdir $(wildcard $(SHARED_DIR)/jvmci.services/*)),EXPORT_JRE_LIB_JVMCI_SERVICES_DIR) |
113 $(call verify_defs_make,$(notdir $(wildcard $(SHARED_DIR)/jvmci.options/*)),EXPORT_JRE_LIB_JVMCI_OPTIONS_DIR) | |
114 .PHONY: export | 112 .PHONY: export |
115 | 113 |
116 clean: | 114 clean: |
117 $(QUIETLY) rm $(JARS) 2> /dev/null || true | 115 $(QUIETLY) rm $(JARS) 2> /dev/null || true |
118 $(QUIETLY) rmdir -p $(dir $(JARS)) 2> /dev/null || true | 116 $(QUIETLY) rmdir -p $(dir $(JARS)) 2> /dev/null || true |
126 | 124 |
127 JVMCI_SERVICE_JAR = $(TARGET)/jvmci-service.jar | 125 JVMCI_SERVICE_JAR = $(TARGET)/jvmci-service.jar |
128 | 126 |
129 EXPORTED_FILES += $(JVMCI_SERVICE_JAR) | 127 EXPORTED_FILES += $(JVMCI_SERVICE_JAR) |
130 | 128 |
131 JVMCI_OPTIONS_SRC = $(shell find jvmci/jdk.internal.jvmci.options/src -type f 2> /dev/null) | 129 JVMCI_OPTIONS_SRC = $(shell find jvmci/jdk.internal.jvmci.inittimer/src -type f 2> /dev/null) |
130 JVMCI_OPTIONS_SRC += $(shell find jvmci/jdk.internal.jvmci.options/src -type f 2> /dev/null) | |
132 | 131 |
133 JVMCI_OPTIONS_JAR = $(TARGET)/jvmci-options.jar | 132 JVMCI_OPTIONS_JAR = $(TARGET)/jvmci-options.jar |
134 | 133 |
135 EXPORTED_FILES += $(JVMCI_OPTIONS_JAR) | 134 EXPORTED_FILES += $(JVMCI_OPTIONS_JAR) |
136 | 135 |