# Install firmwares and initialization scripts for the Astribank
# drivers

USB_FW		=
FPGA_FW		=
PIC_FW		=
OCT_FW		=
FIRMWARES	= $(USB_FW) $(FPGA_FW) $(PIC_FW) $(OCT_FW)
PROTO_VER	= 30
SCRIPTS_BASE	= $(patsubst %,init_card_%_$(PROTO_VER),1 2 3 4 5)
SCRIPTS		= $(SCRIPTS_BASE:%=../%)
TARGET		= $(DESTDIR)/usr/share/dahdi

all:

clean:

install:
	mkdir -p $(TARGET)
	install $(SCRIPTS) $(TARGET)/
	install -m 644 ../XppConfig.pm $(FIRMWARES) $(TARGET)/
	for id in 202 203; do \
		if [ ! -r $(TARGET)/USB_FW.$$id.hex ]; then \
			ln -s USB_FW.201.hex $(TARGET)/USB_FW.$$id.hex;\
		fi; \
	done
	if [ ! -r $(TARGET)/FPGA_1161.203.hex ]; then \
		ln -s FPGA_1161.201.hex $(TARGET)/FPGA_1161.203.hex;\
	fi

