CPP = arm-cegcc-g++
CC = arm-cegcc-gcc
CFLAGS = -Wcast-align -Wpacked -fstrict-aliasing -fomit-frame-pointer
CPPFLAGS = -Wcast-align -Wpacked -fno-exceptions -fno-rtti -fstrict-aliasing -fomit-frame-pointer
DEFINES = -DWIN32
OPT = -O3
LDFLAGS = 
EXE = scorpio.exe
RM = rm -rf
OBJ = attack.o scorpio.o eval.o hash.o moves.o search.o see.o probe.o util.o

$(EXE): $(OBJ) ipc.o
	$(CC) $(OPT) $(CFLAGS) $(DEFINES) $(LDFLAGS) $(OBJ) ipc.o -o scorpio.exe -lstdc++
	arm-cegcc-strip $(EXE)
#-lpthread -ldl -lm

%.o: %.cpp scorpio.h
	$(CPP) $(OPT) $(CPPFLAGS) $(DEFINES) -c $<

ipc.o: ipc.c ipc.h
	$(CC) $(OPT) $(CFLAGS) $(DEFINES) -c $<

clean:
	$(RM) $(OBJ) ipc.o

