Makefile 2.1 KB

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