# Makefile for asi2416 firmware downloader
#
# Note, you must make clean between building the two flavours of fwupdate2416
# This is to make sure all objects are rebuilt with different DEFS
#
# fwupdate2416_56 is for versions of DSP code that were built with 56 byte HPI
# message size (053 to 057)

VPATH = ../hpi
INCLUDES = -I../hpi
DEFS = -DHPI_OS_LINUX -DDSPCODE_FILE=1
CDEBUG = -g
CFLAGS = -Wall $(CDEBUG) -I. $(INCLUDES) $(DEFS)
LDFLAGS = -g

OBJECTS = firmdown.o hpifunc.o hpidspcd.o hpinet.o hpios_linux.o

fwupdate2416: $(OBJECTS)
	gcc  -o $@ -lpcap -lm $^

fwupdate2416_56: DEFS += -DHPI_MESSAGE_FORCE_SIZE=56
fwupdate2416_56: $(OBJECTS) 
	gcc  -o $@ -lpcap -lm $^

$(OBJECTS): hpi.h hpios_linux.h hpidspcd.h

.PHONY: clean
clean:
	rm *.o
