124320828SEd Maste# $FreeBSD$ 224320828SEd Maste 3802c2095SMark Johnston.include <src.opts.mk> 4802c2095SMark Johnston 52821bdccSEd MasteELFTCDIR= ${SRCTOP}/contrib/elftoolchain 624320828SEd MasteREADELFDIR= ${ELFTCDIR}/readelf 724320828SEd Maste 824320828SEd Maste.PATH: ${READELFDIR} 924320828SEd Maste 1024320828SEd MastePROG= readelf 114aa63711SBryan DrewerySRCS= readelf.c 1224320828SEd Maste 13*e128bd0fSEd MasteLIBADD= dwarf elftc elf z 1424320828SEd Maste 15802c2095SMark Johnston.if ${MK_CASPER} != "no" 16802c2095SMark JohnstonLIBADD+= casper 17802c2095SMark JohnstonLIBADD+= cap_fileargs 18802c2095SMark JohnstonCFLAGS+= -DWITH_CASPER 19802c2095SMark Johnston.endif 20802c2095SMark Johnston 2124320828SEd MasteCFLAGS+=-I${ELFTCDIR}/libelftc -I${ELFTCDIR}/common 2224320828SEd Maste 23f198d817SBryan Drewery# This same hack is in lib/libelf/Makefile and lib/libdwarf/Makefile 244aa63711SBryan Drewery# We need to link against the correct version of these files. One 25a35f04fbSWarner Losh# solution is to include SRCTOP/sys in the include path. This causes 264aa63711SBryan Drewery# problems when a header file in sys depends on a file in another 274aa63711SBryan Drewery# part of the tree, e.g. a machine dependent header. 284aa63711SBryan Drewery# 294aa63711SBryan DrewerySRCS+= sys/elf32.h sys/elf64.h sys/elf_common.h 304aa63711SBryan DreweryCLEANDIRS= sys 314aa63711SBryan DreweryCFLAGS+= -I. 324aa63711SBryan Drewerysys/elf32.h sys/elf64.h sys/elf_common.h: ${SRCTOP}/sys/${.TARGET} .NOMETA 334aa63711SBryan Drewery mkdir -p ${.OBJDIR}/sys 344aa63711SBryan Drewery ln -sf ${.ALLSRC} ${.TARGET} 354aa63711SBryan Drewery 3624320828SEd Maste.include <bsd.prog.mk> 37