#############################################################################
#
#     Firefly X10 Linux Kernel driver
#     File:    makefile
#     Version: 1.1
#     Copyright 2003 Heber Limited (http://www.heber.co.uk)
#
#     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, or (at your option) any
#     later version.
#
#     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.,
#     675 Mass Ave, Cambridge, MA 02139, USA.
#
#     Changes:
#     1.1 MJB       Renamed source file "driver_init.c" to "x10_driver.c"
#                   because previously there could be some confusion when
#                   compiling into a static kernel build, 11/11/03
#     1.0 MJB       First version, 30/9/2003
#
#############################################################################

CC=gcc
LD=ld
KERNELH = -I/lib/modules/`uname -r`/build/include
KERNELDIR = /usr/src/linux
include $(KERNELDIR)/.config
CFLAGS = -O -D__KERNEL__ -DMODULE -Wall $(KERNELH)

ifdef CONFIG_SMP
	CFLAGS += -D__SMP__ -DSMP
endif

ifdef X10_USB_DEBUG
	CFLAGS += -D_X10_USB_DEBUG
endif


all : clean binaries


binaries : X10.o


clean : FORCE
	rm -f obj/x10_driver.o
	rm -f X10.o


X10.o:	obj/x10_driver.o
	$(LD) -r obj/x10_driver.o -o X10.o
	chmod 666 X10.o


obj/x10_driver.o: x10_driver.c
	$(CC) $(CFLAGS) -c -o obj/x10_driver.o x10_driver.c


FORCE :
