[PATCH] wireless: import bcm43xx sources
[linux-2.6/sactl.git] / drivers / net / wireless / bcm43xx / Makefile
blob98d4efb1d12a075c31228050b337b3d9252e9974
1 # Makefile for bcm43xx driver
3 VERSION := 0.0.1
4 RELEASE_NAME := bcm43xx-$(VERSION)
6 # Optional path, where the SoftMAC subsystem is located.
7 # You may set SOFTMAC_DIR in your bashrc, for example.
8 SOFTMAC_DIR ?=
10 KVER := $(shell uname -r)
11 KDIR ?= /lib/modules/$(KVER)/build
12 PWD := $(shell pwd)
13 MODPATH := $(DESTDIR)/lib/modules/$(KVER)/kernel/drivers/net/bcm43xx
15 # Comment/uncomment to enable/disable debugging
16 DEBUG = y
19 ifeq ($(DEBUG),y)
20 DEBUGFS_OBJ = bcm43xx_debugfs.o
21 CFLAGS += -O2 -DCONFIG_BCM43XX_DEBUG
22 else
23 DEBUGFS_OBJ =
24 CFLAGS += -O2
25 endif
27 CFLAGS += -DBCM43xx_VERSION=$(VERSION) -I/lib/modules/$(KVER)/include
28 ifneq ($(SOFTMAC_DIR),)
29 CPPFLAGS := -I$(SOFTMAC_DIR) $(CPPFLAGS)
30 endif
32 ifneq ($(KERNELRELEASE),)
33 # call from kernel build system
35 obj-m := bcm43xx.o
36 bcm43xx-objs := bcm43xx_main.o bcm43xx_dma.o $(DEBUGFS_OBJ) \
37 bcm43xx_radio.o bcm43xx_phy.o \
38 bcm43xx_power.o bcm43xx_wx.o \
39 bcm43xx_pio.o bcm43xx_ilt.o \
40 bcm43xx_leds.o
42 else
44 default: modules
46 modules:
47 $(MAKE) -C $(KDIR) M=$(PWD) modules
49 install: bcm43xx.ko
50 install -d $(MODPATH)
51 install -m 644 -c bcm43xx.ko $(MODPATH)
52 /sbin/depmod -a
54 uninstall:
55 rm -rf $(MODPATH)
56 /sbin/depmod -a
58 endif
60 clean:
61 find . \( -name '*.ko' -o -name '*.o' -o -name '.tmp_versions' -o -name '*~' -o -name '.*.cmd' \
62 -o -name '*.mod.c' -o -name '*.tar.bz2' -o -name '*.rej' -o -name '*.orig' \)\
63 -print | xargs rm -Rf
65 depend .depend dep:
66 $(CC) $(CFLAGS) -M *.c > .depend
68 ifeq (.depend,$(wildcard .depend))
69 include .depend
70 endif
72 DISTFILES = $(shell find . \( -not -name '.' \) -print | grep -v "\.tar\.bz2" | grep -v "\/\." )
73 DISTDIR = $(RELEASE_NAME)
75 release: clean
76 @rm -rf $(DISTDIR)
77 @mkdir $(DISTDIR)
78 @chmod 777 $(DISTDIR)
79 @for file in $(DISTFILES); do \
80 if test -d $$file; then \
81 mkdir $(DISTDIR)/$$file; \
82 else \
83 cp -p $$file $(DISTDIR)/$$file; \
84 fi; \
85 done
86 @tar -c $(DISTDIR) | bzip2 -9 > $(RELEASE_NAME).tar.bz2
87 @rm -rf $(DISTDIR)