makeBinaryWrapper: create destination directory

This commit is contained in:
Naïm Favier 2021-12-21 14:36:14 +01:00
parent 395879c283
commit ffdf9681ab
No known key found for this signature in database
GPG key ID: 49B07322580B7EE2

View file

@ -33,13 +33,20 @@ assertExecutable() {
# To troubleshoot a binary wrapper after you compiled it,
# use the `strings` command or open the binary file in a text editor.
makeWrapper() {
assertExecutable "$1"
makeDocumentedCWrapper "$1" "${@:3}" | \
local original="$1"
local wrapper="$2"
shift 2
assertExecutable "$original"
mkdir -p "$(dirname "$wrapper")"
makeDocumentedCWrapper "$original" "$@" | \
@CC@ \
-Wall -Werror -Wpedantic \
-Os \
-x c \
-o "$2" -
-o "$wrapper" -
}
# Syntax: wrapProgram <PROGRAM> <MAKE-WRAPPER FLAGS...>