summaryrefslogtreecommitdiff
path: root/CC/foreign/make/EXPRESSIONS
diff options
context:
space:
mode:
authorOliver Reiche <oliver.reiche@huawei.com>2023-02-14 17:20:48 +0100
committerOliver Reiche <oliver.reiche@huawei.com>2023-05-30 15:33:18 +0200
commitf5fb09192d1ad244006964d2d1425506718d3e58 (patch)
tree2fe4b65b1286fd9d4e4832ad20bb46bd74297078 /CC/foreign/make/EXPRESSIONS
parent25cc5a5d9e225e8a1b8d1a7221eb1968b28d928d (diff)
downloadrules-cc-f5fb09192d1ad244006964d2d1425506718d3e58.tar.gz
rules-cc/foreign: Support project sub-directory
Diffstat (limited to 'CC/foreign/make/EXPRESSIONS')
-rw-r--r--CC/foreign/make/EXPRESSIONS17
1 files changed, 13 insertions, 4 deletions
diff --git a/CC/foreign/make/EXPRESSIONS b/CC/foreign/make/EXPRESSIONS
index 3f04bbd..abe072d 100644
--- a/CC/foreign/make/EXPRESSIONS
+++ b/CC/foreign/make/EXPRESSIONS
@@ -1,7 +1,7 @@
{ "make-build":
{ "vars":
[ "source_dir"
- , "make_target"
+ , "subdir"
, "make_prefix"
, "make_options"
, "make_jobs"
@@ -203,6 +203,12 @@
]
}
]
+ , [ "SUBDIR"
+ , { "type": "join"
+ , "separator": "/"
+ , "$1": {"type": "var", "name": "subdir", "default": []}
+ }
+ ]
, [ "script"
, { "type": "singleton_map"
, "key": "run_make.sh"
@@ -229,9 +235,11 @@
]
}
}
- , [ "readonly VAR_DESTDIR=$1"
- , "shift"
- , "make \"$@\" -C source ${VAR_DESTDIR}=$(pwd)/install >build.log || (cat build.log && exit 1)"
+ , [ "readonly SUBDIR=\"$1\""
+ , "readonly VAR_DESTDIR=$2"
+ , "shift 2"
+ ]
+ , [ "make \"$@\" -C \"source/${SUBDIR}\" ${VAR_DESTDIR}=$(pwd)/install >build.log || (cat build.log && exit 1)"
, "find ./install -type l -delete"
]
, { "type": "if"
@@ -266,6 +274,7 @@
{ "type": "++"
, "$1":
[ ["/bin/sh", "run_make.sh"]
+ , [{"type": "var", "name": "SUBDIR"}]
, { "type": "if"
, "cond": {"type": "var", "name": "var_destdir"}
, "then":