# OS specific compilation options:
ifeq ($(OS),Windows_NT)
	CC = c:/mingw/bin/gcc
	CFLAGS += -mconsole -mwindows
	LIBS += -lws2_32 -lwinmm
else
	UNAME_S := $(shell uname -s)
	ifeq ($(UNAME_S),Linux)
		CFLAGS +=
		LIBS += -lX11 -lasound -pthread
	else
		CFLAGS +=
		LIBS += -lX11 -lasound -pthread
	endif
endif

# Some numeric tests involving functions returning "double" may give different
# results if the following flag is or is not set. For example, if not set the
# optimization is "on" and the following code fails:
#
#		static double f(double a, int n)
#		{
#			return a / n;
#		}
#
#		...
#
#		double a = 497816;
#		int n = 10000;
#		double r = a/n;
#		assert(r - f(a,n) == 0); --> abort
#
# because the difference is made among the 64-bits rounded "double" value r
# and the 80-bits value f(a,n) gcc knows is still in the register of the FPU.
#CFLAGS += -ffloat-store