2014-11-05 13:32:11 +01:00
|
|
|
|
|
|
|
function script.build {
|
2016-04-06 10:12:06 +02:00
|
|
|
typeset -l S
|
|
|
|
|
|
|
|
if [[ -n "${sources[$target]}" ]]; then
|
|
|
|
S="${sources[$target]}"
|
2016-04-06 12:05:18 +02:00
|
|
|
elif [[ -e "${target}.in" ]]; then
|
2016-04-06 10:12:06 +02:00
|
|
|
S="${target}.in"
|
|
|
|
fi
|
|
|
|
|
2014-11-05 13:32:11 +01:00
|
|
|
write -n "${target}:"
|
|
|
|
|
2016-04-06 12:05:18 +02:00
|
|
|
if [[ -n "${S}" ]]; then
|
2019-06-09 19:19:50 +02:00
|
|
|
write " $S $(dirdep $target)"
|
2015-04-07 10:23:36 +02:00
|
|
|
write "\t@echo '$(SED "${target}")'"
|
|
|
|
write -n "\t${Q}sed -e '"
|
2019-06-12 02:40:16 +02:00
|
|
|
for variable value in ${prefixes[@]} ${variables[@]}; do
|
|
|
|
write -n "s&@${variable}@&\$(${variable})&;"
|
|
|
|
done
|
2016-04-06 10:12:06 +02:00
|
|
|
write "' $S > '${target}'"
|
2015-04-07 10:23:36 +02:00
|
|
|
write "\t${Q}chmod +x '${target}'"
|
2014-11-05 13:32:11 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
write "\n"
|
|
|
|
}
|
|
|
|
|
|
|
|
function script.install {
|
|
|
|
binary.install "$@"
|
|
|
|
}
|
|
|
|
|
|
|
|
function script.uninstall {
|
|
|
|
binary.uninstall "$@"
|
|
|
|
}
|
|
|
|
|
|
|
|
function script.clean {
|
2016-04-06 10:12:06 +02:00
|
|
|
typeset -l S
|
|
|
|
|
|
|
|
if [[ -n "${sources[$target]}" ]]; then
|
|
|
|
S="${sources[$target]}"
|
|
|
|
else
|
|
|
|
S="${target}.in"
|
|
|
|
fi
|
|
|
|
|
2014-11-05 13:32:11 +01:00
|
|
|
write "${target}.clean:"
|
|
|
|
|
2016-04-06 10:12:06 +02:00
|
|
|
if [[ -e "${S%% *}" ]]; then
|
2014-11-05 13:32:11 +01:00
|
|
|
write "\t@echo '$(RM ${target})'"
|
|
|
|
write "\t${Q}rm -f ${target}"
|
|
|
|
fi
|
|
|
|
|
|
|
|
write
|
|
|
|
}
|
|
|
|
|
|
|
|
function script.distfiles {
|
|
|
|
if [[ -e "${target}.in" ]]; then
|
|
|
|
echo "${target}.in"
|
|
|
|
else
|
|
|
|
echo "${target}"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|