### function declaration: build .c source files
### user command pattern: gcc -Wall -g -o target_file_name source_file_name
### such as: gcc -Wall -g -o alarm alarm.c
### usage declaration: 1. ./build.sh alarm.c 2. ./alarm
#!/bin/sh
#echo $1
#echo ${1%.c}
if [[ "$#" != 1 || "${1%.c}" == "$1" ]]
then
echo "build pattern: ./build.sh source_file_name(xxx.c)"
#elif [[ "${1%.c}" == "$1" ]]
#then
# echo "build pattern: ./build.sh source_file_name(xxx.c)"
else
echo "gcc -Wall -g -o ${1%.c} $1"
gcc -Wall -g -o ${1%.c} $1
fi
阅读(2509) | 评论(0) | 转发(0) |