build.sh 365 B

1234567891011
  1. #!/bin/sh
  2. find ./src -name '*.hs' -printf '%T@ %p\n' \
  3. | sort -r | head -n1 | cut -d' ' -f2 | while read file
  4. do
  5. out_file="$(basename "$file" | cut -d'.' -f1)"
  6. echo "------------------------------------"
  7. echo "Compiling file '${file}' into '${out_file}'"
  8. ghc -O2 -i./src -o "$out_file" "$file"
  9. echo "------------------------------------"
  10. done