2016-04-06 10:12:06 +02:00
|
|
|
|
|
|
|
function MOON {
|
|
|
|
echo "${fg_bold[yellow]} [MOON] ${fg_bold[white]}$@${reset_color}"
|
|
|
|
}
|
|
|
|
|
|
|
|
function moon.build {
|
|
|
|
write -n "${target}:"
|
|
|
|
|
|
|
|
typeset -l S
|
|
|
|
|
|
|
|
if [[ -n "${sources[$target]}" ]]; then
|
|
|
|
S="${sources[$target]}"
|
2016-04-06 12:05:18 +02:00
|
|
|
elif [[ -e "${target%.lua}.moon" ]]; then
|
2016-04-06 10:12:06 +02:00
|
|
|
S="${target%.lua}.moon"
|
|
|
|
fi
|
|
|
|
|
2016-04-06 12:05:18 +02:00
|
|
|
if [[ -n "${S}" ]]; then
|
2019-05-28 19:05:17 +02:00
|
|
|
write " ${S} $(dirname $target)"
|
2016-04-06 10:12:06 +02:00
|
|
|
write "\t@echo '$(MOON "${target}")'"
|
2016-04-06 13:16:27 +02:00
|
|
|
if [[ -z "${install[$target]}" ]]; then
|
|
|
|
write "\t${Q}echo '#!/usr/bin/env lua' > '${target}'"
|
|
|
|
write "\t${Q}moonc -p $S >> '${target}'"
|
2016-04-06 13:26:23 +02:00
|
|
|
write "\t${Q}chmod +x '${target}'"
|
2016-04-06 13:16:27 +02:00
|
|
|
else
|
|
|
|
write "\t${Q}moonc -p $S > '${target}'"
|
|
|
|
fi
|
2016-04-06 10:12:06 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
write "\n"
|
|
|
|
}
|
|
|
|
|
|
|
|
function moon.install {
|
|
|
|
binary.install "$@"
|
|
|
|
}
|
|
|
|
|
|
|
|
function moon.uninstall {
|
|
|
|
binary.uninstall "$@"
|
|
|
|
}
|
|
|
|
|
|
|
|
function moon.clean {
|
|
|
|
typeset -l S
|
|
|
|
|
|
|
|
if [[ -n "${sources[$target]}" ]]; then
|
|
|
|
S="${sources[$target]}"
|
|
|
|
else
|
|
|
|
S="${target%.lua}.moon"
|
|
|
|
fi
|
|
|
|
|
|
|
|
write "${target}.clean:"
|
|
|
|
|
|
|
|
if [[ -e "${S%% *}" ]]; then
|
|
|
|
write "\t@echo '$(RM ${target})'"
|
|
|
|
write "\t${Q}rm -f ${target}"
|
|
|
|
fi
|
|
|
|
|
|
|
|
write
|
|
|
|
}
|
|
|
|
|
|
|
|
function moon.distfiles {
|
|
|
|
if [[ -e "${target}.moon" ]]; then
|
|
|
|
echo "${target}.moon"
|
|
|
|
else
|
|
|
|
echo "${target}"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|