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-05-28 19:05:17 +02:00
|
|
|
write " $S $(dirname $target)"
|
2015-04-07 10:23:36 +02:00
|
|
|
write "\t@echo '$(SED "${target}")'"
|
|
|
|
write -n "\t${Q}sed -e '"
|
|
|
|
write -n "s&@LIBDIR@&\$(LIBDIR)&;"
|
|
|
|
write -n "s&@BINDIR@&\$(BINDIR)&;"
|
|
|
|
write -n "s&@SHAREDIR@&\$(SHAREDIR)&;"
|
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
|
|
|
|
}
|
|
|
|
|