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