2014-12-01 17:49:42 +00:00
|
|
|
# $FreeBSD$
|
|
|
|
|
|
|
|
.include <src.opts.mk>
|
|
|
|
|
2016-04-21 12:58:29 +00:00
|
|
|
ELFTCDIR= ${SRCTOP}/contrib/elftoolchain
|
2014-12-01 17:49:42 +00:00
|
|
|
ELFCOPYDIR= ${ELFTCDIR}/elfcopy
|
|
|
|
|
|
|
|
.PATH: ${ELFCOPYDIR}
|
|
|
|
|
2015-07-29 18:45:38 +00:00
|
|
|
PROG= objcopy
|
|
|
|
objcopy.1: elfcopy.1
|
|
|
|
sed -e 's/\.Dt ELFCOPY 1/.Dt OBJCOPY 1/' \
|
2018-09-11 20:32:57 +00:00
|
|
|
-e '/\.Nm elfcopy ,/d' < ${.ALLSRC} > ${.TARGET}
|
2015-07-29 18:45:38 +00:00
|
|
|
CLEANFILES+= objcopy.1
|
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
|
|
|
|
2016-06-05 23:34:19 +00:00
|
|
|
# This same hack is in lib/libelf/Makefile and usr.bin/readelf/Makefile
|
|
|
|
# We need to link against the correct version of these files. One
|
2017-03-12 18:58:44 +00:00
|
|
|
# solution is to include SRCTOP/sys in the include path. This causes
|
2016-06-05 23:34:19 +00:00
|
|
|
# problems when a header file in sys depends on a file in another
|
|
|
|
# part of the tree, e.g. a machine dependent header.
|
|
|
|
#
|
|
|
|
SRCS+= sys/elf_common.h
|
|
|
|
CLEANDIRS= sys
|
|
|
|
CFLAGS+= -I.
|
|
|
|
sys/elf_common.h: ${SRCTOP}/sys/${.TARGET} .NOMETA
|
|
|
|
mkdir -p ${.OBJDIR}/sys
|
|
|
|
ln -sf ${.ALLSRC} ${.TARGET}
|
|
|
|
|
2014-12-01 17:49:42 +00:00
|
|
|
.include <bsd.prog.mk>
|