#
# define      description
# ------      ------------------------------------------------------
# DEBUG       enable debugging statements
# DEBUG_ERROR enable only error messages
# DUMP_PACKET display receive/transmit packet contents

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

# enable debugging support
ifdef DEBUG
LCDEFS += -DUE_DEBUG -DAX_DEBUG
endif

ifdef DEBUG_ERROR
LCDEFS += -DUE_DEBUG_ERROR -DAX_DEBUG_ERROR
endif

# enable packet dumping
ifdef DUMP_PACKET
LCDEFS += -DDUMP_PACKET
endif

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

TARGETS = usbeth.elf

CFILES  = usbeth.c ax.c
HFILES  = ax.h ax_defs.h

LCOPTS += -mthumb -DIOP_OS -O2
LCINCS += -I$(ROOT)/usr/include/rvl/net 

LLDLIBS = -lusb -lioslibc -lios	
LLDOPTS = -Tddr.link

default: $(TARGETS)

usbeth.elf: $(CRT0) $(OBJECTS)
	$(CC) $(CFLAGS) -Ttext $(MK_USBETH_START) -o $@ $^ $(LDFLAGS) $(LDLIBS)

install: exports $(TARGETS)
	$(INSTALL) $(TARGETS) $(ROOT)/usr/bin/rvl

include $(COMMONRULES)

