CXX      = arm-cegcc-g++
#ARCH 		 = -mcpu=xscale -march=armv5te
ARCH 		 = 
CC       = arm-cegcc-gcc -DWIN32 -D_WIN32 -O3 $(ARCH)
CXXFLAGS = $(ARCH) -pipe -fno-exceptions -D_WIN32 -fno-rtti -O3 -fstrict-aliasing -fomit-frame-pointer -DWIN32 -Wcast-align
LDFLAGS  = -lm -s

EXE = toga141SE.exe

OBJS = attack.armo board.armo book.armo eval.armo fen.armo hash.armo list.armo main.armo material.armo \
       move.armo move_check.armo move_do.armo move_evasion.armo move_gen.armo move_legal.armo \
       option.armo pawn.armo piece.armo posix.armo protocol.armo pst.armo pv.armo random.armo recog.armo \
       search.armo search_full.armo see.armo sort.armo square.armo trans.armo util.armo value.armo \
       vector.armo

all: $(EXE) .depend

ipc.armo: ipc.c
	$(CC) -c -o ipc.armo ipc.c

clean:
	$(RM) $(EXE) toga141SE.exe toga141SE *.armo *.o .depend gmon.out

$(EXE): $(OBJS) ipc.armo
	$(CXX) $(LDFLAGS) -o $@ $(OBJS) ipc.armo
	arm-cegcc-strip $(EXE)

### Generic rule for all other .cpp files:
#
%.armo: %.cpp
	$(CXX) $(CXXFLAGS) -o $@ -c $<

.depend:
	$(CXX) -MM $(OBJS:.armo=.cpp) > $@
	
include .depend
