
KERNELINC :=/home/torvalds/v2.2/linux/include

# Used to making the tar.gz for a make 'save' or make 'tarball'
VERSION := 0.10

CC=gcc
CFLAGS := -D__KERNEL__ -DMODULE -D__SMP__
CFLAGS := $(CFLAGS) -I$(KERNELINC)
CFLAGS := $(CFLAGS) -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer
CFLAGS := $(CFLAGS) -pipe -fno-strength-reduce
CFLAGS := $(CFLAGS) -m486 -malign-loops=2 -malign-jumps=2 -malign-functions=2 -DCPU=586

all: usb-uhci.o kbd-stub.o

usb-uhci.o: uhci.o usb.o usb-debug.o uhci-debug.o mouse.o keyboard.o keymap.o hub.o
	ld -r -o $@ uhci.o usb.o usb-debug.o uhci-debug.o mouse.o keyboard.o keymap.o hub.o

usb-ohci.o: ohci.o usb.o usb-debug.o
	ld -r -o $@ ohci.o usb.o usb-debug.o

uhci.o: uhci.c uhci.h usb.h

ohci.o: ohci.c ohci.h usb.h

usb.o: usb.h usb.c

usb-debug.o: usb.h usb-debug.c

uhci-debug.o: usb.h uhci.h uhci-debug.c

mouse.o: mouse.c usb.h

keyboard.o: keyboard.c usb.h

keymap.c: maps/serial.map maps/usb.map maps/fixup.map
	./mkmap > $@

hub.o: hub.c hub.h

clean:
	rm -f *.o *.s keymap.c

save: clean
	cd .. ; tar czvf usb-$(VERSION).tar.gz usb-$(VERSION)

# this one is for me to make tarballs from my CVS tree.  -- greg
tarball: clean
	cd ../.. ; mv usb/simple usb-$(VERSION) ; tar czvf usb-$(VERSION).tar.gz --exclude CVS --exclude tags --exclude *.swp usb-$(VERSION) ; mv usb-$(VERSION) usb/simple

