diff options
Diffstat (limited to 'test/monniaux/genmake.py')
-rwxr-xr-x | test/monniaux/genmake.py | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/test/monniaux/genmake.py b/test/monniaux/genmake.py index ddbdf839..ad460b14 100755 --- a/test/monniaux/genmake.py +++ b/test/monniaux/genmake.py @@ -1,4 +1,4 @@ -#!/usr/bin/python3.4 +#!/usr/bin/python3.6 """ Custom Makefile generator @@ -26,7 +26,7 @@ gcc_k1c = Env(compiler = Compiler("gcc", "$(K1C_CC)"), optimizations = [Optim("" ccomp_x86 = Env(compiler = Compiler("ccomp", "$(CCOMP)"), optimizations = [Optim("", "$(CCOMPFLAGS)")], target = "host") ccomp_k1c = Env(compiler = Compiler("ccomp", "$(K1C_CCOMP)"), optimizations = [Optim("", "$(K1C_CCOMPFLAGS)")], target = "k1c") -environments = [gcc_x86, gcc_k1c, ccomp_x86, ccomp_k1c] +environments = [gcc_x86, ccomp_x86, gcc_k1c, ccomp_k1c] ## # Argument parsing @@ -36,7 +36,7 @@ if len(sys.argv) != 2: yaml_file = sys.argv[1] with open(yaml_file, "r") as f: - settings = yaml.load(f.read()) + settings = yaml.load(f.read(), Loader=yaml.FullLoader) basename = settings["target"] objdeps = settings["objdeps"] if "objdeps" in settings else [] @@ -86,13 +86,19 @@ def make_env_list(envs): def print_measure_rule(environments, measures): print("measures.csv: $(PRODUCTS_OUT)") - print(' echo ", {}" > $@'.format(make_env_list(environments))) + print(' echo "benches, {}" > $@'.format(make_env_list(environments))) for measure in measures: - print(' echo "{name} {measure}"'.format(name=basename if not name else name, measure=measure if len(measures) > 1 else ""), end="") + display_measure_name = (len(measures) > 1) + if isinstance(measure, list): + measure_name, measure_short = measure + display_measure_name = True + else: + measure_name = measure_short = measure + print(' echo "{name} {measure}"'.format(name=basename if not name else name, measure=measure_short if display_measure_name else ""), end="") for env in environments: for optim in env.optimizations: print(", $$(grep '{measure}' {outfile} | cut -d':' -f2)".format( - measure=measure, outfile=make_product(env, optim) + ".out"), end="") + measure=measure_name, outfile=make_product(env, optim) + ".out"), end="") print('>> $@') products = [] |