# This is kbuild makefile for use with kernel 2.6 build system
# 
# 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

## Note, Makefile.in is needed because "make distclean" removes all Makefiles, 
## even if not generated by configure!

HPI_OBJS = hpiman.o hpifunc.o hpidebug.o  hpimsgx.o hpios_linux.o \
            hpi4000.o hpi6000.o hpi56301.o hpi6205.o  hpidspcd.o

HPI_HEADERS = hpi.h hpiman.h hpifunc.h hpidebug.h hpimsgx.h hpios.h hpipci.h  hpios_linux.h \
   hpi4000.h hpi6000.h hpi56301.h dpi56301.h boot4ka.h hpi6205.h hpidspcd.h

ifdef KBUILD_VERBOSE
# then we are coming from the kernel 2.6 build sytem

# Note. Have to use autoconf substitutions rather than autoconf 'make' variables 
# because these are undefined here
#

EXTRA_CFLAGS = -DHPI_DEBUG  -I $(src) \
         -DHPI_INCLUDE_4100 -DHPI_INCLUDE_4300 -DHPI_INCLUDE_4500 -DHPI_INCLUDE_5000 \
         -DHPI_INCLUDE_6000 -DHPI_INCLUDE_6400 -DHPI_INCLUDE_8700 -DUSE_SPINLOCK=1 \
		 -DDSPCODE_FIRMWARE  -DDSPBINPATH=/usr/lib/hotplug/firmware/ -DDRIVER_VERSION=2.92 -O
obj-$(CONFIG_ASIHPI) += asihpi.o

asihpi-y := hpimod.o $(HPI_OBJS) 

else
# Use the autoconf generated makefile for dist target, and all kernel < 2.6
include Makefile.auto
endif

