The little things give you away... A collection of various small helper stuff
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

11 lines
573 B

  1. #!/bin/bash
  2. # Usage: create a file foo.c, make foo a symlink to this script
  3. # When foo is executed, this script silently compiles foo.c into .make-and-exec-binaries/foo and execs that with the arguments provided.
  4. # The compilation goes through make, so later invocations directly exec the binary with little delay.
  5. # To customise the compilation, you can set a CFLAGS env var before running foo.
  6. set -e
  7. name="$(basename "$0")"
  8. cd "$(dirname "$0")"
  9. make --file .make-and-exec-Makefile --silent ".make-and-exec-binaries/${name}"
  10. exec "./.make-and-exec-binaries/${name}" "$@"