#!/usr/bin/env bash
# LEGAL: COPYRIGHT (C) 2010 JIM E. BROOKS WWW.PALOMINO3D.ORG

Clean()
{
    DIR=$1
    rm -rf core core.* *.core gmon.out *.tmp
    rm -rf TAGS doxygen
    rm -rf $DIR/*Cache* $DIR/CMakeFiles
    rm -rf $DIR/bin $DIR/lib $DIR/Makefile $DIR/cmake_install.cmake
    rm -rf $DIR/ZERO* $DIR/INSTALL* $DIR/ALL_BUILD*
    rm -rf $DIR/*.ncb $DIR/*.sln $DIR/*.suo $DIR/*.vcproj* $DIR/*.dir
}

# Update clean.lua also.

Clean .
Clean build/base
Clean build/collision
Clean build/control
Clean build/fx
Clean build/game
Clean build/gfx
Clean build/glue
Clean build/graph
Clean build/gui
Clean build/hud
Clean build/init
Clean build/input
Clean build/lua_bind
Clean build/lua_lang
Clean build/math
Clean build/object
Clean build/physics
Clean build/program
Clean build/shader
Clean build/sky
Clean build/sound
Clean build/threads
Clean build/view
Clean build/world

# Update clean.lua also.

# More cleaning.
#rm -rf doxygen
MAKE=`tools/which-make.sh`
$MAKE -C tests clean
