freebsd-skq/usr.bin/readelf/Makefile
Warner Losh a35f04fba2 Adopt SRCTOP in usr.bin
Prefer ${SRCTOP}/foo over ${.CURDIR}/../../foo and ${SRCTOP}/usr.bin/foo
over ${.CURDIR}/../foo for paths in Makefiles.

Differential Revision:	https://reviews.freebsd.org/D9932
Sponsored by:		Netflix
Silence on:		arch@ (twice)
2017-03-12 18:58:44 +00:00

29 lines
774 B
Makefile

# $FreeBSD$
ELFTCDIR= ${SRCTOP}/contrib/elftoolchain
READELFDIR= ${ELFTCDIR}/readelf
.PATH: ${READELFDIR}
PROG= readelf
SRCS= readelf.c
LIBADD= dwarf elftc elf
CFLAGS+=-I${ELFTCDIR}/libelftc -I${ELFTCDIR}/common
# This same hack is in lib/libelf/Makefile and lib/libdwarf/Makefile
# We need to link against the correct version of these files. One
# solution is to include SRCTOP/sys in the include path. This causes
# 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}
.include <bsd.prog.mk>