# This is kbuild makefile for use with kernel build system
#
# 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.
#
# Usage:
# make -C <path-to-kernel-source> SUBDIRS=$PWD modules
# If you used O=<path-to-build-directory> for kernel build, use it here too

ifdef KBUILD_VERBOSE
# then we are coming from the kernel build system

include $(M)/hpi_version.mk

asihpi-objs := hpimod.o hpioctl.o hpicmn.o hpifunc.o hpidebug.o hpimsgx.o hpios.o\
			hpi6000.o hpi6205.o hpi6700.o hpidspcd.o hpimsginit.o

obj-m += asihpi.o

EXTRA_CFLAGS = -DDRIVER_VERSION=$(hpi-version-string) \
	-DHPI_OS_LINUX_KERNEL \
	-DHPI_BUILD_DEBUG \
	-DHPI_BUILD_INCLUDE_HPI6000 \
	-DHPI_BUILD_INCLUDE_HPI6205 \
	-DHPI_BUILD_INCLUDE_HPI6700 \
	-DHPI_BUILD_INCLUDE_INTERNAL \
	-DHPI_BUILD_EXCLUDE_ALL_DEPRECATED \
	-O \
	-I$(M)

else
# Use the autoconf generated makefile for setup, install, dist targets etc.
include extra.mk
endif
