Shell script problems, passing options to gcc
I'm trying to create a tiny script that passes command line options to gcc when I'm working with GCC. The script is as follows:
# cmpl - Script to compile .c source files
gcc "$CFLAGS" "$1".c -o "$1".o
This script works when $CFLAGS is only one option, for instance:
but fails whenever a second option is included, such as:
giving the message: "cc1: invalid option '-O2 -pipe'
The combination above works when I type it at the command line. I'm confused. Any help would be much appreciated.