2015-01-02 22:26:54 +00:00
|
|
|
# $FreeBSD$
|
|
|
|
|
2019-08-01 18:57:08 +00:00
|
|
|
.include <src.opts.mk>
|
|
|
|
|
2016-04-21 12:58:29 +00:00
|
|
|
ELFTCDIR= ${SRCTOP}/contrib/elftoolchain
|
2015-01-02 22:26:54 +00:00
|
|
|
READELFDIR= ${ELFTCDIR}/readelf
|
|
|
|
|
|
|
|
.PATH: ${READELFDIR}
|
|
|
|
|
|
|
|
PROG= readelf
|
2015-11-25 19:44:51 +00:00
|
|
|
SRCS= readelf.c
|
2015-01-02 22:26:54 +00:00
|
|
|
|
2020-10-31 15:27:45 +00:00
|
|
|
LIBADD= dwarf elftc elf z
|
2015-01-02 22:26:54 +00:00
|
|
|
|
2019-08-01 18:57:08 +00:00
|
|
|
.if ${MK_CASPER} != "no"
|
|
|
|
LIBADD+= casper
|
|
|
|
LIBADD+= cap_fileargs
|
|
|
|
CFLAGS+= -DWITH_CASPER
|
|
|
|
.endif
|
|
|
|
|
2015-01-02 22:26:54 +00:00
|
|
|
CFLAGS+=-I${ELFTCDIR}/libelftc -I${ELFTCDIR}/common
|
|
|
|
|
2015-11-25 19:48:09 +00:00
|
|
|
# This same hack is in lib/libelf/Makefile and lib/libdwarf/Makefile
|
2015-11-25 19:44:51 +00:00
|
|
|
# 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
|
2015-11-25 19:44:51 +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/elf32.h sys/elf64.h sys/elf_common.h
|
|
|
|
CLEANDIRS= sys
|
|
|
|
CFLAGS+= -I.
|
|
|
|
sys/elf32.h sys/elf64.h sys/elf_common.h: ${SRCTOP}/sys/${.TARGET} .NOMETA
|
|
|
|
mkdir -p ${.OBJDIR}/sys
|
|
|
|
ln -sf ${.ALLSRC} ${.TARGET}
|
|
|
|
|
2015-01-02 22:26:54 +00:00
|
|
|
.include <bsd.prog.mk>
|