1 # KERNEL_PATH is the path to the Linux kernel build tree. It is usually
2 # the same as the kernel tree, except when a separate directory was used
3 # for the binaries. By default, we try to compile the modules for the
4 # currently running kernel.
5 KERNEL_PATH ?
= $(shell readlink
-f
/lib
/modules
/`uname -r`/build
)
8 $(error Kernel tree not found
- please set KERNEL_PATH
)
11 VERSION_HEADER
= $(KERNEL_PATH
)/include/linux
/utsrelease.h
12 ifeq (,$(wildcard $(VERSION_HEADER
)))
13 VERSION_HEADER
= $(KERNEL_PATH
)/include/linux
/version.h
14 ifeq (,$(wildcard $(VERSION_HEADER
)))
15 $(error Kernel in
$(KERNEL_PATH
) is not configured
)
19 -include $(KERNEL_PATH
)/.config
21 # Kernel Makefile doesn't always know the exact kernel version, so we
22 # get it from the kernel headers instead and pass it to make.
23 KERNELRELEASE
= $(shell sed
-ne
's/"//g;s/^\#define UTS_RELEASE //p' \
26 SRCS
= airport.c hermes.c hermes.h hermes_rid.h orinoco.c orinoco.h \
27 orinoco_cs.c orinoco_nortel.c orinoco_pci.c orinoco_pci.h \
28 orinoco_plx.c orinoco_tmd.c spectrum_cs.c orinoco_usb.c
30 DRV_DIR
= drivers
/net
/wireless
/orinoco
35 SPARSE_FLAGS
= -Wbitwise
-Wcast-to-as
-Wcontext
-Wdefault-bitfield-sign \
36 -Wtransparent-union
-Wptr-subtraction-blows
-Wundef
-Wdecl \
37 -Wone-bit-signed-bitfield
-Wtypesign
-D__CHECK_ENDIAN__
39 DISTFILES
= $(addprefix $(DRV_DIR
)/,$(SRCS
) Kbuild compat.h
) Makefile NEWS \
41 DISTNAME
= orinoco-
$(VERSION
)
43 DRV_DIR_ABS
= $(shell pwd
)/$(DRV_DIR
)
44 VERSION
= $(shell sed
-ne
's/"//g;s/^\#define DRIVER_VERSION //p' \
47 KBUILD_FLAGS
= -C
$(KERNEL_PATH
) M
=$(DRV_DIR_ABS
) KERNELRELEASE
=$(KERNELRELEASE
)
50 # Unset flags enabling missing drivers
51 KBUILD_FLAGS
+= CONFIG_ADM8211
=
52 KBUILD_FLAGS
+= CONFIG_AIRO
=
53 KBUILD_FLAGS
+= CONFIG_AIRO_CS
=
54 KBUILD_FLAGS
+= CONFIG_ARLAN
=
55 KBUILD_FLAGS
+= CONFIG_ATH5K
=
56 KBUILD_FLAGS
+= CONFIG_ATMEL
=
57 KBUILD_FLAGS
+= CONFIG_B43
=
58 KBUILD_FLAGS
+= CONFIG_B43LEGACY
=
59 KBUILD_FLAGS
+= CONFIG_BCM43XX
=
60 KBUILD_FLAGS
+= CONFIG_HOSTAP
=
61 KBUILD_FLAGS
+= CONFIG_IPW2100
=
62 KBUILD_FLAGS
+= CONFIG_IPW2200
=
63 KBUILD_FLAGS
+= CONFIG_IWL3945
=
64 KBUILD_FLAGS
+= CONFIG_IWL4965
=
65 KBUILD_FLAGS
+= CONFIG_LIBERTAS
=
66 KBUILD_FLAGS
+= CONFIG_P54_COMMON
=
67 KBUILD_FLAGS
+= CONFIG_P54_PCI
=
68 KBUILD_FLAGS
+= CONFIG_P54_USB
=
69 KBUILD_FLAGS
+= CONFIG_PCI_ATMEL
=
70 KBUILD_FLAGS
+= CONFIG_PCMCIA_ATMEL
=
71 KBUILD_FLAGS
+= CONFIG_PCMCIA_NETWAVE
=
72 KBUILD_FLAGS
+= CONFIG_PCMCIA_RAYCS
=
73 KBUILD_FLAGS
+= CONFIG_PCMCIA_WAVELAN
=
74 KBUILD_FLAGS
+= CONFIG_PCMCIA_WL3501
=
75 KBUILD_FLAGS
+= CONFIG_PRISM54
=
76 KBUILD_FLAGS
+= CONFIG_RT2X00
=
77 KBUILD_FLAGS
+= CONFIG_RTL8180
=
78 KBUILD_FLAGS
+= CONFIG_RTL8187
=
79 KBUILD_FLAGS
+= CONFIG_STRIP
=
80 KBUILD_FLAGS
+= CONFIG_USB_ATMEL
=
81 KBUILD_FLAGS
+= CONFIG_USB_NET_RNDIS_WLAN
=
82 KBUILD_FLAGS
+= CONFIG_USB_ZD1201
=
83 KBUILD_FLAGS
+= CONFIG_WAVELAN
=
84 KBUILD_FLAGS
+= CONFIG_ZD1211RW
=
86 # Enable all drivers with sources if the kernel configuration allows them
87 KBUILD_FLAGS
+= CONFIG_HERMES
=m
90 KBUILD_FLAGS
+= CONFIG_APPLE_AIRPORT
=m
94 KBUILD_FLAGS
+= CONFIG_PLX_HERMES
=m
95 KBUILD_FLAGS
+= CONFIG_PCI_HERMES
=m
96 KBUILD_FLAGS
+= CONFIG_TMD_HERMES
=m
97 KBUILD_FLAGS
+= CONFIG_NORTEL_HERMES
=m
101 KBUILD_FLAGS
+= CONFIG_PCMCIA_HERMES
=m
102 ifdef CONFIG_FW_LOADER
103 KBUILD_FLAGS
+= CONFIG_PCMCIA_SPECTRUM
=m
108 ifdef CONFIG_FW_LOADER
109 KBUILD_FLAGS
+= CONFIG_ORINOCO_USB
=m
116 $(MAKE
) $(KBUILD_FLAGS
) modules
119 $(MAKE
) $(KBUILD_FLAGS
) modules_install \
120 INSTALL_MOD_DIR
=kernel
/$(DRV_DIR
)
124 rm -rf
$(addprefix $(DRV_DIR
)/,modules.order .
*.cmd
*.o
*.ko
*.mod.c \
125 .tmp_versions
*.symvers
)
128 $(MAKE
) $(KBUILD_FLAGS
) C
=2 CF
="$(SPARSE_FLAGS)" modules
130 ChangeLog
: CVS
/Entries
136 for f in
$(DISTFILES
); do \
137 mkdir
-p
`dirname $(DISTNAME)/$$f`; \
138 cp
-f
$$f $(DISTNAME
)/$$f || exit
1; \
140 $(TAR
) cvfz
$(DISTNAME
).
tar.gz
$(DISTNAME
)
143 .PHONY
: all clean dist modules