2013-02-20 16:15:29 +00:00
|
|
|
LIB_DIR = $(REP_DIR)/src/lib/usb
|
|
|
|
LIB_INC_DIR = $(LIB_DIR)/include
|
|
|
|
|
2014-11-22 14:10:09 +00:00
|
|
|
# FIXME should we *really* dde_kit to this shared library?
|
|
|
|
LIBS += dde_kit libc-setjmp config
|
2013-02-20 16:15:29 +00:00
|
|
|
SRC_CC += main.cc lx_emul.cc irq.cc timer.cc event.cc storage.cc \
|
|
|
|
input_component.cc nic.cc
|
|
|
|
SRC_C += dummies.c scsi.c evdev.c
|
|
|
|
|
2014-10-29 17:52:47 +00:00
|
|
|
LX_CONTRIB_DIR := $(call select_from_ports,dde_linux)/src/lib/usb
|
2014-05-20 14:09:29 +00:00
|
|
|
DRIVERS_DIR := $(LX_CONTRIB_DIR)/drivers
|
|
|
|
USB_DIR := $(DRIVERS_DIR)/usb
|
2013-02-20 16:15:29 +00:00
|
|
|
|
2013-05-16 10:17:03 +00:00
|
|
|
CC_OLEVEL = -O2
|
2013-04-17 15:58:46 +00:00
|
|
|
|
2013-02-20 16:15:29 +00:00
|
|
|
#
|
|
|
|
# The order of include-search directories is important, we need to look into
|
|
|
|
# 'contrib' before falling back to our custom 'lx_emul.h' header.
|
|
|
|
#
|
|
|
|
INC_DIR += $(LIB_INC_DIR)
|
2014-05-20 14:09:29 +00:00
|
|
|
INC_DIR += $(LX_CONTRIB_DIR)/include $(LX_CONTRIB_DIR)/include/uapi $(LX_CONTRIB_DIR)
|
2013-02-20 16:15:29 +00:00
|
|
|
|
|
|
|
CC_OPT += -U__linux__ -D__KERNEL__
|
2014-06-02 11:50:17 +00:00
|
|
|
CC_OPT += -DCONFIG_USB_DEVICEFS -DCONFIG_HOTPLUG -DDEBUG -DCONFIG_USB_PHY=1
|
2013-02-20 16:15:29 +00:00
|
|
|
|
|
|
|
CC_WARN = -Wall -Wno-unused-variable -Wno-uninitialized \
|
2014-06-02 11:50:17 +00:00
|
|
|
-Wno-unused-function -Wno-overflow
|
2013-02-20 16:15:29 +00:00
|
|
|
|
2014-10-29 17:52:47 +00:00
|
|
|
CC_C_OPT += -Wno-unused-but-set-variable -Wno-pointer-sign -Wno-unused-label
|
2013-02-20 16:15:29 +00:00
|
|
|
|
2013-08-26 11:58:58 +00:00
|
|
|
CXX_OPT = -fpermissive
|
2014-06-02 11:50:17 +00:00
|
|
|
CC_CXX_OPT = -fpermissive
|
|
|
|
|
2013-02-20 16:15:29 +00:00
|
|
|
#
|
|
|
|
# Suffix of global 'module_init' function
|
|
|
|
#
|
|
|
|
MOD_SUFFIX =
|
|
|
|
CC_OPT += -DMOD_SUFFIX=$(MOD_SUFFIX)
|
|
|
|
|
2014-12-02 15:04:47 +00:00
|
|
|
# common lib
|
|
|
|
SRC_C += lib/int_sqrt.c
|
|
|
|
|
2013-02-20 16:15:29 +00:00
|
|
|
# USB core
|
|
|
|
SRC_C += $(addprefix usb/core/,$(notdir $(wildcard $(USB_DIR)/core/*.c)))
|
|
|
|
SRC_C += usb/usb-common.c
|
|
|
|
|
|
|
|
# USB host-controller driver
|
|
|
|
SRC_C += $(addprefix usb/host/, ehci-hcd.c)
|
|
|
|
|
|
|
|
# USB hid
|
2013-03-25 16:56:00 +00:00
|
|
|
SRC_C += $(addprefix hid/usbhid/, hid-core.c hid-quirks.c)
|
2014-12-02 15:04:47 +00:00
|
|
|
SRC_C += $(addprefix hid/, hid-core.c hid-generic.c hid-input.c \
|
|
|
|
hid-cherry.c hid-multitouch.c)
|
2014-07-11 14:08:59 +00:00
|
|
|
SRC_C += $(addprefix input/, evdev.c input.c input-mt.c)
|
2014-12-02 15:04:47 +00:00
|
|
|
SRC_C += $(addprefix input/, tablet/wacom_sys.c tablet/wacom_wac.c)
|
2013-02-20 16:15:29 +00:00
|
|
|
|
|
|
|
# USB storage
|
|
|
|
SRC_C += $(addprefix usb/storage/,scsiglue.c protocol.c transport.c usb.c \
|
|
|
|
initializers.c option_ms.c sierra_ms.c usual-tables.c)
|
|
|
|
|
|
|
|
# SCSI
|
|
|
|
SRC_C += $(addprefix scsi/,scsi.c constants.c)
|
|
|
|
|
2014-06-02 11:50:17 +00:00
|
|
|
|
2013-02-20 16:15:29 +00:00
|
|
|
#
|
|
|
|
# Determine the header files included by the contrib code. For each
|
|
|
|
# of these header files we create a symlink to 'lx_emul.h'.
|
|
|
|
#
|
2014-05-20 14:09:29 +00:00
|
|
|
GEN_INCLUDES := $(shell grep -rh "^\#include .*\/" $(LX_CONTRIB_DIR) |\
|
2013-08-26 11:58:58 +00:00
|
|
|
sed "s/^\#include [^<\"]*[<\"]\([^>\"]*\)[>\"].*/\1/" | sort | uniq)
|
2013-02-20 16:15:29 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Filter out original Linux headers that exist in the contrib directory
|
|
|
|
#
|
2014-05-20 14:09:29 +00:00
|
|
|
NO_GEN_INCLUDES := $(shell cd $(LX_CONTRIB_DIR)/include; find -name "*.h" | sed "s/.\///" | sed "s/.*include\///")
|
2013-02-20 16:15:29 +00:00
|
|
|
GEN_INCLUDES := $(filter-out $(NO_GEN_INCLUDES),$(GEN_INCLUDES))
|
|
|
|
|
|
|
|
#
|
|
|
|
# Put Linux headers in 'GEN_INC' dir, since some include use "../../" paths use
|
|
|
|
# three level include hierarchy
|
|
|
|
#
|
|
|
|
GEN_INC := $(shell pwd)/include/include/include
|
|
|
|
|
|
|
|
$(shell mkdir -p $(GEN_INC))
|
|
|
|
|
|
|
|
GEN_INCLUDES := $(addprefix $(GEN_INC)/,$(GEN_INCLUDES))
|
|
|
|
INC_DIR += $(GEN_INC)
|
|
|
|
|
|
|
|
#
|
|
|
|
# Make sure to create the header symlinks prior building
|
|
|
|
#
|
|
|
|
$(SRC_C:.c=.o) $(SRC_CC:.cc=.o): $(GEN_INCLUDES)
|
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
# Add suffix, since there are two hid-core.c with the same module init function
|
|
|
|
#
|
|
|
|
hid/hid-core.o: MOD_SUFFIX="_core"
|
|
|
|
|
|
|
|
$(GEN_INCLUDES):
|
|
|
|
$(VERBOSE)mkdir -p $(dir $@)
|
|
|
|
$(VERBOSE)ln -s $(LIB_INC_DIR)/lx_emul.h $@
|
|
|
|
|
|
|
|
vpath %.c $(DRIVERS_DIR)
|
|
|
|
vpath %.c $(LIB_DIR)
|
|
|
|
vpath %.cc $(LIB_DIR)
|
|
|
|
vpath %.cc $(LIB_DIR)/signal
|
|
|
|
vpath %.c $(LIB_DIR)/input
|
|
|
|
vpath %.cc $(LIB_DIR)/input
|
|
|
|
vpath %.cc $(LIB_DIR)/storage
|
|
|
|
vpath %.c $(LIB_DIR)/storage
|
|
|
|
vpath %.cc $(LIB_DIR)/nic
|
2014-12-02 15:04:47 +00:00
|
|
|
vpath lib/int_sqrt.c $(LX_CONTRIB_DIR)
|
2013-03-25 16:56:00 +00:00
|
|
|
|
|
|
|
# vi: set ft=make :
|