build.zsh/build/crystal.zsh

44 lines
812 B
Bash
Raw Normal View History

2016-05-07 13:52:26 +02:00
2019-11-05 01:16:59 +01:00
function crystal.prelude {
local has_crflags=false
for variable value in ${variables[@]}; do
if [[ "$variable" == "CRFLAGS" ]]; then
has_crflags=true
break
fi
done
if ! $has_crflags; then
variables+=(CRFLAGS "--release")
fi
}
2016-05-07 13:52:26 +02:00
function crystal.build {
write "${target}: ${src[@]} ${depends[$target]} $(dirdep $target)"
2019-05-28 18:45:35 +02:00
write "\t@echo '${fg_bold[magenta]} CR > ${fg_bold[white]}$target${reset_color}'"
2019-11-05 01:16:59 +01:00
write "\t${Q}crystal build ${crflags[$target]} \$(CRFLAGS) ${src[@]} -o '${target}'"
2016-05-07 13:52:26 +02:00
write "\n"
}
function crystal.install {
binary.install "$@"
}
function crystal.uninstall {
binary.uninstall "$@"
}
function crystal.clean {
2019-05-28 18:45:35 +02:00
write "${target}.clean:"
write "\t@echo '$(RM ${target})'"
write "\t${Q}rm -f ${target}"
write
2016-05-07 13:52:26 +02:00
}
function crystal.distfiles {
echo "${target}"
}