/share/mk/bsd.links.mk

https://bitbucket.org/freebsd/freebsd-head/ · Makefile · 31 lines · 28 code · 2 blank · 1 comment · 4 complexity · d767e1f9864a490d60208ec293426cea MD5 · raw file

  1. # $FreeBSD$
  2. .if !target(__<bsd.init.mk>__)
  3. .error bsd.links.mk cannot be included directly.
  4. .endif
  5. afterinstall: _installlinks
  6. .ORDER: realinstall _installlinks
  7. _installlinks:
  8. .if defined(LINKS) && !empty(LINKS)
  9. @set ${LINKS}; \
  10. while test $$# -ge 2; do \
  11. l=${DESTDIR}$$1; \
  12. shift; \
  13. t=${DESTDIR}$$1; \
  14. shift; \
  15. ${ECHO} $$t -\> $$l; \
  16. ln -f $$l $$t; \
  17. done; true
  18. .endif
  19. .if defined(SYMLINKS) && !empty(SYMLINKS)
  20. @set ${SYMLINKS}; \
  21. while test $$# -ge 2; do \
  22. l=$$1; \
  23. shift; \
  24. t=${DESTDIR}$$1; \
  25. shift; \
  26. ${ECHO} $$t -\> $$l; \
  27. ln -fs $$l $$t; \
  28. done; true
  29. .endif