## firmware/Makefile
##
##    AudioScience HPI driver
##    Copyright (C) 1997-2017  AudioScience Inc. <support@audioscience.com>
##
##    This program is free software; you can redistribute it and/or modify
##    it under the terms of version 2 of the GNU General Public License as
##    published by the Free Software Foundation;
##
##    This program is distributed in the hope that it will be useful,
##    but WITHOUT ANY WARRANTY; without even the implied warranty of
##    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
##    GNU General Public License for more details.
##
##    You should have received a copy of the GNU General Public License
##    along with this program; if not, write to the Free Software
##    Foundation, Inc., 59 Temple Place, Suite 330,
##    Boston, MA  02111-1307  USA
##

include hpi_version.mk
# Include common firmware file lists
include distfiles.mk

precious-files += $(firmware-all-dist-files)

bin-install-ver-suffix = asihpi/$(shell echo $(hpi-version-string) | cut -d . -f1).$(shell echo $(hpi-version-string) | cut -d . -f2)
bin-install-base-path = $(shell sh firmwaredir.sh)
bin-install-path = $(bin-install-base-path)/$(bin-install-ver-suffix)

install: $(firmware-all-dist-files)
	install -d $(bin-install-path)
	install -m 0444 $(firmware-dsp-bins) $(bin-install-path)
	install -m 0655 dspinfo.py $(bin-install-path)

uninstall:
	rm -f $(addprefix $(bin-install-path)/,$(firmware-all-dist-files))

clean distclean:
	rm -rf $(filter-out $(precious-files),$(wildcard *))

.PHONY: install uninstall clean distclean
