#
# define      description
# ------      ----------------------------------
# DEBUG       enable debugging statements
# PERF        enable performance measurements
# USB         console i/o goes to USB, else JTAG
#
include $(ROOT)/usr/include/make/SCdefs

TARGETS = libaudbuf.a
CFILES += audbuf.c
LCDEFS += 
LCINCS += 
LLDLIBS +=

# enable debugging support
ifdef DEBUG
LCDEFS += -DADB_DEBUG
endif

# enable performance measurements
ifdef PERF
LCDEFS += -DPERF
CFILES += perf.c
endif

ASFILES = 
HEADERS = audbuf.h
LOCHEADERS = 

default: $(TARGETS)

LCOPTS += -marm

LLDLIBS += -lios -lioslibc
ifdef USB
LLDLIBS += -lvio_usb
else
LLDLIBS += -lvio
endif

LLDOPTS += -Ttext $(MK_MEDIA_START) -T $(SDRAM_LINK) -Wl,--no-warn-mismatch

headers: $(HEADERS)
	$(INSTALL) $(HEADERS) $(ROOT)/usr/include/sc

exports install: $(TARGETS) headers
	$(INSTALL) -m 444 $(TARGETS) $(ROOT)/usr/lib/sc 

$(TARGETS): %: %($(OBJECTS))
	$(AR) cru $@ $?

include $(COMMONRULES)
