CROSS_COMPILE = /opt/gcw0-toolchain/usr/bin/mipsel-gcw0-linux-uclibc-
CC = $(CROSS_COMPILE)gcc

SYSROOT = $(shell $(CC) --print-sysroot)

#DEFINES = -DUSE_JAPANESE_FONT

IFLAGS = $(shell $(SYSROOT)/usr/bin/sdl-config --cflags)
LFLAGS = $(shell $(SYSROOT)/usr/bin/sdl-config --libs) -lSDL_ttf

exec_sample:    exec_sample.c
	$(CC) -Wall $(DEFINES) $(IFLAGS) $@.c $(LFLAGS) -o $@

opk:    exec_sample
	cp exec_sample opk_root/
	$(CROSS_COMPILE)strip opk_root/exec_sample
	rm -f exec_sample.opk
	mksquashfs opk_root exec_sample.opk -all-root -noappend -no-exports -no-xattrs

clean:
	rm -f exec_sample opk_root/exec_sample exec_sample.opk
