mk 455 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #!/bin/sh
  2. set -e
  3. test "$CC" || export CC=cc
  4. test "$CFLAGS" || export CFLAGS="-g -Og"
  5. export CFLAGS="$CFLAGS -std=c89 -Wall -Wextra -ftrapv -fno-strict-aliasing"
  6. goal() {
  7. local target="$1"
  8. shift
  9. if [ ! -e "$target" ]
  10. then
  11. echo "updating $target" >&2
  12. return 0
  13. fi
  14. local f
  15. for f in "$@"
  16. do
  17. if [ "$f" -nt "$target" ]
  18. then
  19. echo "updating $target" >&2
  20. return 0
  21. fi
  22. done
  23. return 1
  24. }
  25. cdp() {
  26. cd $1
  27. echo "-- `pwd`" >&2
  28. }
  29. . $1
  30. exit 0