2014-12-01 17:49:42 +00:00
|
|
|
# $FreeBSD$
|
|
|
|
|
|
|
|
.include <src.opts.mk>
|
|
|
|
|
2016-04-18 13:13:59 +00:00
|
|
|
ELFTCDIR= ${.CURDIR:H:H}/contrib/elftoolchain
|
2014-12-01 17:49:42 +00:00
|
|
|
ELFCOPYDIR= ${ELFTCDIR}/elfcopy
|
|
|
|
|
|
|
|
.PATH: ${ELFCOPYDIR}
|
|
|
|
|
2015-07-29 18:45:38 +00:00
|
|
|
.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
|
2014-12-01 17:49:42 +00:00
|
|
|
PROG= elfcopy
|
2015-07-29 18:45:38 +00:00
|
|
|
.endif
|
2014-12-01 17:49:42 +00:00
|
|
|
|
2016-02-12 21:15:31 +00:00
|
|
|
SRCS= archive.c ascii.c binary.c main.c pe.c sections.c segments.c symbols.c
|
2014-12-01 17:49:42 +00:00
|
|
|
|
|
|
|
WARNS?= 5
|
|
|
|
|
2016-02-12 21:15:31 +00:00
|
|
|
LIBADD= archive elftc elf pe
|
2014-12-01 17:49:42 +00:00
|
|
|
|
2016-02-12 21:15:31 +00:00
|
|
|
CFLAGS+=-I${ELFTCDIR}/libelftc -I${ELFTCDIR}/libpe -I${ELFTCDIR}/common
|
|
|
|
CFLAGS+=-DWITH_PE=1
|
2014-12-01 17:49:42 +00:00
|
|
|
|
2015-07-29 18:45:38 +00:00
|
|
|
MAN= ${PROG}.1 strip.1
|
2014-12-01 17:49:42 +00:00
|
|
|
|
2015-07-29 18:45:38 +00:00
|
|
|
LINKS= ${BINDIR}/${PROG} ${BINDIR}/strip
|
2014-12-01 17:49:42 +00:00
|
|
|
|
|
|
|
.include <bsd.prog.mk>
|