TARGET=arm-wince-mingw32ce
CC=$(TARGET)-gcc
CXX=$(TARGET)-g++

#CFLAGS=-g0 -O0
CXXFLAGS=$(CFLAGS)

SOURCES=test_eh.cc __eh_continue.S Makefile asmdefs.h
OBJECTS=test_eh.o __eh_continue.o

all: test_eh.exe

clean:
	rm -f $(OBJECTS) test_eh.exe

test_eh.exe: $(OBJECTS)
	$(CXX) $(OBJECTS) -o $@ $(CFLAGS) $(LDFLAGS)

test_eh.o: test_eh.cc
	$(CXX) -c $< -o $@ $(CXXFLAGS)

__eh_continue.o: __eh_continue.S
	$(CC) -c $< -o $@ $(CCFLAGS)

download: test_eh.exe
	pcp test_eh.exe ":/test_eh.exe"

dist: test_eh.tar.gz

test_eh.tar.gz:	all $(SOURCES)
	rm -f $@
	tar cfz $@ $(SOURCES)
