comparison mx.jvmci/mx_jvmci_makefile.py @ 22427:9c55f608b79e

Generate jvmci.make with all defined dependencies/bootclasspath regardless availability in the current enviornment
author Stefan Anzinger <stefan.anzinger@oracle.com>
date Mon, 17 Aug 2015 12:10:55 +0200
parents f45c8b5add13
children 1852abfbaca3
comparison
equal deleted inserted replaced
22426:f45c8b5add13 22427:9c55f608b79e
70 return [d.dist() for d in mx_jvmci.jdkDeployedDists] 70 return [d.dist() for d in mx_jvmci.jdkDeployedDists]
71 71
72 def _get_dependency_check(p): 72 def _get_dependency_check(p):
73 jarFinders = [] 73 jarFinders = []
74 for dep in p.deps: 74 for dep in p.deps:
75 if (dep.isJreLibrary() or dep.isJdkLibrary()) and dep.optional: 75 jar = None
76 jar = dep.classpath_repr(False) 76 if dep.isJreLibrary() and dep.optional:
77 jar = dep.jar
78 if dep.isJdkLibrary() and dep.optional:
79 jar = dep.path
80 if jar:
77 jarFinders.append("$(shell find $(ABS_BOOTDIR)/ -name '%s'; echo $$?)" % jar) 81 jarFinders.append("$(shell find $(ABS_BOOTDIR)/ -name '%s'; echo $$?)" % jar)
78 return "ifeq ({},'{}')".format("".join(jarFinders), "0" * len(jarFinders)) if len(jarFinders) > 0 else None 82 return "ifeq ({},'{}')".format("".join(jarFinders), "0" * len(jarFinders)) if len(jarFinders) > 0 else None
79 83
80 def make_dist_rule(dist, mf): 84 def make_dist_rule(dist, mf):
81 def path_dist_relative(p): 85 def path_dist_relative(p):
92 96
93 classPath = [targetPathPrefix + os.path.basename(e.path) for e in mx.classpath_entries(dist, includeSelf=False, preferProjects=False)] 97 classPath = [targetPathPrefix + os.path.basename(e.path) for e in mx.classpath_entries(dist, includeSelf=False, preferProjects=False)]
94 for p in projects: 98 for p in projects:
95 projectDir = path_dist_relative(p.dir) 99 projectDir = path_dist_relative(p.dir)
96 annotationProcessorDeps.update(p.declaredAnnotationProcessors) 100 annotationProcessorDeps.update(p.declaredAnnotationProcessors)
97 depCheck = _get_dependency_check(p) 101 depCheck = _get_dependency_check(p)
98 if depCheck: 102 if depCheck:
99 sources.append(depCheck) 103 sources.append(depCheck)
100 for src in [projectDir + '/' + d for d in p.srcDirs]: 104 for src in [projectDir + '/' + d for d in p.srcDirs]:
101 sources.append(sourcesVariableName + " += $(shell find {} -type f 2> /dev/null)".format(src)) 105 sources.append(sourcesVariableName + " += $(shell find {} -type f 2> /dev/null)".format(src))
102 metaInf = src + "/META-INF" 106 metaInf = src + "/META-INF"
137 141
138 142
139 143
140 def do_build_makefile(mf, selectedDists): 144 def do_build_makefile(mf, selectedDists):
141 jdk = mx.get_jdk() 145 jdk = mx.get_jdk()
142 bootClassPath = jdk.bootclasspath() 146 bootClassPath = jdk.bootclasspath(filtered=False)
143 bootClassPath = bootClassPath.replace(os.path.realpath(jdk.home), "$(ABS_BOOTDIR)") 147 bootClassPath = bootClassPath.replace(os.path.realpath(jdk.home), "$(ABS_BOOTDIR)")
144 jdkBootClassPathVariableName = "JDK_BOOTCLASSPATH" 148 jdkBootClassPathVariableName = "JDK_BOOTCLASSPATH"
145 149
146 mf.add_definition("""# This Makefile is generated automatically, do not edit 150 mf.add_definition("""# This Makefile is generated automatically, do not edit
147 151