-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
76 lines (64 loc) · 1.89 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
MDIR := lego
KVER ?= $(shell uname -r)
KDIR ?= /lib/modules/$(KVER)/build
# only build the stuff that does not depend on EV3 Intelligent Brick hardware
export CONFIG_LEGO_DRIVERS = m
export CONFIG_LEGO_PORTS = m
export CONFIG_LEGOEV3_MOTORS = n
export CONFIG_LEGO_SERVO_MOTORS = m
export CONFIG_LEGO_DC_MOTORS = m
export CONFIG_LEGO_TACHO_MOTORS = m
export CONFIG_LEGO_SENSORS = m
export CONFIG_NXT_ANALOG_SENSORS = m
export CONFIG_EV3_ANALOG_SENSORS = m
# I2C sensors require modifications to the core I2C kernel driver
export CONFIG_NXT_I2C_SENSORS = n
export CONFIG_EV3_UART_SENSORS = m
export CONFIG_WEDO = m
ifneq ($(KERNELRELEASE),)
ifeq ($(CONFIG_LEGO_DRIVERS), m)
KBUILD_CFLAGS += -DCONFIG_LEGO_DRIVERS_MODULE
endif
ifeq ($(CONFIG_LEGO_PORTS), m)
KBUILD_CFLAGS += -DCONFIG_LEGO_PORTS_MODULE
endif
ifeq ($(CONFIG_LEGOEV3_MOTORS), m)
KBUILD_CFLAGS += -DCONFIG_LEGOEV3_MOTORS_MODULE
endif
ifeq ($(CONFIG_LEGO_SERVO_MOTORS), m)
KBUILD_CFLAGS += -DCONFIG_LEGO_SERVO_MOTORS_MODULE
endif
ifeq ($(CONFIG_LEGO_TACHO_MOTORS), m)
KBUILD_CFLAGS += -DCONFIG_LEGO_TACHO_MOTORS_MODULE
endif
ifeq ($(CONFIG_LEGO_SENSORS), m)
KBUILD_CFLAGS += -DCONFIG_LEGO_SENSORS_MODULE
endif
ifeq ($(CONFIG_NXT_ANALOG_SENSORS), m)
KBUILD_CFLAGS += -DCONFIG_NXT_ANALOG_SENSORS_MODULE
endif
ifeq ($(CONFIG_EV3_ANALOG_SENSORS), m)
KBUILD_CFLAGS += -DCONFIG_EV3_ANALOG_SENSORS_MODULE
endif
ifeq ($(CONFIG_NXT_I2C_SENSORS), m)
KBUILD_CFLAGS += -DCONFIG_NXT_I2C_SENSORS_MODULE
endif
ifeq ($(CONFIG_EV3_UART_SENSORS), m)
KBUILD_CFLAGS += -DCONFIG_EV3_UART_SENSORS_MODULE
endif
ifeq ($(CONFIG_WEDO), m)
KBUILD_CFLAGS += -DCONFIG_WEDO_MODULE
endif
obj-y := $(MDIR)/
else
all: modules
modules:
$(MAKE) -C $(KDIR) M="$(CURDIR)" modules
install: modules
$(MAKE) INSTALL_MOD_PATH=$(DESTDIR) INSTALL_MOD_DIR=$(MDIR) \
-C $(KDIR) M="$(CURDIR)" modules_install
clean:
$(MAKE) -C $(KDIR) M="$(CURDIR)" clean
help:
$(MAKE) -C $(KDIR) M="$(CURDIR)" help
endif