--- /dev/null
+#!/bin/sh
+
+#defaults
+prefix=/usr
+dfblib=""
+dfbinc=""
+
+echo $run_cmd
+
+usage() {
+ echo "usage $0 <options>"
+ echo "options:"
+ echo "--prefix=PREFIX specify install prefix"
+ echo "--with-dfblib=DIR specify directfb lib dir"
+ echo "--with-dfbinc=DIR specify directfb include dir"
+ echo
+ }
+
+while [ "$1" ]; do
+ case "`echo $1 | awk -F= '{ print $1 }'`" in
+ --prefix) prefix=`echo $1 | awk -F= '{ print $2 }'`; shift;;
+ --help) usage; shift 1;;
+ --with-dfblib) dfblib=`echo $1 | awk -F= '{ print $2 }'`; shift;;
+ --with-dfbinc) dfbinc=`echo $1 | awk -F= '{ print $2 }'`; shift;;
+ esac
+done
+
+echo "checking for dfb stuff ..."
+dfb_inc_dir="0"
+if [ -z "$dfbinc" ]; then
+ for i in /usr/include /usr/local/include; do
+ if [ -d $i/directfb ]; then
+ dfb_inc_dir=$i/directfb
+ fi
+ done
+else
+ if [ -d $dfbinc/directfb ]; then
+ dfb_inc_dir=$dfbinc/directfb
+ fi
+fi
+if [ "$dfb_inc_dir" = "0" ]; then
+ echo "dfb includes missing ..."
+ exit 1
+fi
+dfb_lib_dir="0"
+if [ -z "$dfblib" ]; then
+ for i in /usr/lib /usr/local/lib; do
+ if [ -f $i/libdirectfb.so ]; then
+ dfb_lib_dir=$i
+ fi
+ done
+else
+ if [ -f $dfblib/libdirectfb.so ]; then
+ dfb_lib_dir=$dfblib
+ fi
+fi
+if [ "$dfb_lib_dir" = "0" ]; then
+ echo "dfb libs missing ..."
+ exit 1
+fi
+echo "directfb installation looks good :)"
+
+echo "creating Makefile"
+cat > Makefile << EOF
+# morpheus Makefile, created `date`
+
+INCLUDEDIR = /usr/include
+CFLAGS = -DDEBUG -DUSE_DFB_API -DDISPLAY_FONT=\"$prefix/share/morpheus/decker.ttf\" -O3 -Wall -I$dfb_inc_dir
+LIBS = -L$dfb_lib_dir -ldirectfb
+
+OBJS = random.o display.o
+OBJS2 = morpheus
+
+morpheus: \$(OBJS)
+ \$(CC) \$(CFLAGS) -o \$@ \$(OBJS) \$(LIBS) main.c
+
+all: morpheus
+
+clean:
+ rm \$(OBJS) \$(OBJS2)
+
+remake: clean all
+
+install:
+ mkdir -p $prefix/bin
+ cp morpheus $prefix/bin
+ chmod 755 $prefix/bin/morpheus
+ mkdir -p $prefix/share/morpheus
+ cp decker.ttf $prefix/share/morpheus
+ chmod 644 $prefix/share/morpheus/decker.ttf
+EOF
+
+echo "done"