include $(ROOT)/usr/include/make/X86defs

LLDLIBS = -lcsl

TARGETS = sce

CXXFILES = \
        log.cpp \
        thumb.cpp \
        arm.cpp \
        cpu.cpp \
        fl.cpp \
        samsung128.cpp \
        toshiba64.cpp \
        usb.cpp \
        memory.cpp \
        aes.cpp \
        semihost.cpp \
        sha.cpp \
        aud.cpp \
        sctrl.cpp \
        cif.cpp \
        debug.cpp \
        sce.cpp \
	elf.cpp

ifneq ($(CYGWIN_BUILD),)
CXXFILES += WIN32/porting.cpp
else
CXXFILES += UNIX/porting.cpp
endif

LDIRT += gba.pyc

default: $(TARGETS)

exports install: default
	$(INSTALL) $(TARGETS) $(ROOT)/usr/bin/x86
	$(INSTALL) gba.py $(ROOT)/usr/bin/x86

ifneq ($(filter runtests clean clobber, $(MAKECMDGOALS)),)
SUBDIRS = test
endif

include $(COMMONRULES)

sce: $(OBJECTS)
	$(CXX) $(OBJECTS) $(LDFLAGS) -o $@ $(LDLIBS)
