Makefile 927 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. # changelog :
  2. #------------
  3. # naresh - 29-Mar-2007 : cyan_00391
  4. # fixed the code which detects the existing kernel module
  5. #
  6. # Notes:
  7. # -----------
  8. # This clever makefile was shamelessly copied from the ivtv project.
  9. #
  10. # By default, the build is done against the running kernel version.
  11. # to build against a different kernel version, set KVER
  12. #
  13. # make KVER=2.6.11-alpha
  14. #
  15. # Alternatively, set KDIR
  16. #
  17. # make KDIR=/usr/src/linux
  18. V ?= 0
  19. MDIR := extra
  20. KVER ?= $(shell uname -r)
  21. KDIR ?= /lib/modules/$(KVER)/build
  22. FWDIR ?= /lib/firmware
  23. obj-m += r5u870v2.o
  24. r5u870v2-objs := main.o webcam.o urb.o uvc.o
  25. all::
  26. $(MAKE) -C $(KDIR) M=$(CURDIR) V=$(V) modules
  27. install:: all
  28. $(MAKE) INSTALL_MOD_PATH=$(DESTDIR) INSTALL_MOD_DIR=$(MDIR) \
  29. -C $(KDIR) M=$(CURDIR) modules_install
  30. /sbin/depmod -a
  31. firmware_install::
  32. cd firmware && ${MAKE} firmware_install
  33. clean::
  34. $(MAKE) -C $(KDIR) M=$(CURDIR) clean
  35. rm -f Module.symvers