aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/vt6656/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/staging/vt6656/Makefile')
-rw-r--r--drivers/staging/vt6656/Makefile243
1 files changed, 39 insertions, 204 deletions
diff --git a/drivers/staging/vt6656/Makefile b/drivers/staging/vt6656/Makefile
index 7d20efef555..4467bb1a608 100644
--- a/drivers/staging/vt6656/Makefile
+++ b/drivers/staging/vt6656/Makefile
@@ -1,204 +1,39 @@
1# 1# TODO: all of these should be removed
2# Build options: 2EXTRA_CFLAGS += -DLINUX -D__KERNEL__ -DMODULE -DEXPORT_SYMTAB -D__NO_VERSION__
3# 3EXTRA_CFLAGS += -DHOSTAP
4# 4
5 5vt6656-y += main_usb.o \
6HOSTAP := 1 6 card.o \
7 7 mac.o \
8 8 baseband.o \
9KSP := /lib/modules/$(shell uname -r)/build \ 9 wctl.o \
10 /usr/src/linux-$(shell uname -r) \ 10 80211mgr.o \
11 /usr/src/linux-$(shell uname -r | sed 's/-.*//') \ 11 wcmd.o\
12 /usr/src/kernel-headers-$(shell uname -r) \ 12 wmgr.o \
13 /usr/src/kernel-source-$(shell uname -r) \ 13 bssdb.o \
14 /usr/src/linux-$(shell uname -r | sed 's/\([0-9]*\.[0-9]*\)\..*/\1/') \ 14 wpa2.o \
15 /usr/src/linux 15 rxtx.o \
16 16 dpc.o \
17test_dir = $(shell [ -e $(dir)/include/linux ] && echo $(dir)) 17 power.o \
18KSP := $(foreach dir, $(KSP), $(test_dir)) 18 datarate.o \
19 19 mib.o \
20KSRC := $(firstword $(KSP)) 20 rc4.o \
21 21 tether.o \
22ifeq (,$(KSRC)) 22 tcrc.o \
23 $(error Linux kernel source not found) 23 ioctl.o \
24endif 24 hostap.o \
25 25 wpa.o \
26# check kernel version 26 key.o \
27KVER := $(shell uname -r | cut -c1-3 | sed 's/2\.[56]/2\.6/') 27 tkip.o \
28KERVER2=$(shell uname -r | cut -d. -f2) 28 michael.o \
29 29 rf.o \
30ifeq ($(KVER), 2.6) 30 iwctl.o \
31# 2.6 kernel 31 wpactl.o \
32TARGET = vntwusb.ko 32 aes_ccmp.o \
33 33 usbpipe.o \
34else 34 channel.o \
35TARGET = vntwusb.o 35 control.o \
36 36 firmware.o \
37endif 37 int.o
38 38
39INSTDIR := $(shell find /lib/modules/$(shell uname -r) -name $(TARGET) -printf "%h\n" | sort | head -1) 39obj-$(CONFIG_VT6656) += vt6656.o
40ifeq (,$(INSTDIR))
41 ifeq (,$(KERVER2))
42 ifneq (,$(wildcard /lib/modules/$(shell uname -r)/kernel))
43 INSTDIR := /lib/modules/$(shell uname -r)/kernel/drivers/net
44 else
45 INSTDIR := /lib/modules/$(shell uname -r)/net
46 endif
47 else
48 ifneq ($(KERVER2),2)
49 INSTDIR := /lib/modules/$(shell uname -r)/kernel/drivers/net
50 else
51 INSTDIR := /lib/modules/$(shell uname -r)/net
52 endif
53 endif
54endif
55
56
57SRC = main_usb.c card.c mac.c baseband.c wctl.c 80211mgr.c \
58 wcmd.c wmgr.c bssdb.c wpa2.c rxtx.c dpc.c power.c datarate.c \
59 mib.c rc4.c tether.c tcrc.c ioctl.c hostap.c wpa.c key.c \
60 tkip.c michael.c rf.c iwctl.c wpactl.c aes_ccmp.c \
61 usbpipe.c channel.c control.c firmware.c int.c
62
63
64ifeq ($(HOSTAP), 1)
65# CFLAGS += -DHOSTAP
66 EXTRA_CFLAGS += -DHOSTAP
67endif
68
69
70#CFLAGS += -I$(PWD) -I$(PWD)/../include -I$(PWD)/include
71EXTRA_CFLAGS += -I$(PWD) -I$(PWD)/../include -I$(PWD)/include
72
73# build rule
74ifeq ($(KVER), 2.6)
75# 2.6 kernel
76
77ifndef KERNEL_CONF
78KERNEL_CONF= $(KSRC)/.config
79endif
80
81include ${KERNEL_CONF}
82
83obj-m += vntwusb.o
84
85vntwusb-objs := main_usb.o card.o mac.o baseband.o wctl.o 80211mgr.o \
86 wcmd.o wmgr.o bssdb.o rxtx.o dpc.o power.o datarate.o \
87 mib.o rc4.o tether.o tcrc.o ioctl.o hostap.o wpa.o key.o tkip.o \
88 michael.o rf.o iwctl.o wpactl.o wpa2.o aes_ccmp.o \
89 usbpipe.o channel.o control.o firmware.o int.o
90
91.c.o:
92# $(CC) $(CFLAGS) -o $@ $<
93 $(CC) $(EXTRA_CFLAGS) -o $@ $<
94
95default:
96 make -C $(KSRC) SUBDIRS=$(shell pwd) modules
97
98else
99
100# 2.2/2.4 kernel
101OBJS := main_usb.o card.o mac.o baseband.o wctl.o 80211mgr.o \
102 wcmd.o wmgr.o bssdb.o rxtx.o dpc.o power.o datarate.o \
103 mib.o rc4.o tether.o tcrc.o ioctl.o hostap.o wpa.o key.o tkip.o \
104 michael.o rf.o iwctl.o wpactl.o wpa2.o aes_ccmp.o \
105 usbpipe.o channel.o control.o
106
107VERSION_FILE := $(KSRC)/include/linux/version.h
108CONFIG_FILE := $(KSRC)/include/linux/config.h
109
110
111ifeq (,$(wildcard $(VERSION_FILE)))
112 $(error Linux kernel source not configured - missing version.h)
113endif
114
115ifeq (,$(wildcard $(CONFIG_FILE)))
116 $(error Linux kernel source not configured - missing config.h)
117endif
118
119ifneq (,$(findstring egcs-2.91.66, $(shell cat /proc/version)))
120 CC := kgcc gcc cc
121else
122 CC := gcc cc
123endif
124
125test_cc = $(shell which $(cc) > /dev/null 2>&1 && echo $(cc))
126CC := $(foreach cc, $(CC), $(test_cc))
127CC := $(firstword $(CC))
128
129#CFLAGS += -Wall -DLINUX -D__KERNEL__ -DMODULE -DEXPORT_SYMTAB -D__NO_VERSION__ -O2 -pipe
130#CFLAGS += -I$(KSRC)/include -Wstrict-prototypes -fomit-frame-pointer -fno-strict-aliasing
131#CFLAGS += $(shell [ -f $(KSRC)/include/linux/modversions.h ] && \
132# echo "-DMODVERSIONS -include $(KSRC)/include/linux/modversions.h")
133EXTRA_CFLAGS += -Wall -DLINUX -D__KERNEL__ -DMODULE -DEXPORT_SYMTAB -D__NO_VERSION__ -O2 -pipe
134EXTRA_CFLAGS += -I$(KSRC)/include -Wstrict-prototypes -fomit-frame-pointer -fno-strict-aliasing
135EXTRA_CFLAGS += $(shell [ -f $(KSRC)/include/linux/modversions.h ] && \
136 echo "-DMODVERSIONS -include $(KSRC)/include/linux/modversions.h")
137
138.SILENT: $(TARGET) clean
139
140
141# look for SMP in config.h
142#SMP := $(shell $(CC) $(CFLAGS) -E -dM $(CONFIG_FILE) | \
143# grep CONFIG_SMP | awk '{ print $$3 }')
144SMP := $(shell $(CC) $(EXTRA_CFLAGS) -E -dM $(CONFIG_FILE) | \
145 grep CONFIG_SMP | awk '{ print $$3 }')
146ifneq ($(SMP),1)
147 SMP := 0
148endif
149
150
151ifeq ($(SMP), 1)
152# CFLAGS += -D__SMP__
153 EXTRA_CFLAGS += -D__SMP__
154endif
155
156
157
158# check x86_64
159SUBARCH := $(shell uname -m)
160ifeq ($(SUBARCH),x86_64)
161# CFLAGS += -mcmodel=kernel -mno-red-zone
162 EXTRA_CFLAGS += -mcmodel=kernel -mno-red-zone
163endif
164
165
166$(TARGET): $(filter-out $(TARGET), $(SRC:.c=.o))
167 $(LD) -r $^ -o $@
168 echo; echo
169 echo "**************************************************"
170 echo "Build options:"
171 echo " VERSION $(KVER)"
172 echo -n " SMP "
173 if [ "$(SMP)" = "1" ]; \
174 then echo "Enabled"; else echo "Disabled"; fi
175
176
177
178endif # ifeq ($(KVER),2.6)
179
180
181ifeq ($(KVER), 2.6)
182install: default
183else
184install: clean $(TARGET)
185endif
186 mkdir -p $(MOD_ROOT)$(INSTDIR)
187 install -m 644 -o root $(TARGET) $(MOD_ROOT)$(INSTDIR)
188
189ifeq (,$(MOD_ROOT))
190 /sbin/depmod -a || true
191else
192 /sbin/depmod -b $(MOD_ROOT) -a || true
193endif
194
195
196uninstall:
197 rm -f $(INSTDIR)/$(TARGET)
198 /sbin/depmod -a
199
200clean:
201 rm -f $(TARGET) $(SRC:.c=.o) *~ *.o
202 rm -f .*.o.d .*.o.cmd .*.ko.cmd *.mod.c *.mod.o
203
204-include .depend.mak