You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 lines
2.0 KiB

  1. From 505c61819b371a1802e054fe2601e64f2dc6d79e Mon Sep 17 00:00:00 2001
  2. From: Alyssa Ross <hi@alyssa.is>
  3. Date: Mon, 29 Nov 2021 22:38:45 +0000
  4. Subject: [PATCH 14/15] Makefile: support static-only builds
  5. One of the problems with udev is that systemd cannot be built
  6. statically[1]. With libudev-zero, on the other hand, no code changes
  7. are required to be able to do a static-only build, only Makefile
  8. changes.
  9. With this change, it's possible to "make install-static" to do a
  10. static-only build of libudev-zero.
  11. [1]: https://github.com/systemd/systemd/pull/20621#issuecomment-912014839
  12. ---
  13. Makefile | 24 ++++++++++++++++++------
  14. 1 file changed, 18 insertions(+), 6 deletions(-)
  15. --- a/Makefile
  16. +++ b/Makefile
  17. @@ -45,13 +45,24 @@ libudev.pc: libudev.pc.in
  18. -e 's|@VERSION@|243|g' \
  19. libudev.pc.in > libudev.pc
  20. -install: libudev.so.1 libudev.a libudev.pc
  21. - mkdir -p ${DESTDIR}${INCLUDEDIR} ${DESTDIR}${LIBDIR} ${DESTDIR}${PKGCONFIGDIR}
  22. - cp -f udev.h ${DESTDIR}${INCLUDEDIR}/libudev.h
  23. - cp -f libudev.a ${DESTDIR}${LIBDIR}/libudev.a
  24. +install-headers: udev.h
  25. + mkdir -p ${DESTDIR}${INCLUDEDIR}
  26. + cp -f udev.h ${DESTDIR}${INCLUDEDIR}/libudev.h
  27. +
  28. +install-pkgconfig: libudev.pc
  29. + mkdir -p ${DESTDIR}${PKGCONFIGDIR}
  30. + cp -f libudev.pc ${DESTDIR}${PKGCONFIGDIR}/libudev.pc
  31. +
  32. +install-shared: libudev.so.1 install-headers install-pkgconfig
  33. + mkdir -p ${DESTDIR}${LIBDIR}
  34. cp -f libudev.so.1 ${DESTDIR}${LIBDIR}/libudev.so.1
  35. ln -fs libudev.so.1 ${DESTDIR}${LIBDIR}/libudev.so
  36. - cp -f libudev.pc ${DESTDIR}${PKGCONFIGDIR}/libudev.pc
  37. +
  38. +install-static: libudev.a install-headers install-pkgconfig
  39. + mkdir -p ${DESTDIR}${LIBDIR}
  40. + cp -f libudev.a ${DESTDIR}${LIBDIR}/libudev.a
  41. +
  42. +install: install-shared install-static
  43. uninstall:
  44. rm -f ${DESTDIR}${LIBDIR}/libudev.a \
  45. @@ -63,4 +74,5 @@ uninstall:
  46. clean:
  47. rm -f libudev.so.1 libudev.a libudev.pc ${OBJ}
  48. -.PHONY: all clean install uninstall
  49. +.PHONY: all clean install-headers install-pkgconfig install-shared \
  50. + install-static install uninstall