2008-12-13 06:32:16 +03:00
|
|
|
|
|
|
|
CC = gcc
|
2010-09-03 13:42:20 +04:00
|
|
|
|
|
|
|
|
2011-02-17 14:32:46 +03:00
|
|
|
DRV_DIR = $(CURDIR)/../..
|
2010-09-03 13:42:20 +04:00
|
|
|
|
2011-02-17 14:32:46 +03:00
|
|
|
DRV_INCLUDES = $(DRV_DIR)/include
|
2010-09-03 13:42:20 +04:00
|
|
|
|
|
|
|
|
2011-02-17 14:32:46 +03:00
|
|
|
INCLUDES = -I$(DRV_INCLUDES) -I$(DRV_DIR)/include/linux
|
2008-12-13 06:32:16 +03:00
|
|
|
|
2011-02-17 14:32:46 +03:00
|
|
|
DEFINES = -D__KERNEL__ -DCONFIG_X86_32
|
2008-12-13 06:32:16 +03:00
|
|
|
|
2011-02-17 14:32:46 +03: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 06:32:16 +03:00
|
|
|
|
2011-02-17 14:32:46 +03:00
|
|
|
LIBPATH:= -L$(DRV_DIR)/ddk
|
2008-12-13 06:32:16 +03:00
|
|
|
|
2011-02-17 14:32:46 +03:00
|
|
|
LIBS:= -lgcc -lddk -lcore
|
2008-12-13 06:32:16 +03:00
|
|
|
|
|
|
|
|
2011-02-17 14:32:46 +03:00
|
|
|
NAME= usb
|
2008-12-13 06:32:16 +03:00
|
|
|
|
2011-02-17 14:32:46 +03:00
|
|
|
NAME_SRCS= usb.c \
|
|
|
|
buffer.c
|
2008-12-13 06:32:16 +03:00
|
|
|
|
2011-02-17 14:32:46 +03:00
|
|
|
SRC_DEP = hcd.inc \
|
|
|
|
detect.inc \
|
|
|
|
hid.inc \
|
|
|
|
pci.inc \
|
2008-12-13 06:32:16 +03:00
|
|
|
|
|
|
|
|
2011-02-17 14:32:46 +03:00
|
|
|
all: $(NAME).dll
|
2008-12-13 06:32:16 +03:00
|
|
|
|
2011-02-17 14:32:46 +03:00
|
|
|
NAME_OBJS = $(patsubst %.S, %.o, $(patsubst %.asm, %.o,\
|
|
|
|
$(patsubst %.c, %.o, $(NAME_SRCS))))
|
2008-12-13 06:32:16 +03:00
|
|
|
|
2011-02-17 14:32:46 +03: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 06:32:16 +03:00
|
|
|
as -o $@ $<
|
|
|
|
|
|
|
|
|
2011-02-17 14:32:46 +03:00
|
|
|
|