#!/bin/bash if [ -z $1 ]; then echo "usage: mk [-Ogpa] [additional compile options]" exit 1 fi case "$1" in "-O") opt="-O"; shift ;; "-g") opt="-ggdb"; shift ;; "-p") opt="-pg"; shift ;; "-a") opt="-O -Wall"; shift ;; *) opt="-O";; esac code=`basename $1 .c` shift echo gcc $opt -o "${code}" "${code}.c" $* gcc $opt -o "${code}" "${code}.c" $*