summaryrefslogtreecommitdiff
path: root/src/2.6.11/Makefile.in
blob: c5af401b485c87cce8a23c811145ded2f0445893 (plain)
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
############################ 2.6 kernel compile ###############################
ifneq ($(KERNELRELEASE),)
# We were called by kbuild
# Do NOT indent stuff in this part! It has to be like this to make the
# $(error ... ) stuff work

# only compile those modules which are enabled by global configure
ifeq ($(WCM_OPTION_HID),yes)

# check if kernel was configured to have hid as an module
ifeq ($(CONFIG_USB_HID),m)

# check if HID module should be usbhid.ko or hid.ko
NEWHID := $(shell test $(SUBLEVEL) -ge 6 && echo usb)

$(NEWHID)hid-objs := hid-core.o

# behave exactly as kernel config wants us to behave
ifeq ($(CONFIG_USB_HIDDEV),y)
$(NEWHID)hid-objs += hiddev.o
endif
ifeq ($(CONFIG_USB_HIDINPUT),y)
$(NEWHID)hid-objs += hid-input.o
endif
ifeq ($(CONFIG_HID_PID),y)
$(NEWHID)hid-objs += pid.o
endif
ifeq ($(CONFIG_LOGITECH_FF),y)
$(NEWHID)hid-objs += hid-lgff.o
endif
ifeq ($(CONFIG_THRUSTMASTER_FF),y)
$(NEWHID)hid-objs += hid-tmff.o
endif
ifeq ($(CONFIG_HID_FF),y)
$(NEWHID)hid-objs += hid-ff.o
endif

obj-$(CONFIG_USB_HID) += $(NEWHID)hid.o

else
ifeq ($(CONFIG_USB_HID),y)
$(error You requested to build hid with configure, but hid is configured as built-in in your kernel config)
endif

$(error You requested to build hid with configure, but hid is not configured in your kernel config)
endif # CONFIG_USB_HID
endif # WCM_OPTION_HID not

ifeq ($(WCM_OPTION_WACOM),yes)
ifneq ($(CONFIG_USB_WACOM),y)
wacom-objs := wacom_wac.o wacom_sys.o
obj-m += wacom.o
else
$(error You requested to build wacom with configure, but wacom is configured as built-in in your kernel config)
endif # CONFIG_USB_WACOM
endif # WCM_OPTION_WACOM

else  # We were called from command line
PWD  := $(shell pwd)

KDIR := @WCM_KERNELDIR@
WCM_OPTION_WACOM := @WCM_OPTION_WACOM@
WCM_OPTION_HID := @WCM_OPTION_HID@

export WCM_OPTION_WACOM WCM_OPTION_HID

COPY_FROM_KERNEL_TREE := hiddev.c hid.h hid-ff.c hid-input.c fixp-arith.h
COPY_FROM_KERNEL_TREE += hid-lgff.c hid-tmff.c pid.c pid.h

all:
# Copy hid-stuff from kernel-dir to local dir
ifeq ($(WCM_OPTION_HID),yes)
	@for i in $(COPY_FROM_KERNEL_TREE); do \
		if test ! -f "$$i" && test -f $(KDIR)/drivers/usb/input/$$i ; then \
			cp $(KDIR)/drivers/usb/input/$$i .; \
		fi; \
	done
endif

# Copy Wacom specific code which is common to all kernel releases
ifeq ($(WCM_OPTION_WACOM),yes)
	cp -f ../2.6.16/wacom_wac.c .
	cp -f ../2.6.16/wacom_wac.h .
endif 
	@echo '    Building linuxwacom drivers for 2.6 kernel.'
	@echo '***Note: Drivers not enabled as modules in your kernel config but requested through configure are NOT built'
	$(MAKE) -C $(KDIR) M=$(PWD)

endif  # End kbuild check

######################### Version independent targets ##########################

clean:
	rm -rf *.o *.ko *.mod.* .[a-z]* core *.i

# also remove copied stuff
distclean: clean
	@for i in $(COPY_FROM_KERNEL_TREE); do \
		if test -f "$$i"; then \
			rm -f $$i ; \
		fi; \
	done

EMPTY_AUTOMAKE_TARGETS = distdir install install-data install-exec uninstall install-info
EMPTY_AUTOMAKE_TARGETS += installdirs check dvi pdf ps info html tags ctags mostlyclean distclean maintainer-clean
.PHONY: $(EMPTY_AUTOMAKE_TARGETS)
	$(EMPTY_AUTOMAKE_TARGETS):