#------------------------------------------
# Makefile
#
# Makefile for buildfirmware and buildDSP
#
# Build and executes tools to generate binary
# firmware from ADI's headers and .bnm files.
#
# ADI's firmware header is not free software,
# buildfirmware is therefore in public domain.
# .bnm files are not open sourced, but can be
# considered as data files for buildDSP, and
# buildDSP is published under the GNU GPL license.

include ../../Makefile.common

CFLAGS=-O2 -pipe -Wall -pedantic

POTS_DIR=sagem/pots
ISDN_DIR=sagem/isdn
POTS_FILES=$(wildcard $(POTS_DIR)/*.bnm)
ISDN_FILES=$(wildcard $(ISDN_DIR)/*.bnm)

all:  dsp_code_pots.bin dsp_code_isdn.bin


dsp_code_pots.bin: buildDSP $(POTS_FILES)
	./buildDSP -d $(POTS_DIR) $@

dsp_code_isdn.bin: buildDSP $(ISDN_FILES)
		./buildDSP -d $(ISDN_DIR) $@


buildDSP : builddsp.c
	gcc $(CFLAGS) builddsp.c -o buildDSP

install : dsp_code_pots.bin dsp_code_isdn.bin 
	mkdir -p $(EAGLEUSB_BINDIR)
	$(INSTALL) -m 0664 -o root -g root $^ $(EAGLEUSB_BINDIR)

uninstall:
	rm -f $(EAGLEUSB_BINDIR)/dsp_code_pots.bin $(EAGLEUSB_BINDIR)/dsp_code_isdn.bin

clean :
	rm -f  buildDSP dsp_code_isdn.bin dsp_code_pots.bin


