freebsd-dev/usr.bin/elfcopy/Makefile
Ed Maste 5ea9e83e2f Allow ELF Tool Chain elfcopy to be installed as objcopy
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
2015-07-29 18:45:38 +00:00

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>