#!/bin/bash ##============================================================================== ## ## Check arguments ## ##============================================================================== if [ "$#" = "0" ]; then echo "Usage: $0 (lib|cshlib|cxxshlib|cprog|cxxprog) [OPTIONS]" echo "Try --help for help." exit 1 fi case $1 in -*) ;; *) TYPE=$1 shift 1 esac ##============================================================================== ## ## Get command line arguments. ## ##============================================================================== for opt do arg=`expr "x$opt" : 'x[^=]*=\(.*\)'` case $opt in -h | --help) HELP=1 ;; --top=*) TOP=$arg ;; --project=*) PROJECT=$arg ;; --sources=*) SOURCES=$arg ;; --defines=*) DEFINES=$arg ;; --includes=*) INCLUDES=$arg ;; --libraries=*) LIBRARIES=$arg ;; *) echo "$0: unknown option: $opt" exit 1 ;; esac done ##============================================================================== ## ## Print the help message ## ##============================================================================== if [ "$HELP" = "1" ]; then cat< GNUmakefile <