script, , make CFLAGS .
, /usr/bin/compile, script, $0, , . pedantic, fullwarn ..
script, - :
OLDCFLAGS=$CFLAGS
WHATAMI=$(basename $0)
case "$WHATAMI" in
pedantic)
export CFLAGS="-Wall -pedantic -ansi"
make $@
exit $?
;;
c99)
export CFLAGS="-std=c99 ... ... ..."
....
Then, to compile foo.c with additional naggy flags:
pedantic foo
This is convenient, as I said for one-time builds, for example, trying to compile code that someone posted in a question, or developing how to use the new library, etc.
For anything else, just use the makefile as others have said.
source
share