summaryrefslogtreecommitdiff
path: root/CC/foreign/make/EXPRESSIONS
diff options
context:
space:
mode:
authorOliver Reiche <oliver.reiche@huawei.com>2023-02-14 15:40:56 +0100
committerOliver Reiche <oliver.reiche@huawei.com>2023-05-30 15:33:18 +0200
commit52f36d3c99c0327ccba50dede36645432af798df (patch)
tree7bfbfca02704e459ef4cf28954ec5d79fdc28d0a /CC/foreign/make/EXPRESSIONS
parentb09fa46239f251d5499dea26b313e4f9ef9b1aac (diff)
downloadrules-cc-52f36d3c99c0327ccba50dede36645432af798df.tar.gz
rules-cc: Use field_map_provider for default-ENV
Diffstat (limited to 'CC/foreign/make/EXPRESSIONS')
-rw-r--r--CC/foreign/make/EXPRESSIONS190
1 files changed, 86 insertions, 104 deletions
diff --git a/CC/foreign/make/EXPRESSIONS b/CC/foreign/make/EXPRESSIONS
index e853b29..85179a9 100644
--- a/CC/foreign/make/EXPRESSIONS
+++ b/CC/foreign/make/EXPRESSIONS
@@ -80,115 +80,97 @@
, [ "ENV"
, { "type": "map_union"
, "$1":
- { "type": "++"
- , "$1":
- [ {"type": "CALL_EXPRESSION", "name": "default-ENV"}
- , [ { "type": "var"
- , "name": "ENV"
- , "default": {"type": "empty_map"}
- }
- ]
- , [ { "type": "singleton_map"
- , "key":
- { "type": "if"
- , "cond": {"type": "var", "name": "var_cc"}
- , "then":
- {"type": "join", "$1": {"type": "var", "name": "var_cc"}}
- , "else": "CC"
- }
- , "value": {"type": "var", "name": "CC"}
- }
- ]
- , [ { "type": "singleton_map"
- , "key":
- { "type": "if"
- , "cond": {"type": "var", "name": "var_cxx"}
- , "then":
- { "type": "join"
- , "$1": {"type": "var", "name": "var_cxx"}
- }
- , "else": "CXX"
- }
- , "value": {"type": "var", "name": "CXX"}
- }
- ]
- , [ { "type": "singleton_map"
- , "key":
- { "type": "if"
- , "cond": {"type": "var", "name": "var_ccflags"}
- , "then":
- { "type": "join"
- , "$1": {"type": "var", "name": "var_ccflags"}
- }
- , "else": "CFLAGS"
- }
- , "value": {"type": "var", "name": "CFLAGS"}
- }
- ]
- , [ { "type": "singleton_map"
- , "key":
- { "type": "if"
- , "cond": {"type": "var", "name": "var_cxxflags"}
- , "then":
- { "type": "join"
- , "$1": {"type": "var", "name": "var_cxxflags"}
- }
- , "else": "CXXFLAGS"
- }
- , "value": {"type": "var", "name": "CXXFLAGS"}
+ [ {"type": "CALL_EXPRESSION", "name": "default-ENV"}
+ , {"type": "var", "name": "ENV", "default": {"type": "empty_map"}}
+ , { "type": "singleton_map"
+ , "key":
+ { "type": "if"
+ , "cond": {"type": "var", "name": "var_cc"}
+ , "then":
+ {"type": "join", "$1": {"type": "var", "name": "var_cc"}}
+ , "else": "CC"
+ }
+ , "value": {"type": "var", "name": "CC"}
+ }
+ , { "type": "singleton_map"
+ , "key":
+ { "type": "if"
+ , "cond": {"type": "var", "name": "var_cxx"}
+ , "then":
+ {"type": "join", "$1": {"type": "var", "name": "var_cxx"}}
+ , "else": "CXX"
+ }
+ , "value": {"type": "var", "name": "CXX"}
+ }
+ , { "type": "singleton_map"
+ , "key":
+ { "type": "if"
+ , "cond": {"type": "var", "name": "var_ccflags"}
+ , "then":
+ { "type": "join"
+ , "$1": {"type": "var", "name": "var_ccflags"}
}
- ]
- , [ { "type": "singleton_map"
- , "key":
- { "type": "if"
- , "cond": {"type": "var", "name": "var_ldflags"}
- , "then":
- { "type": "join"
- , "$1": {"type": "var", "name": "var_ldflags"}
- }
- , "else": "LDFLAGS"
- }
- , "value": {"type": "var", "name": "LDFLAGS"}
+ , "else": "CFLAGS"
+ }
+ , "value": {"type": "var", "name": "CFLAGS"}
+ }
+ , { "type": "singleton_map"
+ , "key":
+ { "type": "if"
+ , "cond": {"type": "var", "name": "var_cxxflags"}
+ , "then":
+ { "type": "join"
+ , "$1": {"type": "var", "name": "var_cxxflags"}
}
- ]
- , [ { "type": "singleton_map"
- , "key":
- { "type": "if"
- , "cond": {"type": "var", "name": "var_ar"}
- , "then":
- {"type": "join", "$1": {"type": "var", "name": "var_ar"}}
- , "else": "AR"
- }
- , "value": {"type": "var", "name": "AR"}
+ , "else": "CXXFLAGS"
+ }
+ , "value": {"type": "var", "name": "CXXFLAGS"}
+ }
+ , { "type": "singleton_map"
+ , "key":
+ { "type": "if"
+ , "cond": {"type": "var", "name": "var_ldflags"}
+ , "then":
+ { "type": "join"
+ , "$1": {"type": "var", "name": "var_ldflags"}
}
- ]
- , [ { "type": "singleton_map"
- , "key":
- { "type": "if"
- , "cond": {"type": "var", "name": "var_prefix"}
- , "then":
- { "type": "join"
- , "$1": {"type": "var", "name": "var_prefix"}
- }
- , "else": "PREFIX"
- }
- , "value":
- { "type": "if"
- , "cond": {"type": "var", "name": "make_prefix"}
- , "then":
- { "type": "join"
- , "separator": "/"
- , "$1":
- { "type": "++"
- , "$1": [[""], {"type": "var", "name": "make_prefix"}]
- }
- }
- , "else": {"type": "var", "name": "PREFIX", "default": "/"}
+ , "else": "LDFLAGS"
+ }
+ , "value": {"type": "var", "name": "LDFLAGS"}
+ }
+ , { "type": "singleton_map"
+ , "key":
+ { "type": "if"
+ , "cond": {"type": "var", "name": "var_ar"}
+ , "then":
+ {"type": "join", "$1": {"type": "var", "name": "var_ar"}}
+ , "else": "AR"
+ }
+ , "value": {"type": "var", "name": "AR"}
+ }
+ , { "type": "singleton_map"
+ , "key":
+ { "type": "if"
+ , "cond": {"type": "var", "name": "var_prefix"}
+ , "then":
+ {"type": "join", "$1": {"type": "var", "name": "var_prefix"}}
+ , "else": "PREFIX"
+ }
+ , "value":
+ { "type": "if"
+ , "cond": {"type": "var", "name": "make_prefix"}
+ , "then":
+ { "type": "join"
+ , "separator": "/"
+ , "$1":
+ { "type": "++"
+ , "$1": [[""], {"type": "var", "name": "make_prefix"}]
}
}
- ]
- ]
- }
+ , "else": {"type": "var", "name": "PREFIX", "default": "/"}
+ }
+ }
+ ]
}
]
, [ "script"