summaryrefslogtreecommitdiff
path: root/rules/CC/EXPRESSIONS
diff options
context:
space:
mode:
Diffstat (limited to 'rules/CC/EXPRESSIONS')
-rw-r--r--rules/CC/EXPRESSIONS100
1 files changed, 79 insertions, 21 deletions
diff --git a/rules/CC/EXPRESSIONS b/rules/CC/EXPRESSIONS
index 34c0ed40..ab7c9224 100644
--- a/rules/CC/EXPRESSIONS
+++ b/rules/CC/EXPRESSIONS
@@ -1387,40 +1387,98 @@
, "else": {"type": "var", "name": "name"}
}
]
- , [ "binary"
+ , [ "binpath (in work)"
+ , {"type": "join", "$1": ["work/", {"type": "var", "name": "binpath"}]}
+ ]
+ , ["TOOLCHAIN_DIR", "../toolchain"]
+ , ["COMPILER", {"type": "CALL_EXPRESSION", "name": "compiler"}]
+ , [ "ENV"
+ , { "type": "map_union"
+ , "$1":
+ [ {"type": "var", "name": "ENV"}
+ , { "type": "singleton_map"
+ , "key": "PATH"
+ , "value":
+ { "type": "join"
+ , "separator": ":"
+ , "$1":
+ { "type": "++"
+ , "$1":
+ [ {"type": "CALL_EXPRESSION", "name": "default-PATH"}
+ , { "type": "if"
+ , "cond": {"type": "var", "name": "ENV_PATH"}
+ , "then": [{"type": "var", "name": "ENV_PATH"}]
+ }
+ ]
+ }
+ }
+ }
+ ]
+ }
+ ]
+ , [ "cmd"
+ , { "type": "++"
+ , "$1":
+ [ [ {"type": "var", "name": "COMPILER"}
+ , "-o"
+ , {"type": "var", "name": "binpath"}
+ ]
+ , {"type": "var", "name": "COMPILE_FLAGS"}
+ , {"type": "var", "name": "link-args"}
+ , {"type": "var", "name": "LDFLAGS"}
+ ]
+ }
+ ]
+ , [ "binary (in work)"
, { "type": "ACTION"
- , "outs": [{"type": "var", "name": "binpath"}]
+ , "outs": [{"type": "var", "name": "binpath (in work)"}]
, "inputs":
{ "type": "disjoint_map_union"
, "$1":
[ {"type": "var", "name": "TOOLCHAIN"}
- , {"type": "var", "name": "objects"}
- , {"type": "var", "name": "link-deps"}
- , { "type": "var"
- , "name": "cflags-files"
- , "default": {"type": "empty_map"}
- }
- , { "type": "var"
- , "name": "ldflags-files"
- , "default": {"type": "empty_map"}
+ , { "type": "to_subdir"
+ , "subdir": "work"
+ , "$1":
+ { "type": "disjoint_map_union"
+ , "$1":
+ [ {"type": "var", "name": "objects"}
+ , {"type": "var", "name": "link-deps"}
+ , { "type": "var"
+ , "name": "cflags-files"
+ , "default": {"type": "empty_map"}
+ }
+ , { "type": "var"
+ , "name": "ldflags-files"
+ , "default": {"type": "empty_map"}
+ }
+ ]
+ }
}
]
}
, "cmd":
- { "type": "++"
- , "$1":
- [ [ {"type": "var", "name": "COMPILER"}
- , "-o"
- , {"type": "var", "name": "binpath"}
+ [ "sh"
+ , "-c"
+ , { "type": "join"
+ , "$1":
+ [ "cd work && "
+ , {"type": "join_cmd", "$1": {"type": "var", "name": "cmd"}}
]
- , {"type": "var", "name": "COMPILE_FLAGS"}
- , {"type": "var", "name": "link-args"}
- , {"type": "var", "name": "LDFLAGS"}
- ]
- }
+ }
+ ]
, "env": {"type": "var", "name": "ENV"}
}
]
+ , [ "binary"
+ , { "type": "singleton_map"
+ , "key": {"type": "var", "name": "binpath"}
+ , "value":
+ { "type": "lookup"
+ , "map": {"type": "var", "name": "binary (in work)"}
+ , "key": {"type": "var", "name": "binpath (in work)"}
+ }
+ }
+ ]
]
, "body": {"type": "var", "name": "binary"}
}