committed by
Christian Helmuth
parent
bcefc874d6
commit
369ff2a001
@@ -1,8 +1,8 @@
|
||||
LIB_DIR = $(REP_DIR)/src/lib/usb
|
||||
LIB_INC_DIR = $(LIB_DIR)/include
|
||||
|
||||
LIBS += libc-setjmp config
|
||||
SRC_CC += main.cc lx_emul.cc irq.cc timer.cc event.cc storage.cc \
|
||||
LIBS += usb_include libc-setjmp config
|
||||
SRC_CC += main.cc lx_emul.cc storage.cc \
|
||||
input_component.cc nic.cc raw.cc
|
||||
SRC_C += dummies.c scsi.c evdev.c raw_driver.c
|
||||
|
||||
@@ -16,11 +16,13 @@ CC_OLEVEL = -O2
|
||||
# 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)
|
||||
INC_DIR += $(LIB_INC_DIR) $(REP_DIR)/src/include
|
||||
INC_DIR += $(LX_CONTRIB_DIR)/include $(LX_CONTRIB_DIR)/include/uapi $(LX_CONTRIB_DIR)
|
||||
|
||||
CC_OPT += -U__linux__ -D__KERNEL__
|
||||
CC_OPT += -DCONFIG_USB_DEVICEFS -DCONFIG_HOTPLUG -DDEBUG -DCONFIG_USB_PHY=1
|
||||
CC_OPT += -DCONFIG_USB_DEVICEFS -DCONFIG_HOTPLUG -DDEBUG -DCONFIG_USB_PHY=1 \
|
||||
-DCONFIG_GENERIC_PHY=0 -DCONFIG_USB_OTG_WHITELIST=0 \
|
||||
-DCONFIG_USB_OTG=0
|
||||
|
||||
CC_WARN = -Wall -Wno-unused-variable -Wno-uninitialized \
|
||||
-Wno-unused-function -Wno-overflow
|
||||
@@ -35,22 +37,29 @@ CC_CXX_OPT = -fpermissive
|
||||
MOD_SUFFIX =
|
||||
CC_OPT += -DMOD_SUFFIX=$(MOD_SUFFIX)
|
||||
|
||||
# lx_kit
|
||||
SRC_CC += printf.cc work.cc timer.cc scheduler.cc irq.cc malloc.cc
|
||||
|
||||
# common lib
|
||||
SRC_C += lib/int_sqrt.c
|
||||
|
||||
# USB core
|
||||
SRC_C += $(addprefix usb/core/,$(notdir $(wildcard $(USB_DIR)/core/*.c)))
|
||||
SRC_C += usb/usb-common.c
|
||||
SRC_C += $(addprefix usb/core/, buffer.c config.c devices.c driver.c endpoint.c file.c \
|
||||
generic.c hcd.c hub.c message.c notify.c port.c quirks.c\
|
||||
urb.c usb.c)
|
||||
|
||||
# USB host-controller driver
|
||||
SRC_C += $(addprefix usb/host/, ehci-hcd.c)
|
||||
|
||||
# common
|
||||
SRC_C += usb/common/common.c
|
||||
|
||||
# USB hid
|
||||
SRC_C += $(addprefix hid/usbhid/, hid-core.c hid-quirks.c)
|
||||
SRC_C += $(addprefix hid/, hid-core.c hid-generic.c hid-input.c \
|
||||
hid-cherry.c hid-microsoft.c hid-multitouch.c)
|
||||
hid-cherry.c hid-microsoft.c hid-multitouch.c \
|
||||
wacom_sys.c wacom_wac.c)
|
||||
SRC_C += $(addprefix input/, evdev.c input.c input-mt.c)
|
||||
SRC_C += $(addprefix input/, tablet/wacom_sys.c tablet/wacom_wac.c)
|
||||
|
||||
# USB storage
|
||||
SRC_C += $(addprefix usb/storage/,scsiglue.c protocol.c transport.c usb.c \
|
||||
@@ -59,46 +68,14 @@ SRC_C += $(addprefix usb/storage/,scsiglue.c protocol.c transport.c usb.c \
|
||||
# SCSI
|
||||
SRC_C += $(addprefix scsi/,scsi.c constants.c)
|
||||
|
||||
|
||||
#
|
||||
# Determine the header files included by the contrib code. For each
|
||||
# of these header files we create a symlink to 'lx_emul.h'.
|
||||
#
|
||||
GEN_INCLUDES := $(shell grep -rh "^\#include .*\/" $(LX_CONTRIB_DIR) |\
|
||||
sed "s/^\#include [^<\"]*[<\"]\([^>\"]*\)[>\"].*/\1/" | sort | uniq)
|
||||
|
||||
#
|
||||
# Filter out original Linux headers that exist in the contrib directory
|
||||
#
|
||||
NO_GEN_INCLUDES := $(shell cd $(LX_CONTRIB_DIR)/include; find -name "*.h" | sed "s/.\///" | sed "s/.*include\///")
|
||||
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)
|
||||
|
||||
#SRC_CC = storage.cc
|
||||
#SRC_C =
|
||||
|
||||
#
|
||||
# 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)
|
||||
@@ -111,5 +88,6 @@ vpath %.cc $(LIB_DIR)/nic
|
||||
vpath %.cc $(LIB_DIR)/raw
|
||||
vpath %.c $(LIB_DIR)/raw
|
||||
vpath lib/int_sqrt.c $(LX_CONTRIB_DIR)
|
||||
vpath %.cc $(REP_DIR)/src/lx_kit
|
||||
|
||||
# vi: set ft=make :
|
||||
|
||||
Reference in New Issue
Block a user