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