Mercurial > hg > truffle
comparison mx/mx_graal_makefile.py @ 21740:6c3c21d9b5ef
Add -m switch to mx build, which builds/exports JVMCI with the make/jvmci.make file
author | Stefan Anzinger <stefan.anzinger@oracle.com> |
---|---|
date | Fri, 05 Jun 2015 10:00:06 +0200 |
parents | 73809f97c281 |
children | 6db6070d30b9 |
comparison
equal
deleted
inserted
replaced
21739:73809f97c281 | 21740:6c3c21d9b5ef |
---|---|
49 parser.add_argument('-o', action='store', dest='output', help='Write contents to this file.') | 49 parser.add_argument('-o', action='store', dest='output', help='Write contents to this file.') |
50 parser.add_argument('selectedDists', help="Selected distribution names which are going to be built with make.", nargs=REMAINDER) | 50 parser.add_argument('selectedDists', help="Selected distribution names which are going to be built with make.", nargs=REMAINDER) |
51 args = parser.parse_args(args) | 51 args = parser.parse_args(args) |
52 | 52 |
53 if args.selectedDists == None or len(args.selectedDists) == 0: | 53 if args.selectedDists == None or len(args.selectedDists) == 0: |
54 parser.print_help() | 54 args.selectedDists = [d.name for d in mx_graal._jdkDeployedDists if d.partOfHotSpot] |
55 return | |
56 mf = Makefile() | 55 mf = Makefile() |
57 if do_build_makefile(mf, args.selectedDists): | 56 if do_build_makefile(mf, args.selectedDists): |
58 contents = mf.generate() | 57 contents = mf.generate() |
59 if args.output == None: | 58 if args.output == None: |
60 print contents | 59 print contents |
188 define process_options = | 187 define process_options = |
189 $(eval providers=$(1)/$(PROVIDERS_INF)) | 188 $(eval providers=$(1)/$(PROVIDERS_INF)) |
190 $(eval services=$(1)/$(SERVICES_INF)) | 189 $(eval services=$(1)/$(SERVICES_INF)) |
191 $(eval options=$(1)/$(OPTIONS_INF)) | 190 $(eval options=$(1)/$(OPTIONS_INF)) |
192 test -d $(services) || mkdir -p $(services) | 191 test -d $(services) || mkdir -p $(services) |
193 test ! -d $(providers) || (cd $(providers) && for i in $$(ls $(providers)); do c=$$(cat $$i); echo $$i >> $(services)$$c; rm $$i; done) | 192 test ! -d $(providers) || (cd $(providers) && for i in $$(ls); do c=$$(cat $$i); echo $$i >> $(abspath $(services))/$$c; rm $$i; done) |
194 | 193 |
195 # 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 | 194 # 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 |
196 $(eval vmconfig=$(1)/hotspot/HotSpotVMConfig.inline.hpp) | 195 $(eval vmconfig=$(1)/hotspot/HotSpotVMConfig.inline.hpp) |
197 $(eval vmconfigDest=$(HS_COMMON_SRC)/../graal/com.oracle.jvmci.hotspot/src_gen/hotspot) | 196 $(eval vmconfigDest=$(HS_COMMON_SRC)/../graal/com.oracle.jvmci.hotspot/src_gen/hotspot) |
198 test ! -f $(vmconfig) || (mkdir -p $(vmconfigDest) && cp $(vmconfig) $(vmconfigDest)) | 197 test ! -f $(vmconfig) || (mkdir -p $(vmconfigDest) && cp $(vmconfig) $(vmconfigDest)) |
199 endef | 198 endef |
200 | 199 |
201 define extract = | 200 define extract = |
202 $(eval TMP := $(shell mktemp -d $(1)_XXXXX)) | 201 $(eval TMP := $(shell mktemp -d $(1)_XXXXX)) |
203 mkdir -p $(2); | 202 mkdir -p $(2) |
204 cd $(TMP) && $(JAR) xf $(abspath $(1)) && \ | 203 cd $(TMP) && $(JAR) xf $(abspath $(1)) && \ |
205 ((test ! -d .$(SERVICES_INF) || cp -r .$(SERVICES_INF) $(abspath $(2))) && (test ! -d .$(OPTIONS_INF) || cp -r .$(OPTIONS_INF) $(abspath $(2)))) | 204 ((test ! -d .$(SERVICES_INF) || cp -r .$(SERVICES_INF) $(abspath $(2))) && (test ! -d .$(OPTIONS_INF) || cp -r .$(OPTIONS_INF) $(abspath $(2)))) |
206 rm -r $(TMP) | 205 rm -r $(TMP) |
207 cp $(1) $(2) | 206 cp $(1) $(2) |
208 endef | 207 endef |
222 projects = set() | 221 projects = set() |
223 for d in s.dists: | 222 for d in s.dists: |
224 if d.name in selectedDists: | 223 if d.name in selectedDists: |
225 dists.update(d.get_dist_deps(True, True)) | 224 dists.update(d.get_dist_deps(True, True)) |
226 projects.update(d.sorted_deps(includeLibs=False, transitive=True)) | 225 projects.update(d.sorted_deps(includeLibs=False, transitive=True)) |
226 | |
227 for p in projects: | 227 for p in projects: |
228 deps = p.all_deps([], False, includeSelf=True, includeJreLibs=False, includeAnnotationProcessors=True) | 228 deps = p.all_deps([], False, includeSelf=True, includeJreLibs=False, includeAnnotationProcessors=True) |
229 for d in deps: | 229 for d in deps: |
230 if d.definedAnnotationProcessorsDist != None: | 230 if d.definedAnnotationProcessorsDist != None: |
231 apd = d.definedAnnotationProcessorsDist | 231 apd = d.definedAnnotationProcessorsDist |
232 ap.add(apd) | 232 ap.add(apd) |
233 | |
234 for d in mx_graal._jdkDeployedDists: | |
235 dist = mx.distribution(d.name) | |
236 if dist not in dists: # this sould go away | |
237 mf.add_definition("EXPORTED_FILES += $(MX_TARGET)/{}".format(os.path.relpath(dist.path, dist.suite.dir))) | |
238 | 233 |
239 if len(dists) > 0: | 234 if len(dists) > 0: |
240 mf.add_definition(jdkBootClassPathVariableName + " = " + bootClassPath) | 235 mf.add_definition(jdkBootClassPathVariableName + " = " + bootClassPath) |
241 bootClassPathVarAccess = "$(" + jdkBootClassPathVariableName + ")" | 236 bootClassPathVarAccess = "$(" + jdkBootClassPathVariableName + ")" |
242 for d in ap: make_dist_rule(d, mf, bootClassPathVarAccess) | 237 for d in ap: make_dist_rule(d, mf, bootClassPathVarAccess) |