-# $OpenBSD: Makefile.bsd-wrapper,v 1.14 2017/06/12 18:49:34 espie Exp $
+# $OpenBSD: Makefile.bsd-wrapper,v 1.15 2018/07/26 13:20:53 kettenis Exp $
.include <bsd.own.mk>
SUBDIRS+= ld gas
CONF_SUBDIRS+= ld gas
INST_SUBDIRS+= ld gas
-MAN+= gas/doc/as.1 ld/ld.1
+MAN+= gas/doc/as.1 ld/ld.bfd.1
+.if ${LINKER_VERSION:L} == "bfd"
+MLINKS+= ld.bfd.1 ld.1
+.endif
.endif
# Used by the GNU Makefile
gas/doc/as.1: config.status
cd ${.OBJDIR}/gas/doc && ${MAKE} as.1
-ld/ld.1: config.status
+ld/ld.bfd.1: config.status
cd ${.OBJDIR}/ld && ${MAKE} ld.1
+ mv ld/ld.1 ld/ld.bfd.1
config: do-config
.ifndef GLOBAL_AUTOCONF_CACHE
INSTALL_DATA='${INSTALL} -c -o ${DOCOWN} -g ${DOCGRP} -m ${NONBINMODE}' \
INSTALL_INFO_HOST_MODULES='${INSTALL_INFO_HOST_MODULES}' \
install install-info
+.if ${LINKER_VERSION:L} == "bfd"
+ rm -f ${DESTDIR}${PREFIX}/bin/ld
+ ln ${DESTDIR}${PREFIX}/bin/ld.bfd ${DESTDIR}${PREFIX}/bin/ld
+.endif
clean cleandir:
-@if [ -e Makefile ]; then ${MAKE} distclean; fi
EMULATION_LIBPATH = @EMULATION_LIBPATH@
EMULATION_OFILES = @EMULATION_OFILES@
EMUL_EXTRA_OFILES = @EMUL_EXTRA_OFILES@
-EXEEXT = @EXEEXT@
+EXEEXT = .bfd
GMOFILES = @GMOFILES@
GMSGFMT = @GMSGFMT@
GT_NO = @GT_NO@
-# $OpenBSD: Makefile,v 1.13 2018/04/06 14:44:04 patrick Exp $
+# $OpenBSD: Makefile,v 1.14 2018/07/26 13:20:53 kettenis Exp $
.include <bsd.own.mk>
SRCS= lld.cpp
TARGET_ARCH?= ${MACHINE_ARCH}
-.if ${TARGET_ARCH} == "aarch64"
+.if ${LINKER_VERSION:L} == "lld"
LINKS= ${BINDIR}/ld.lld ${BINDIR}/ld
MLINKS= ld.lld.1 ld.1
.endif
-# $OpenBSD: bsd.own.mk,v 1.189 2018/01/19 16:54:54 kettenis Exp $
+# $OpenBSD: bsd.own.mk,v 1.190 2018/07/26 13:20:53 kettenis Exp $
# $NetBSD: bsd.own.mk,v 1.24 1996/04/13 02:08:09 thorpej Exp $
# Host-specific overrides
CLANG_ARCH=aarch64 amd64 arm i386 sparc64
GCC4_ARCH=alpha hppa mips64 mips64el powerpc sh sparc64
GCC3_ARCH=m88k
+LLD_ARCH=aarch64 arm
# m88k: ?
PIE_ARCH=alpha amd64 arm hppa i386 mips64 mips64el powerpc sh sparc64
BUILD_CLANG?=no
.endif
+.if !empty(LLD_ARCH:M${_arch})
+LINKER_VERSION?=lld
+.else
+LINKER_VERSION?=bfd
+.endif
+
.if !empty(STATICPIE_ARCH:M${_arch})
STATICPIE?=-pie
.endif