xref: /freebsd/share/mk/bsd.links.mk (revision d2a824c29d6925ba8675a811aa81f2ad7d92129d)
184f94a79SRuslan Ermilov
284f94a79SRuslan Ermilov.if !target(__<bsd.init.mk>__)
384f94a79SRuslan Ermilov.error bsd.links.mk cannot be included directly.
484f94a79SRuslan Ermilov.endif
584f94a79SRuslan Ermilov
6dc6d22c9SBaptiste Daroussin.if defined(NO_ROOT)
7dc6d22c9SBaptiste Daroussin.if !defined(TAGS) || ! ${TAGS:Mpackage=*}
8dc6d22c9SBaptiste DaroussinTAGS+=         package=${PACKAGE}
9dc6d22c9SBaptiste Daroussin.endif
10dc6d22c9SBaptiste DaroussinTAG_ARGS=      -T ${TAGS:[*]:S/ /,/g}
11dc6d22c9SBaptiste Daroussin.endif
12dc6d22c9SBaptiste Daroussin
1384f94a79SRuslan Ermilovafterinstall: _installlinks
14badb7c1cSRuslan Ermilov.ORDER: realinstall _installlinks
1584f94a79SRuslan Ermilov_installlinks:
1608d4b586SBaptiste Daroussin.for s t in ${LINKS}
17*d2a824c2SWarner Losh# On MacOS, assume case folding FS, and don't install links from foo.x to FOO.x.
18*d2a824c2SWarner Losh.if ${.MAKE.OS} != "Darwin" || ${s:tu} != ${t:tu}
194e899378SDoug Rabson.if defined(LINKTAGS)
204e899378SDoug Rabson	${INSTALL_LINK} ${TAG_ARGS:D${TAG_ARGS},${LINKTAGS}} ${DESTDIR}${s} ${DESTDIR}${t}
214e899378SDoug Rabson.else
22bbb51924SGlen Barber	${INSTALL_LINK} ${TAG_ARGS} ${DESTDIR}${s} ${DESTDIR}${t}
234e899378SDoug Rabson.endif
24*d2a824c2SWarner Losh.endif
2508d4b586SBaptiste Daroussin.endfor
2608d4b586SBaptiste Daroussin.for s t in ${SYMLINKS}
27*d2a824c2SWarner Losh# On MacOS, assume case folding FS, and don't install links from foo.x to FOO.x.
28*d2a824c2SWarner Losh.if ${.MAKE.OS} != "Darwin" || ${s:tu} != ${t:tu}
294e899378SDoug Rabson.if defined(LINKTAGS)
304e899378SDoug Rabson	${INSTALL_SYMLINK} ${TAG_ARGS:D${TAG_ARGS},${LINKTAGS}} ${s} ${DESTDIR}${t}
314e899378SDoug Rabson.else
32229d577fSLi-Wen Hsu	${INSTALL_SYMLINK} ${TAG_ARGS} ${s} ${DESTDIR}${t}
334e899378SDoug Rabson.endif
34*d2a824c2SWarner Losh.endif
3508d4b586SBaptiste Daroussin.endfor
36