xref: /freebsd/usr.bin/readelf/Makefile (revision ef36b3f75658d201edb495068db5e1be49593de5)
1# $FreeBSD$
2
3ELFTCDIR=	${SRCTOP}/contrib/elftoolchain
4READELFDIR=	${ELFTCDIR}/readelf
5
6.PATH: ${READELFDIR}
7
8PROG=	readelf
9SRCS=	readelf.c
10
11LIBADD=	dwarf elftc elf
12
13CFLAGS+=-I${ELFTCDIR}/libelftc -I${ELFTCDIR}/common
14
15# This same hack is in lib/libelf/Makefile and lib/libdwarf/Makefile
16# We need to link against the correct version of these files. One
17# solution is to include SRCTOP/sys in the include path. This causes
18# problems when a header file in sys depends on a file in another
19# part of the tree, e.g. a machine dependent header.
20#
21SRCS+=		sys/elf32.h sys/elf64.h sys/elf_common.h
22CLEANDIRS=	sys
23CFLAGS+=	-I.
24sys/elf32.h sys/elf64.h sys/elf_common.h: ${SRCTOP}/sys/${.TARGET} .NOMETA
25	mkdir -p ${.OBJDIR}/sys
26	ln -sf ${.ALLSRC} ${.TARGET}
27
28.include <bsd.prog.mk>
29