32e34ac2b5
ELF Tool Chain elfcopy is nearly a drop-in replacement for GNU objcopy, but does not currently support PE output which is needed for building x86 UEFI bits. Add a src.conf knob to allow installing it as objcopy and set it by default for aarch64 only, where we don't have a native binutils. Reviewed by: bapt Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D2887
33 lines
624 B
Makefile
33 lines
624 B
Makefile
# $FreeBSD$
|
|
|
|
.include <src.opts.mk>
|
|
|
|
ELFTCDIR= ${.CURDIR}/../../contrib/elftoolchain
|
|
ELFCOPYDIR= ${ELFTCDIR}/elfcopy
|
|
|
|
.PATH: ${ELFCOPYDIR}
|
|
|
|
.if ${MK_ELFCOPY_AS_OBJCOPY} != "no"
|
|
PROG= objcopy
|
|
objcopy.1: elfcopy.1
|
|
sed -e 's/\.Dt ELFCOPY 1/.Dt OBJCOPY 1/' \
|
|
-e 's/\.Nm elfcopy/.Nm objcopy/' < ${.ALLSRC} > ${.TARGET}
|
|
CLEANFILES+= objcopy.1
|
|
.else
|
|
PROG= elfcopy
|
|
.endif
|
|
|
|
SRCS= archive.c ascii.c binary.c main.c sections.c segments.c symbols.c
|
|
|
|
WARNS?= 5
|
|
|
|
LIBADD= archive elftc elf
|
|
|
|
CFLAGS+=-I${ELFTCDIR}/libelftc -I${ELFTCDIR}/common
|
|
|
|
MAN= ${PROG}.1 strip.1
|
|
|
|
LINKS= ${BINDIR}/${PROG} ${BINDIR}/strip
|
|
|
|
.include <bsd.prog.mk>
|