The little things give you away... A collection of various small helper stuff
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 

11 lignes
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}" "$@"