#!/bin/bash
# Made by Tristan Willy <twilly@ucsc.edu>

if [ ! -f des/des ]; then
	pushd .
	cd des
	# tar xfvz libdes*gz
	uname -a | grep -q 'Linux'
	if [ $? != 0 ]; then
		echo "Not a Linux system. Attempting to compile libdes with GCC."
		make gcc
	else
		uname -a | egrep -q 'i[3456]86'
		if [ $? != 0 ]; then
			echo "Not a Linux x86 system. Attempting to compile libdes with GCC."
			make gcc
		else
			echo "Compiling libdes for a Linux x86 platform."
			make x86-elf
		fi
	fi
	popd
	exit $?
fi

