# Generated automatically from Makefile.in by configure.
#   -*-Makefile-*- template for the LegoUSB kernel module.
#
#   Copyright 2002 Doug Hunt,
#   based on CIPE Makefile.in, Copyright 1996 Olaf Titz <olaf@bigred.inka.de>
#
#   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.

MODDIR:=/lib/modules/2.4.18-19.7.x/misc

MAKE=	   gmake
CC=	   gcc
KCC=	   gcc
KCPPFLAGS= -I. -Iinclude 
KCFLAGS=   -D__KERNEL__ -I/usr/src/linux-2.4.18-19.7.x/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -fomit-frame-pointer -pipe -mpreferred-stack-boundary=2 -DMODULE
KDEFS=	   -DKCC_BUILD
KLDFLAGS=  -r -S
UCPPFLAGS= -I/usr/src/linux-2.4.18-19.7.x/include -I. -Iinclude 
UCFLAGS=   -pipe -O3 -fno-inline-functions -Wall -Wstrict-prototypes -fomit-frame-pointer -fno-strength-reduce -g 
UDEFS=	   
ULDFLAGS=  
ULIBS=	   
KINC=	   /usr/src/linux-2.4.18-19.7.x/include
AR=        /usr/bin/ar
RANLIB=    ranlib

MODULE=	   LegoUSB.o
APILIB=    liblegousbapi.a

all::	$(MODULE) $(APILIB)

install:: all
	/sbin/modprobe -r LegoUSB
	mkdir -p $(MODDIR)
	install -m 644 $(MODULE) $(MODDIR)
	/sbin/insmod $(MODDIR)/$(MODULE) debug=1 config_num=4 usb_reset=1
	rm -f /dev/usb/lego0
	mknod --mode=a=rw /dev/usb/lego0 c 180 200


KOBJS:=	LegoUSB.o
OBJS:= legousbapi.o

$(KOBJS): %.o: %.c
	$(KCC) -MD $(KDEFS) $(KCPPFLAGS) $(KCFLAGS) -o $@ -c $<

$(OBJS): %.o: %.c
	$(CC) $(UCPPFLAGS) $(UCFLAGS) -o $@ -c $<

liblegousbapi.a: legousbapi.o
	$(AR) rc $@ legousbapi.o 
	$(RANLIB) $@

clean::
	rm -rf $(MODULE) $(APILIB) core *.[oaisd] config.log config.status *.cache Makefile

