1#!/bin/sh 2 3OS=`uname -s` 4SUPPORTED="Linux SunOS HP-UX FreeBSD" 5 6for i in `echo "$SUPPORTED"` 7do 8 if [ "$OS" = "$i" ]; then 9 supported="yes" 10 break 11 fi 12done 13 14if [ "$supported" != "yes" ]; then 15 echo "Only this list are supported for now: $SUPPORTED" 16 exit 1 17fi 18 19LIBS="-lpthread" 20FLAGS="" 21 22case "$OS" in 23 "SunOS") 24 LIBS="${LIBS} -lmalloc"; 25 FLAGS="${FLAGS} -D_solaris";; 26 "FreeBSD") 27 FLAGS="${FLAGS} -D_freebsd";; 28esac 29 30cat <<EOF > Makefile 31all: ebizzy 32 33ebizzy: ebizzy.c 34 gcc -Wall -Wshadow ${LIBS} ${FLAGS} -o ebizzy ebizzy.c 35 36clean: 37 rm -f ebizzy Makefile 38EOF 39 40echo "Type 'make' to compile" 41 42