29 lines
563 B
Bash
Executable File
29 lines
563 B
Bash
Executable File
#!/bin/sh
|
|
while test -n "$1"; do
|
|
case "$1" in
|
|
(--*=*)
|
|
val=${1#--}
|
|
name=${val%%=*}
|
|
val=${val#*=}
|
|
export "$(printf "%s\n" "$name"|tr '[:lower:]-' '[:upper:]_')=$val"
|
|
;;
|
|
esac
|
|
shift
|
|
done
|
|
|
|
(
|
|
# Variables that the makefile uses and that are meant to be configurable
|
|
awk '/ \?=/ {print($1)}' Makefile
|
|
# Variables that GNU Make uses for the implicit rules
|
|
cat <<EOF
|
|
CC
|
|
CPPFLAGS
|
|
CFLAGS
|
|
LDFLAGS
|
|
LOADLIBES
|
|
LDLIBS
|
|
EOF
|
|
)|sort -u|while read varname; do
|
|
eval "test -n \"\${$varname+x}\" && echo \${varname}=\${$varname}"
|
|
done|tee config.mak
|