Mercurial > hg > graal-jvmci-8
comparison make/jvmci.make @ 21718:b5bbf03bc17a
Improve makefile generator, exporting files into shared dir (JBS:GRAAL-52)
author | Stefan Anzinger <stefan.anzinger@oracle.com> |
---|---|
date | Thu, 04 Jun 2015 03:21:58 +0200 |
parents | |
children | cbe8cc0f79ce |
comparison
equal
deleted
inserted
replaced
21717:a3315bce5192 | 21718:b5bbf03bc17a |
---|---|
1 [?1034hVERBOSE= | |
2 TARGET=. | |
3 JDK= | |
4 | |
5 WGET=wget | |
6 JAVAC=$(JDK)/bin/javac -g -target 1.8 | |
7 JAR=$(JDK)/bin/jar | |
8 | |
9 EXPORT_DIR=export | |
10 EXPORTED_FILES_ADDITIONAL=$(TARGET)/options $(TARGET)/services | |
11 HS_COMMON_SRC=. | |
12 # where all other stuff built by mx (graal.jar) resides | |
13 MX_TARGET=. | |
14 PROVIDERS_INF=/META-INF/providers/ | |
15 SERVICES_INF=/META-INF/services/ | |
16 OPTIONS_INF=/META-INF/options/ | |
17 | |
18 ifeq ($(JDK),) | |
19 $(error Variable JDK must be set to a JDK installation.) | |
20 endif | |
21 ifneq ($(VERBOSE),) | |
22 SHELL=sh -x | |
23 endif | |
24 | |
25 define process_options = | |
26 $(eval providers=$(1)/$(PROVIDERS_INF)) | |
27 $(eval services=$(1)/$(SERVICES_INF)) | |
28 $(eval options=$(1)/$(OPTIONS_INF)) | |
29 test -d $(services) || mkdir -p $(services) | |
30 test ! -d $(providers) || (cd $(providers) && for i in $$(ls $(providers)); do c=$$(cat $$i); echo $$i >> $(services)$$c; rm $$i; done) | |
31 | |
32 # We're building all projects together with one javac call; thus we cannot determine, from which project the generated file is thus we hardcode it for now | |
33 $(eval vmconfig=$(1)/hotspot/HotSpotVMConfig.inline.hpp) | |
34 $(eval vmconfigDest=$(HS_COMMON_SRC)/../graal/com.oracle.jvmci.hotspot/src_gen/hotspot) | |
35 test ! -f $(vmconfig) || (mkdir -p $(vmconfigDest) && cp $(vmconfig) $(vmconfigDest)) | |
36 endef | |
37 | |
38 define extract = | |
39 $(eval TMP := $(shell mktemp -d)) | |
40 mkdir -p $(2); | |
41 cd $(TMP) && $(JAR) xf $(abspath $(1)) && ((test ! -d .$(SERVICES_INF) || cp -r .$(SERVICES_INF) $(abspath $(2))) && (test ! -d .$(OPTIONS_INF) || cp -r .$(OPTIONS_INF) $(abspath $(2)))) | |
42 rm -r $(TMP) | |
43 cp $(1) $(2) | |
44 endef | |
45 | |
46 | |
47 all: default | |
48 | |
49 export: all | |
50 mkdir -p $(EXPORT_DIR) | |
51 $(foreach export,$(EXPORTED_FILES),$(call extract,$(export),$(EXPORT_DIR))) | |
52 .PHONY: export | |
53 | |
54 | |
55 | |
56 EXPORTED_FILES += $(MX_TARGET)/build/truffle.jar | |
57 | |
58 EXPORTED_FILES += $(MX_TARGET)/build/graal.jar | |
59 | |
60 EXPORTED_FILES += $(MX_TARGET)/build/graal-truffle.jar | |
61 | |
62 JDK_BOOTCLASSPATH = $(JDK)/jre/lib/resources.jar:$(JDK)/jre/lib/rt.jar:$(JDK)/jre/lib/jsse.jar:$(JDK)/jre/lib/jce.jar:$(JDK)/jre/lib/charsets.jar:$(JDK)/jre/lib/jfr.jar | |
63 | |
64 COM_ORACLE_JVMCI_OPTIONS_PROCESSOR_SRC = $(shell find graal/com.oracle.jvmci.service/src -type f -name *.java 2> /dev/null) | |
65 COM_ORACLE_JVMCI_OPTIONS_PROCESSOR_SRC += $(shell find graal/com.oracle.jvmci.options/src -type f -name *.java 2> /dev/null) | |
66 COM_ORACLE_JVMCI_OPTIONS_PROCESSOR_SRC += $(shell find graal/com.oracle.jvmci.options.processor/src -type f -name *.java 2> /dev/null) | |
67 | |
68 COM_ORACLE_JVMCI_OPTIONS_PROCESSOR_JAR = $(TARGET)/graal/com.oracle.jvmci.options.processor/ap/com.oracle.jvmci.options.processor.jar | |
69 | |
70 COM_ORACLE_JVMCI_HOTSPOTVMCONFIG_PROCESSOR_SRC = $(shell find graal/com.oracle.jvmci.hotspotvmconfig/src -type f -name *.java 2> /dev/null) | |
71 COM_ORACLE_JVMCI_HOTSPOTVMCONFIG_PROCESSOR_SRC += $(shell find graal/com.oracle.jvmci.common/src -type f -name *.java 2> /dev/null) | |
72 COM_ORACLE_JVMCI_HOTSPOTVMCONFIG_PROCESSOR_SRC += $(shell find graal/com.oracle.jvmci.hotspotvmconfig.processor/src -type f -name *.java 2> /dev/null) | |
73 | |
74 COM_ORACLE_JVMCI_HOTSPOTVMCONFIG_PROCESSOR_JAR = $(TARGET)/graal/com.oracle.jvmci.hotspotvmconfig.processor/ap/com.oracle.jvmci.hotspotvmconfig.processor.jar | |
75 | |
76 JVMCI_SERVICE_SRC = $(shell find graal/com.oracle.jvmci.service/src -type f -name *.java 2> /dev/null) | |
77 | |
78 JVMCI_SERVICE_JAR = $(TARGET)/build/jvmci-service.jar | |
79 | |
80 JVMCI_SERVICE_DEP_JARS = lib/findbugs-SuppressFBWarnings.jar | |
81 | |
82 EXPORTED_FILES += $(JVMCI_SERVICE_JAR) | |
83 | |
84 JVMCI_HOTSPOT_SRC = $(shell find graal/com.oracle.jvmci.hotspotvmconfig/src -type f -name *.java 2> /dev/null) | |
85 JVMCI_HOTSPOT_SRC += $(shell find graal/com.oracle.jvmci.hotspotvmconfig/graal/com.oracle.jvmci.hotspotvmconfig/src_gen -type f -name *.java 2> /dev/null) | |
86 JVMCI_HOTSPOT_SRC += $(shell find graal/com.oracle.jvmci.hotspot/src -type f -name *.java 2> /dev/null) | |
87 JVMCI_HOTSPOT_SRC += $(shell find graal/com.oracle.jvmci.hotspot/graal/com.oracle.jvmci.hotspot/src_gen -type f -name *.java 2> /dev/null) | |
88 | |
89 JVMCI_HOTSPOT_JAR = $(TARGET)/build/jvmci-hotspot.jar | |
90 | |
91 JVMCI_HOTSPOT_DEP_JARS = $(TARGET)/build/jvmci-service.jar $(TARGET)/build/jvmci-api.jar lib/findbugs-SuppressFBWarnings.jar | |
92 | |
93 EXPORTED_FILES += $(JVMCI_HOTSPOT_JAR) | |
94 | |
95 JVMCI_API_SRC = $(shell find graal/com.oracle.jvmci.meta/src -type f -name *.java 2> /dev/null) | |
96 JVMCI_API_SRC += $(shell find graal/com.oracle.jvmci.code/src -type f -name *.java 2> /dev/null) | |
97 JVMCI_API_SRC += $(shell find graal/com.oracle.jvmci.runtime/src -type f -name *.java 2> /dev/null) | |
98 JVMCI_API_SRC += $(shell find graal/com.oracle.jvmci.options/src -type f -name *.java 2> /dev/null) | |
99 JVMCI_API_SRC += $(shell find graal/com.oracle.jvmci.common/src -type f -name *.java 2> /dev/null) | |
100 JVMCI_API_SRC += $(shell find graal/com.oracle.jvmci.debug/src -type f -name *.java 2> /dev/null) | |
101 | |
102 JVMCI_API_JAR = $(TARGET)/build/jvmci-api.jar | |
103 | |
104 JVMCI_API_DEP_JARS = $(TARGET)/build/jvmci-service.jar lib/findbugs-SuppressFBWarnings.jar | |
105 | |
106 EXPORTED_FILES += $(JVMCI_API_JAR) | |
107 | |
108 $(COM_ORACLE_JVMCI_OPTIONS_PROCESSOR_JAR): $(COM_ORACLE_JVMCI_OPTIONS_PROCESSOR_SRC) | |
109 $(eval TMP := $(shell mktemp -d)) | |
110 $(JAVAC) -d $(TMP) -bootclasspath $(JDK_BOOTCLASSPATH) $(COM_ORACLE_JVMCI_OPTIONS_PROCESSOR_SRC) | |
111 cp -r graal/com.oracle.jvmci.options.processor/src/META-INF $(TMP) | |
112 $(call process_options,$(TMP),False) | |
113 mkdir -p $$(dirname $(COM_ORACLE_JVMCI_OPTIONS_PROCESSOR_JAR)) | |
114 $(JAR) cf $(COM_ORACLE_JVMCI_OPTIONS_PROCESSOR_JAR) -C $(TMP) . | |
115 rm -r $(TMP) | |
116 | |
117 $(COM_ORACLE_JVMCI_HOTSPOTVMCONFIG_PROCESSOR_JAR): $(COM_ORACLE_JVMCI_HOTSPOTVMCONFIG_PROCESSOR_SRC) | |
118 $(eval TMP := $(shell mktemp -d)) | |
119 $(JAVAC) -d $(TMP) -bootclasspath $(JDK_BOOTCLASSPATH) $(COM_ORACLE_JVMCI_HOTSPOTVMCONFIG_PROCESSOR_SRC) | |
120 cp -r graal/com.oracle.jvmci.hotspotvmconfig.processor/src/META-INF $(TMP) | |
121 $(call process_options,$(TMP),False) | |
122 mkdir -p $$(dirname $(COM_ORACLE_JVMCI_HOTSPOTVMCONFIG_PROCESSOR_JAR)) | |
123 $(JAR) cf $(COM_ORACLE_JVMCI_HOTSPOTVMCONFIG_PROCESSOR_JAR) -C $(TMP) . | |
124 rm -r $(TMP) | |
125 | |
126 $(JVMCI_SERVICE_JAR): $(JVMCI_SERVICE_SRC) $(JVMCI_SERVICE_DEP_JARS) | |
127 $(eval TMP := $(shell mktemp -d)) | |
128 $(JAVAC) -d $(TMP) -bootclasspath $(JDK_BOOTCLASSPATH) -cp lib/findbugs-SuppressFBWarnings.jar $(JVMCI_SERVICE_SRC) | |
129 | |
130 $(call process_options,$(TMP),True) | |
131 mkdir -p $$(dirname $(JVMCI_SERVICE_JAR)) | |
132 $(JAR) cf $(JVMCI_SERVICE_JAR) -C $(TMP) . | |
133 rm -r $(TMP) | |
134 | |
135 $(JVMCI_HOTSPOT_JAR): $(JVMCI_HOTSPOT_SRC) $(COM_ORACLE_JVMCI_HOTSPOTVMCONFIG_PROCESSOR_JAR) $(COM_ORACLE_JVMCI_OPTIONS_PROCESSOR_JAR) $(JVMCI_HOTSPOT_DEP_JARS) | |
136 $(eval TMP := $(shell mktemp -d)) | |
137 $(JAVAC) -d $(TMP) -processorpath $(COM_ORACLE_JVMCI_HOTSPOTVMCONFIG_PROCESSOR_JAR):$(COM_ORACLE_JVMCI_OPTIONS_PROCESSOR_JAR) -bootclasspath $(JDK_BOOTCLASSPATH) -cp $(TARGET)/build/jvmci-service.jar:$(TARGET)/build/jvmci-api.jar:lib/findbugs-SuppressFBWarnings.jar $(JVMCI_HOTSPOT_SRC) | |
138 | |
139 $(call process_options,$(TMP),True) | |
140 mkdir -p $$(dirname $(JVMCI_HOTSPOT_JAR)) | |
141 $(JAR) cf $(JVMCI_HOTSPOT_JAR) -C $(TMP) . | |
142 rm -r $(TMP) | |
143 | |
144 $(JVMCI_API_JAR): $(JVMCI_API_SRC) $(JVMCI_API_DEP_JARS) | |
145 $(eval TMP := $(shell mktemp -d)) | |
146 $(JAVAC) -d $(TMP) -bootclasspath $(JDK_BOOTCLASSPATH) -cp $(TARGET)/build/jvmci-service.jar:lib/findbugs-SuppressFBWarnings.jar $(JVMCI_API_SRC) | |
147 | |
148 $(call process_options,$(TMP),True) | |
149 mkdir -p $$(dirname $(JVMCI_API_JAR)) | |
150 $(JAR) cf $(JVMCI_API_JAR) -C $(TMP) . | |
151 rm -r $(TMP) | |
152 | |
153 default: $(JVMCI_SERVICE_JAR) $(JVMCI_HOTSPOT_JAR) $(JVMCI_API_JAR) | |
154 .PHONY: default |