orinoco: add orinoco_usb driver
[orinoco_usb.git] / Makefile
blob2889dd387df267539d820fc0119315a828bebe49
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)
7 ifeq (,$(KERNEL_PATH))
8 $(error Kernel tree not found - please set KERNEL_PATH)
9 endif
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)
16 endif
17 endif
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' \
24 $(VERSION_HEADER))
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
32 TAR = tar
33 DEPMOD = /sbin/depmod
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 \
40 README README.orinoco
41 DISTNAME = orinoco-$(VERSION)
43 DRV_DIR_ABS = $(shell pwd)/$(DRV_DIR)
44 VERSION = $(shell sed -ne 's/"//g;s/^\#define DRIVER_VERSION //p' \
45 $(DRV_DIR)/orinoco.h)
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
89 ifdef CONFIG_PPC_PMAC
90 KBUILD_FLAGS += CONFIG_APPLE_AIRPORT=m
91 endif
93 ifdef CONFIG_PCI
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
98 endif
100 ifdef CONFIG_PCMCIA
101 KBUILD_FLAGS += CONFIG_PCMCIA_HERMES=m
102 ifdef CONFIG_FW_LOADER
103 KBUILD_FLAGS += CONFIG_PCMCIA_SPECTRUM=m
104 endif
105 endif
107 ifdef CONFIG_USB
108 ifdef CONFIG_FW_LOADER
109 KBUILD_FLAGS += CONFIG_ORINOCO_USB=m
110 endif
111 endif
113 all: modules
115 modules:
116 $(MAKE) $(KBUILD_FLAGS) modules
118 install: all
119 $(MAKE) $(KBUILD_FLAGS) modules_install \
120 INSTALL_MOD_DIR=kernel/$(DRV_DIR)
121 $(DEPMOD) -ae
123 clean:
124 rm -rf $(addprefix $(DRV_DIR)/,modules.order .*.cmd *.o *.ko *.mod.c \
125 .tmp_versions *.symvers)
127 check:
128 $(MAKE) $(KBUILD_FLAGS) C=2 CF="$(SPARSE_FLAGS)" modules
130 ChangeLog: CVS/Entries
131 cvs2cl
133 dist:
134 rm -rf $(DISTNAME)
135 mkdir -p $(DISTNAME)
136 for f in $(DISTFILES); do \
137 mkdir -p `dirname $(DISTNAME)/$$f`; \
138 cp -f $$f $(DISTNAME)/$$f || exit 1; \
139 done
140 $(TAR) cvfz $(DISTNAME).tar.gz $(DISTNAME)
141 rm -rf $(DISTNAME)
143 .PHONY: all clean dist modules