MODULE_DIR=/lib/modules/`uname -r`/kernel/drivers/usb
# INCLUDE_DIR=-I/lib/modules/`uname -r`/build/include -I/lib/modules/`uname -r`/build/include/asm/mach-default
#MOTIF=-I/usr/X11R6/include -L/usr/X11R6/lib -lXm 
#EXECUTABLE_DIR=/usr/local/bin
#EXECUTABLES=mmusbplay mmusbrecord

# When being compiled on newer kernels (>= 2.35) with no legacy
# OSS soundcore support, MMUSBAUDIO must emulate soundcore by
# registering and unregistering its own character device as 
# /dev/dsp. /dev/midi, etc. Uncomment the following line
# to enable soundcore emulation.

#EXTRA_CFLAGS = -DMMUSBAUDIO_EMULATE_SOUNDCORE

obj-m := mmsoundcore.o
	
all: mmsoundcore.ko
	cp Module.symvers ..
	touch ../mmusbaudio.c
	@echo Done

mmsoundcore.ko: mmsoundcore.c
	make -C /lib/modules/`uname -r`/build SUBDIRS=`pwd` modules

clean:
	rm -rf core *.o *.ko *.mod.* .cmd .tmp_versions .mmnull* .mmusb* 
	rm -f .mmsoundcore.ko.cmd .mmsoundcore.mod.o.cmd .mmsoundcore.o.cmd
	rm -f Module.markers modules.order Module.symvers

install: all
	cp mmsoundcore.ko $(MODULE_DIR)
	/sbin/depmod
	sync

uninstall:
	-rm $(MODULE_DIR)/mmsoundcore.ko
	-/sbin/rmmod mmsoundcore

load: mmsoundcore.ko
	/sbin/modprobe mmsoundcore
	sync

unload:
	/sbin/rmmod mmsoundcore

