0001-conditional-build.patch 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. Selectively build groups of tools (inputattach,
  2. joystick tools and/or force-feedback tools).
  3. Signed-off-by: Koen Martens <gmc@sonologic.nl>
  4. diff -Naur a/utils/Makefile b/utils/Makefile
  5. --- a/utils/Makefile 2016-04-19 23:28:36.000000000 +0200
  6. +++ b/utils/Makefile 2017-06-19 08:54:20.152184000 +0200
  7. @@ -27,8 +27,26 @@
  8. CFLAGS ?= -g -O2 -Wall
  9. -PROGRAMS = inputattach jstest jscal fftest ffmvforce ffset \
  10. - ffcfstress jscal-restore jscal-store evdev-joystick
  11. +PROGRAMS =
  12. +
  13. +ifdef ENABLE_INPUTATTACH
  14. +PROGRAMS += inputattach
  15. +endif
  16. +
  17. +ifdef ENABLE_JOYSTICK
  18. +PROGRAMS += jstest
  19. +PROGRAMS += jscal
  20. +PROGRAMS += jscal-restore
  21. +PROGRAMS += jscal-store
  22. +PROGRAMS += evdev-joystick
  23. +endif
  24. +
  25. +ifdef ENABLE_FORCEFEEDBACK
  26. +PROGRAMS += fftest
  27. +PROGRAMS += ffmvforce
  28. +PROGRAMS += ffset
  29. +PROGRAMS += ffcfstress
  30. +endif
  31. PREFIX ?= /usr/local
  32. @@ -79,13 +97,20 @@
  33. 80-stelladaptor-joystick.rules: 80-stelladaptor-joystick.rules.in
  34. sed "s^@@PREFIX@@^$(PREFIX)^g" < $^ > $@
  35. +INSTALL_DEP = compile
  36. +ifdef ENABLE_JOYSTICK
  37. +INSTALL_DEP += 80-stelladaptor-joystick.rules
  38. +endif
  39. +
  40. install: compile 80-stelladaptor-joystick.rules
  41. install -d $(DESTDIR)$(PREFIX)/bin
  42. install $(PROGRAMS) $(DESTDIR)$(PREFIX)/bin
  43. +ifdef ENABLE_JOYSTICK
  44. install -d $(DESTDIR)$(PREFIX)/share/joystick
  45. install extract filter ident $(DESTDIR)$(PREFIX)/share/joystick
  46. install -d $(DESTDIR)/lib/udev/rules.d
  47. install js-set-enum-leds $(DESTDIR)/lib/udev
  48. install -m 644 80-stelladaptor-joystick.rules $(DESTDIR)/lib/udev/rules.d
  49. +endif
  50. .PHONY: compile clean distclean install