Makefile 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. # Makefile to install udev rules and documentation
  2. PREFIX = /usr
  3. RULES_DIR = /etc/udev/rules.d
  4. INSTALL = install
  5. INSTALL_DATA = $(INSTALL) -m644
  6. INSTALL_EXEC = $(INSTALL) -m755
  7. RULES_FILES = \
  8. 55-lfs.rules
  9. DOC_FILES = $(RULES_FILES:.rules=.txt)
  10. # Location to install the docs
  11. DOC_DIR = $(PREFIX)/share/doc/udev-config
  12. # for files shipped with udev up to version 182
  13. SYS_LIB = /lib/udev
  14. SYS_RULES_DIR = $(SYS_LIB)/rules.d
  15. SYS_RULES = 75-cd-aliases-generator.rules \
  16. 75-persistent-net-generator.rules
  17. SYS_FUNCTIONS = rule_generator.functions
  18. SYS_SCRIPTS = write_cd_rules write_net_rules
  19. all:
  20. install: install-rules
  21. install-rules:
  22. $(INSTALL) -d $(DESTDIR)$(RULES_DIR)
  23. for rule in $(RULES_FILES); do \
  24. $(INSTALL_DATA) $$rule $(DESTDIR)$(RULES_DIR) || exit 1; \
  25. done;
  26. $(INSTALL) -d $(DESTDIR)$(SYS_LIB)
  27. for function in $(SYS_FUNCTIONS); do \
  28. $(INSTALL_DATA) rule_generator/$$function $(DESTDIR)$(SYS_LIB) || exit 1; \
  29. done;
  30. for script in $(SYS_SCRIPTS); do \
  31. $(INSTALL_EXEC) rule_generator/$$script $(DESTDIR)$(SYS_LIB) || exit 1; \
  32. done;
  33. $(INSTALL) -d $(DESTDIR)$(SYS_RULES_DIR)
  34. for rule in $(SYS_RULES); do \
  35. $(INSTALL_DATA) rule_generator/$$rule $(DESTDIR)$(SYS_RULES_DIR) || exit 1; \
  36. done;
  37. install-doc:
  38. $(INSTALL) -d $(DESTDIR)$(DOC_DIR)
  39. for doc in $(DOC_FILES); do \
  40. $(INSTALL_DATA) doc/$$doc $(DESTDIR)$(DOC_DIR) || exit 1; \
  41. done