2008-12-13 04:32:16 +01:00
|
|
|
|
|
|
|
CC = gcc
|
|
|
|
CFLAGS = -c -O2 -fomit-frame-pointer -fno-builtin-printf
|
2010-09-03 11:42:20 +02:00
|
|
|
LDFLAGS = -nostdlib -shared -s -Map usb.map --image-base 0\
|
|
|
|
--file-alignment 512 --section-alignment 4096
|
|
|
|
|
|
|
|
DEFINES = -D__KERNEL__ -DCONFIG_X86_32
|
|
|
|
|
|
|
|
DRV_TOPDIR = $(CURDIR)/../..
|
|
|
|
|
|
|
|
DRV_INCLUDES = $(DRV_TOPDIR)/include
|
|
|
|
|
|
|
|
INCLUDES = -I$(DRV_INCLUDES) \
|
|
|
|
-I$(DRV_INCLUDES)/linux
|
|
|
|
|
|
|
|
LIBPATH = $(DRV_TOPDIR)/ddk
|
2008-12-13 04:32:16 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SRC_DEP:= pci.inc \
|
|
|
|
detect.inc \
|
|
|
|
hcd.inc \
|
|
|
|
hid.inc
|
|
|
|
|
|
|
|
USB_SRC:= usb.c
|
|
|
|
|
|
|
|
USB_OBJ:= usb.obj
|
|
|
|
|
2010-09-13 22:07:22 +02:00
|
|
|
LIBS:= -lddk -lcore
|
2008-12-13 04:32:16 +01:00
|
|
|
|
|
|
|
USB = usb.dll
|
|
|
|
|
|
|
|
all: $(USB)
|
|
|
|
|
|
|
|
$(USB): $(USB_OBJ) $(SRC_DEP) $(HFILES) Makefile
|
2010-09-03 11:42:20 +02:00
|
|
|
ld $(LDFLAGS) -L$(LIBPATH) -T usb.lds -o $@ $(USB_OBJ) $(LIBS)
|
2008-12-13 04:32:16 +01:00
|
|
|
kpack.exe usb.dll usb.drv
|
|
|
|
|
|
|
|
usb.obj : usb.c $(SRC_DEP) $(HFILES) Makefile
|
2010-09-03 11:42:20 +02:00
|
|
|
$(CC) $(DEFINES) $(INCLUDES) $(CFLAGS) -o usb.obj usb.c
|
2008-12-13 04:32:16 +01:00
|
|
|
|
|
|
|
%.obj : %.c $(HFILES)
|
|
|
|
$(CC) $(CFLAGS) -o $@ $<
|
|
|
|
|
|
|
|
%.obj: %.asm
|
|
|
|
as -o $@ $<
|
|
|
|
|
|
|
|
|