#!/bin/bash
#
# This file is my private script to simple and fast compiling of single file
# Syntax is: compi [d] <project-name>
# Where d is parameter which passes -g option to gcc and ommits optimalizations
# and <project-name> is name of application - OMMIT THE .C EXTENSION!!!
#
# Note for versions above 0.2 : now there is multiple files used, using of make is recommended
#
# Examples:
#$ compi hello
# compiles file 'hello.c' to highly optimalized small executable 'hello'
#$ compi d hexedit
# compiles file 'hexedit.c' to non-optimalized executable 'hexedit', including debug informations
#

GCC_OPTIONS="-O6 -s -fomit-frame-pointer -m486 -malign-loops=0 -malign-functions=2 -malign-jumps=0";
if test "$1" = "d"; then
  GCC_OPTIONS="-g";
  shift;
fi;
gcc -o $1 $1.c -Wall $GCC_OPTIONS $2 $3 $4 $5 $6 $7 $8 $9

