#! /bin/bash

dir_obj=obj.sun
if [ ! -d $dir_obj ] ; then mkdir $dir_obj ; fi

for arg in $* ; do file_source=$arg ; done
file_target=$dir_obj/${file_source%.*}.o

# Flags not used:
#   -pipe		save memory
#   -Wshadow		/usr/include/unistd.h
#   -Wredundant-decls	/usr/include/*.h

g++ -c -g -O2 \
    -DMEC_TARGET_SUN \
    -Wall \
    -Wtraditional \
    -Wpointer-arith \
    -Wbad-function-cast \
    -Wcast-qual \
    -Wcast-align \
    -Wwrite-strings \
    -Wconversion \
    -Waggregate-return \
    -Wstrict-prototypes \
    -Wmissing-prototypes \
    -Wmissing-declarations \
    -Wnested-externs \
    -Winline \
    -Woverloaded-virtual \
    -Wsynth \
    -Werror \
    -nostdinc \
    $* \
    -I /var/package/include-sun \
    -o $file_target
