mirror of
https://github.com/cosinekitty/astronomy.git
synced 2026-02-05 05:01:55 -05:00
This new demo shows how to calculate rise and set times of the Sun and Moon in local time, using Linux functions. It also sorts the events in chronological order.
23 lines
451 B
Bash
Executable File
23 lines
451 B
Bash
Executable File
#!/bin/bash
|
|
Fail()
|
|
{
|
|
echo "FATAL($0): $1"
|
|
exit 1
|
|
}
|
|
|
|
if [[ "$1" == "debug" ]]; then
|
|
BUILDOPT='-g -O0'
|
|
elif [[ -z "$1" ]]; then
|
|
BUILDOPT='-O3'
|
|
else
|
|
Fail "unrecognized command line option"
|
|
fi
|
|
|
|
for name in linux_riseset ; do
|
|
echo "Compiling ${name}.c"
|
|
gcc ${BUILDOPT} -Wall -Werror -o ${name} -I../../source/c ../../source/c/astronomy.c astro_demo_common.c ${name}.c -lm ||
|
|
Fail "Error building ${name}.c"
|
|
done
|
|
|
|
exit 0
|