Advertisement
Guest User

/home/xbmc/build/lirc-nct677x-src-1.0.4-ARCH/lirc_wb677/Makefile

a guest
May 29th, 2010
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Make 2.08 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # Notice :
  4. #   for dkms, make cmd was defined in dkms.conf as MAKE[0]. generally we define it as
  5. #   MAKE[0] = "make ..."
  6. #   however, when dkms build this target, it was invoked by "make KERNELRELEASE=xxx ..." instead
  7. #   that cause the plain make file below can not work again :
  8. #
  9. #       ifneq ($(KERNELRELEASE),)
  10. #           obj-m := lirc_wb667.o
  11. #           lirc_wb667-objs := lirc_wb667.o
  12. #       else
  13. #           KERNEL_SRC_TREE ?= /lib/modules/$(shell uname -r)/build
  14. #           PWD := $(shell pwd)
  15. #           modules modules_install clean:
  16. #               make -C $(KERNEL_SRC_TREE) M=$(PWD) $@
  17. #       endif
  18. #
  19. # it can not work because KERNELRELEASE was defined in dkms's case. so we should merge the two
  20. # cases together :
  21.  
  22. # on Linux 2.6 kernel
  23. # If KERNELRELEASE is defined, we've been invoked from the
  24. # kernel build system and can use its language.
  25.     LIRC_DIR := /home/xbmc/build/lirc/src/lirc-0.8.6
  26.  
  27.     obj-m += lirc_wb677.o
  28.  
  29.     lirc_wb677-objs := lirc_wb677_main.o lirc_wb677_mouse_kbd.o
  30.  
  31.     KSRC ?= /lib/modules/$(shell uname -r)/build
  32.  
  33.     PWD := $(shell pwd)
  34. modules:
  35.     echo KERNELDIR=$(KSRC)
  36.     $(MAKE) -C $(KSRC) -I $(LIRC_DIR) M=$(PWD) modules
  37.  
  38.  
  39. # Following "install", "uninstall" and "clean" are not for dkms.
  40.  
  41. install:
  42.     /etc/rc.d/lircd stop
  43.     rmmod lirc_wb677 || echo "lirc_wb677.ko is not executing"
  44.     file="lirc_wb677.ko"; \
  45.     dir="/lib/modules/$(shell uname -r)/kernel/drivers/misc/"; \
  46.     if test -d "$$dir"; then echo ""; else mkdir -p $$dir; fi; \
  47.     cp -vf *.ko $$dir
  48.     depmod -a
  49.     patch -p0 /usr/share/lirc/lirc.hwdb < /usr/share/lirc/lirc_nct667x-src-1.0.0-ubuntu9.10.patch
  50.     @echo ""
  51.     @echo "Hint: You can execute \"dpkg-reconfigure lirc\" to configure lirc."
  52.     @echo "      And start lirc by executing \"/etc/rc.d/lircd start\""
  53.  
  54. uninstall:
  55.     /etc/rc.d/lircd stop
  56.     ( rmmod lirc_wb677 ) || echo "lirc_wb677.ko is not executing"
  57.     dir="/lib/modules/$(shell uname -r)/kernel/drivers/misc/"; \
  58.     if test -d "$$dir"; then rm -R $$dir; fi;
  59.     depmod -a
  60.     patch -R -p0 /usr/share/lirc/lirc.hwdb < /usr/share/lirc/lirc_nct667x-src-1.0.0-ubuntu9.10.patch
  61.  
  62. clean:
  63.     rm -rf *.o *.ko *.mod.c Module.symvers .tmp_versions .*.cmd
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement