mirror of
https://github.com/systemd/systemd
synced 2024-09-06 00:41:36 +00:00
![Zbigniew Jędrzejewski-Szmek](/assets/img/avatar_default.png)
Even though many of those scripts are very simple, it is easier to include the header than to try to say whether each of those files is trivial enough not to require one.
26 lines
405 B
Bash
Executable file
26 lines
405 B
Bash
Executable file
#!/bin/sh
|
|
# SPDX-License-Identifier: LGPL-2.1-or-later
|
|
set -eu
|
|
|
|
CONFIG=$1
|
|
TARGET=$2
|
|
|
|
if [ $# -ne 2 ]; then
|
|
echo 'Invalid number of arguments.'
|
|
exit 1
|
|
fi
|
|
|
|
if [ ! -f $CONFIG ]; then
|
|
echo "$CONFIG not found."
|
|
exit 2
|
|
fi
|
|
|
|
if [ ! -f $TARGET ]; then
|
|
echo "$TARGET not found."
|
|
exit 3
|
|
fi
|
|
|
|
DEFINES=$(awk '$1 == "#define" && $3 == "1" { printf "-D%s ", $2 }' $CONFIG)
|
|
|
|
m4 -P $DEFINES $TARGET
|