Makefile.am 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. # driver/Makefile.am
  2. # copyright (C) 2003 by Frank Mori Hess
  3. # email : fmhess@users.sourceforge.net
  4. #
  5. # This Makefile.am is free software; you can redistribute it and/or modify
  6. # it under the terms of the GNU General Public License as published by
  7. # the Free Software Foundation; either version 2 of the License, or
  8. # (at your option) any later version.
  9. GPIB_MODULE_SUBDIR = gpib
  10. GPIB_ABS_MODULE_SUBDIR = @abs_srcdir@/$(GPIB_MODULE_SUBDIR)
  11. EXTRA_DIST = $(GPIB_MODULE_SUBDIR)
  12. SUBDIRS = gpib/include
  13. -include $(top_srcdir)/util/linux_flags/flags
  14. #ignore errors from kernel's make modules in all-local, to avoid failure of make install
  15. #on nfs filesystem with root_squash
  16. all-local:
  17. -$(MAKE) -C $(LINUX_SRCDIR) V=1 modules\
  18. CC="$(LINUX_CC) -I@abs_top_srcdir@ -I@abs_top_srcdir@/drivers/gpib/include -I@abs_top_srcdir@/include" \
  19. SUBDIRS="$(GPIB_ABS_MODULE_SUBDIR)"
  20. clean-local:
  21. $(MAKE) -C $(LINUX_SRCDIR) V=1 clean\
  22. CC="$(LINUX_CC) -I@abs_top_srcdir@ -I@abs_top_srcdir@/drivers/gpib/include -I@abs_top_srcdir@/include" \
  23. SUBDIRS="$(GPIB_ABS_MODULE_SUBDIR)"
  24. install-data-hook: device-file-check /etc/gpib.conf
  25. $(MAKE) -C $(LINUX_SRCDIR) V=1 modules_install\
  26. CC="$(LINUX_CC) -I@abs_top_srcdir@ -I@abs_top_srcdir@/driver/include -I@abs_top_srcdir@/include" \
  27. SUBDIRS="$(GPIB_ABS_MODULE_SUBDIR)" INSTALL_MOD_DIR="gpib"
  28. $(DEPMOD) -ae
  29. /dev/gpib0:
  30. groupadd gpib || echo "group gpib exists"
  31. for i in `seq 0 15`; \
  32. do \
  33. mknod -m u=rw,g=rw,o= /dev/gpib$${i} c $(IBMAJOR) $${i} || exit 1; \
  34. chown root:gpib /dev/gpib$${i}; \
  35. done
  36. .PHONY : device-file-check
  37. device-file-check: /dev/gpib0
  38. @if [ ! -c /dev/gpib0 ]; then \
  39. if [ -a /dev/gpib0 ]; then \
  40. echo "A file or directory called /dev/gpib0 exists but it is not" \
  41. "a character device. Delete or move it and try again."; \
  42. exit 1; \
  43. fi; \
  44. fi
  45. @ls -l /dev/gpib0 | grep -q "$(IBMAJOR)"; \
  46. if [ $$? != 0 ]; then \
  47. echo "/dev/gpib0 has the wrong major number. " \
  48. "Delete your /dev/gpibX files and try again."; \
  49. exit 1; \
  50. fi
  51. #should move this to util/templates Makefile.am when it exists
  52. /etc/gpib.conf:
  53. $(INSTALL_DATA) -D $(top_srcdir)/util/templates/gpib.conf /etc/gpib.conf
  54. #make sure compiled files, etc don't make it into distribution tarballs
  55. dist-hook:
  56. -find $(distdir) \( -name '*.[oas]' -o -name '*.ko' -o -name core -o -name '.*.cmd' -o -name '*.mod.c' \) -type f \
  57. -exec $(RM) {} \;
  58. -find $(distdir) -depth -name '.tmp_versions' -type d -exec $(RM) -r \{\} \;