summaryrefslogtreecommitdiff
path: root/rules
diff options
context:
space:
mode:
authorOliver Reiche <oliver.reiche@huawei.com>2022-12-07 17:44:49 +0100
committerOliver Reiche <oliver.reiche@huawei.com>2022-12-09 13:13:21 +0100
commitc94f309016e0ff06719823f146e4d7872611d607 (patch)
treeae9d9687fed77cfeb40fba5825917ee87c7e8694 /rules
parente1bf0fd1bbb59ba5718174feef2c4d12594924ee (diff)
downloadjustbuild-c94f309016e0ff06719823f146e4d7872611d607.tar.gz
rules: Create library in stage directory
Diffstat (limited to 'rules')
-rw-r--r--rules/CC/EXPRESSIONS24
1 files changed, 17 insertions, 7 deletions
diff --git a/rules/CC/EXPRESSIONS b/rules/CC/EXPRESSIONS
index 81ac1fd8..f719c48d 100644
--- a/rules/CC/EXPRESSIONS
+++ b/rules/CC/EXPRESSIONS
@@ -524,13 +524,27 @@
, "$1": ["lib", {"type": "var", "name": "base name"}, ".a"]
}
]
+ , [ "libpath"
+ , { "type": "if"
+ , "cond": {"type": "var", "name": "stage"}
+ , "then":
+ { "type": "join"
+ , "separator": "/"
+ , "$1":
+ [ {"type": "var", "name": "stage"}
+ , {"type": "var", "name": "libname"}
+ ]
+ }
+ , "else": {"type": "var", "name": "libname"}
+ }
+ ]
, [ "lib"
, { "type": "if"
, "cond": {"type": "var", "name": "objects"}
, "else": {"type": "empty_map"}
, "then":
{ "type": "ACTION"
- , "outs": [{"type": "var", "name": "libname"}]
+ , "outs": [{"type": "var", "name": "libpath"}]
, "inputs": {"type": "var", "name": "objects"}
, "env":
{"type": "var", "name": "ENV", "default": {"type": "empty_map"}}
@@ -539,7 +553,7 @@
, "$1":
[ [ {"type": "var", "name": "AR", "default": "ar"}
, "cqs"
- , {"type": "var", "name": "libname"}
+ , {"type": "var", "name": "libpath"}
]
, {"type": "keys", "$1": {"type": "var", "name": "objects"}}
]
@@ -548,11 +562,7 @@
}
]
]
- , "body":
- { "type": "to_subdir"
- , "subdir": {"type": "var", "name": "stage"}
- , "$1": {"type": "var", "name": "lib"}
- }
+ , "body": {"type": "var", "name": "lib"}
}
}
, "lib result":