##########################################################################
#                                                                        #
#  This program is free software; you can redistribute it and/or modify  #
#  it under the terms of the GNU General Public License as published by  #
#  the Free Software Foundation; either version 2 of the License, or     #
#  (at your option) any later version.                                   #
#                                                                        #
#  Copyright (c) 2005 Pawel Kot                                          #
#                                                                        #
##########################################################################

MODULE		:= nokia_dku2
MODULE_ROOT	:= /lib/modules/$(shell uname -r)/kernel/drivers/usb/serial

INCLUDE		:= -I/lib/modules/$(shell uname -r)/build/include/linux -I/lib/modules/$(shell uname -r)/build/drivers/usb/serial
CFLAGS		:= -O2 -DMODULE -D__KERNEL__ ${INCLUDE}

${MODULE}.o: ${MODULE}.c

.PHONY: clean

clean:
	@rm -f .*.{cmd,flags}
	@rm -f ${MODULE}.o $(VERSION_HEADER)
	@rm -fr .tmp_versions
	@rm -f *~

install:
	if ! [ -f ${MODULE}.o ]; then \
		module; \
	fi
	install -m 744 -o 0 -g 0 ${MODULE}.o $(MODULE_ROOT)
	/sbin/depmod -a
