I used to start quickie C programs with:
----------------------------
#ifdef notdef
gcc $0 -o $(basename $0 .c)
exit $?
#endif
int main....
---------------------------
Then I could compile by saying "sh foo.c"
This was especially useful if the compile line was complicated (e.g., the C program required linking with special libraries or something).
(Actually I used back-quotes instead of $(....), but this phone doesn't have back-quote on this keyboard.)
@lain_7 @rifkin @jef Basically same here:
────
#if 0
ctime -begin ${0%.*}.ctm
clang -g -fsanitize=address -std=c99 $0 -o ${0%.*}
ctime -end ${0%.*}.ctm
exit
#endif
────
That's the intro to all my new .c files. (ctime, by the way, times the build.) I got the idea from Won Chun, and like to think of it grandly as "The Won Build System".