2006-11-11 17:16:35 +00:00
|
|
|
# $FreeBSD$
|
2015-12-01 16:08:38 +00:00
|
|
|
|
2016-02-04 21:16:35 +00:00
|
|
|
PACKAGE=lib${LIB}
|
2015-12-01 16:08:38 +00:00
|
|
|
SHLIBDIR?= /lib
|
|
|
|
|
2014-01-15 22:35:55 +00:00
|
|
|
.include <bsd.own.mk>
|
|
|
|
|
2016-04-21 12:58:29 +00:00
|
|
|
ELFTCDIR=${SRCTOP}/contrib/elftoolchain
|
|
|
|
SRCDIR= ${ELFTCDIR}/libelf
|
2014-01-15 22:35:55 +00:00
|
|
|
|
|
|
|
.PATH: ${SRCDIR}
|
2006-11-11 17:16:35 +00:00
|
|
|
|
|
|
|
LIB= elf
|
|
|
|
|
2014-01-15 22:35:55 +00:00
|
|
|
SRCS= elf.c \
|
|
|
|
elf_begin.c \
|
2006-11-11 17:16:35 +00:00
|
|
|
elf_cntl.c \
|
|
|
|
elf_end.c elf_errmsg.c elf_errno.c \
|
|
|
|
elf_data.c \
|
|
|
|
elf_fill.c \
|
|
|
|
elf_flag.c \
|
|
|
|
elf_getarhdr.c \
|
|
|
|
elf_getarsym.c \
|
|
|
|
elf_getbase.c \
|
|
|
|
elf_getident.c \
|
|
|
|
elf_hash.c \
|
|
|
|
elf_kind.c \
|
|
|
|
elf_memory.c \
|
|
|
|
elf_next.c \
|
2014-01-15 22:35:55 +00:00
|
|
|
elf_open.c \
|
2006-11-11 17:16:35 +00:00
|
|
|
elf_rand.c \
|
|
|
|
elf_rawfile.c \
|
2006-12-25 02:22:22 +00:00
|
|
|
elf_phnum.c \
|
2006-11-11 17:16:35 +00:00
|
|
|
elf_shnum.c \
|
|
|
|
elf_shstrndx.c \
|
|
|
|
elf_scn.c \
|
|
|
|
elf_strptr.c \
|
|
|
|
elf_update.c \
|
|
|
|
elf_version.c \
|
2006-12-18 05:40:01 +00:00
|
|
|
gelf_cap.c \
|
2006-11-11 17:16:35 +00:00
|
|
|
gelf_checksum.c \
|
|
|
|
gelf_dyn.c \
|
|
|
|
gelf_ehdr.c \
|
2006-12-18 05:40:01 +00:00
|
|
|
gelf_getclass.c \
|
|
|
|
gelf_fsize.c \
|
|
|
|
gelf_move.c \
|
2006-11-11 17:16:35 +00:00
|
|
|
gelf_phdr.c \
|
|
|
|
gelf_rel.c \
|
|
|
|
gelf_rela.c \
|
|
|
|
gelf_shdr.c \
|
|
|
|
gelf_sym.c \
|
2006-12-18 05:40:01 +00:00
|
|
|
gelf_syminfo.c \
|
2006-11-11 17:16:35 +00:00
|
|
|
gelf_symshndx.c \
|
|
|
|
gelf_xlate.c \
|
|
|
|
libelf_align.c \
|
|
|
|
libelf_allocate.c \
|
|
|
|
libelf_ar.c \
|
2010-07-21 12:54:34 +00:00
|
|
|
libelf_ar_util.c \
|
2006-11-11 17:16:35 +00:00
|
|
|
libelf_checksum.c \
|
|
|
|
libelf_data.c \
|
|
|
|
libelf_ehdr.c \
|
2006-12-25 02:22:22 +00:00
|
|
|
libelf_extended.c \
|
2014-01-15 22:35:55 +00:00
|
|
|
libelf_memory.c \
|
|
|
|
libelf_open.c \
|
2006-11-11 17:16:35 +00:00
|
|
|
libelf_phdr.c \
|
|
|
|
libelf_shdr.c \
|
2006-11-12 18:43:25 +00:00
|
|
|
libelf_xlate.c \
|
|
|
|
${GENSRCS}
|
2006-11-11 17:16:35 +00:00
|
|
|
|
2014-01-15 22:35:55 +00:00
|
|
|
INCS= libelf.h gelf.h
|
2012-06-24 08:43:34 +00:00
|
|
|
|
2015-11-25 19:44:51 +00:00
|
|
|
# This same hack is in lib/libdwarf/Makefile and usr.bin/readelf/Makefile
|
2014-01-21 20:42:15 +00:00
|
|
|
# We need to link against the correct version of these files. One
|
|
|
|
# solution is to include ../../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
|
|
|
|
|
2006-11-24 06:38:11 +00:00
|
|
|
GENSRCS= libelf_fsize.c libelf_msize.c libelf_convert.c
|
|
|
|
CLEANFILES= ${GENSRCS}
|
2014-01-21 20:42:15 +00:00
|
|
|
CLEANDIRS= sys
|
2016-04-21 12:58:29 +00:00
|
|
|
CFLAGS+= -I. -I${SRCDIR} -I${ELFTCDIR}/common
|
2006-11-11 17:16:35 +00:00
|
|
|
|
2017-01-20 04:54:09 +00:00
|
|
|
sys/elf32.h sys/elf64.h sys/elf_common.h: ${SRCTOP}/sys/${.TARGET} .NOMETA
|
2014-01-21 20:42:15 +00:00
|
|
|
mkdir -p ${.OBJDIR}/sys
|
2015-11-25 19:44:43 +00:00
|
|
|
ln -sf ${.ALLSRC} ${.TARGET}
|
2014-01-21 20:42:15 +00:00
|
|
|
|
2014-01-21 21:13:13 +00:00
|
|
|
SHLIB_MAJOR= 2
|
2006-11-11 17:16:35 +00:00
|
|
|
|
|
|
|
MAN= elf.3 \
|
|
|
|
elf_begin.3 \
|
|
|
|
elf_cntl.3 \
|
2010-07-21 12:14:50 +00:00
|
|
|
elf_end.3 \
|
|
|
|
elf_errmsg.3 \
|
2006-11-11 17:16:35 +00:00
|
|
|
elf_fill.3 \
|
|
|
|
elf_flagdata.3 \
|
|
|
|
elf_getarhdr.3 \
|
|
|
|
elf_getarsym.3 \
|
|
|
|
elf_getbase.3 \
|
|
|
|
elf_getdata.3 \
|
|
|
|
elf_getident.3 \
|
|
|
|
elf_getscn.3 \
|
2010-07-21 12:14:50 +00:00
|
|
|
elf_getphdrnum.3 \
|
2006-12-25 02:22:22 +00:00
|
|
|
elf_getphnum.3 \
|
2010-07-21 12:14:50 +00:00
|
|
|
elf_getshdrnum.3 \
|
2006-11-11 17:16:35 +00:00
|
|
|
elf_getshnum.3 \
|
2010-07-21 12:14:50 +00:00
|
|
|
elf_getshdrstrndx.3 \
|
2006-11-11 17:16:35 +00:00
|
|
|
elf_getshstrndx.3 \
|
|
|
|
elf_hash.3 \
|
|
|
|
elf_kind.3 \
|
|
|
|
elf_memory.3 \
|
|
|
|
elf_next.3 \
|
2014-01-15 22:35:55 +00:00
|
|
|
elf_open.3 \
|
2006-11-11 17:16:35 +00:00
|
|
|
elf_rawfile.3 \
|
|
|
|
elf_rand.3 \
|
|
|
|
elf_strptr.3 \
|
|
|
|
elf_update.3 \
|
|
|
|
elf_version.3 \
|
|
|
|
gelf.3 \
|
|
|
|
gelf_checksum.3 \
|
|
|
|
gelf_fsize.3 \
|
|
|
|
gelf_getcap.3 \
|
|
|
|
gelf_getclass.3 \
|
|
|
|
gelf_getdyn.3 \
|
|
|
|
gelf_getehdr.3 \
|
|
|
|
gelf_getmove.3 \
|
|
|
|
gelf_getphdr.3 \
|
|
|
|
gelf_getrel.3 \
|
|
|
|
gelf_getrela.3 \
|
|
|
|
gelf_getshdr.3 \
|
|
|
|
gelf_getsym.3 \
|
|
|
|
gelf_getsyminfo.3 \
|
|
|
|
gelf_getsymshndx.3 \
|
|
|
|
gelf_newehdr.3 \
|
|
|
|
gelf_newphdr.3 \
|
|
|
|
gelf_update_ehdr.3 \
|
|
|
|
gelf_xlatetof.3
|
|
|
|
|
|
|
|
MLINKS+= \
|
|
|
|
elf_errmsg.3 elf_errno.3 \
|
2014-01-15 22:35:55 +00:00
|
|
|
elf_flagdata.3 elf_flagarhdr.3 \
|
2006-11-11 17:16:35 +00:00
|
|
|
elf_flagdata.3 elf_flagehdr.3 \
|
|
|
|
elf_flagdata.3 elf_flagelf.3 \
|
|
|
|
elf_flagdata.3 elf_flagphdr.3 \
|
|
|
|
elf_flagdata.3 elf_flagscn.3 \
|
|
|
|
elf_flagdata.3 elf_flagshdr.3 \
|
|
|
|
elf_getdata.3 elf_newdata.3 \
|
|
|
|
elf_getdata.3 elf_rawdata.3 \
|
|
|
|
elf_getscn.3 elf_ndxscn.3 \
|
|
|
|
elf_getscn.3 elf_newscn.3 \
|
|
|
|
elf_getscn.3 elf_nextscn.3 \
|
|
|
|
elf_getshstrndx.3 elf_setshstrndx.3 \
|
2014-01-15 22:35:55 +00:00
|
|
|
elf_open.3 elf_openmemory.3 \
|
2006-11-11 17:16:35 +00:00
|
|
|
gelf_getcap.3 gelf_update_cap.3 \
|
|
|
|
gelf_getdyn.3 gelf_update_dyn.3 \
|
|
|
|
gelf_getmove.3 gelf_update_move.3 \
|
|
|
|
gelf_getrel.3 gelf_update_rel.3 \
|
|
|
|
gelf_getrela.3 gelf_update_rela.3 \
|
|
|
|
gelf_getsym.3 gelf_update_sym.3 \
|
|
|
|
gelf_getsyminfo.3 gelf_update_syminfo.3 \
|
|
|
|
gelf_getsymshndx.3 gelf_update_symshndx.3 \
|
|
|
|
gelf_update_ehdr.3 gelf_update_phdr.3 \
|
|
|
|
gelf_update_ehdr.3 gelf_update_shdr.3 \
|
|
|
|
gelf_xlatetof.3 gelf_xlatetom.3
|
|
|
|
|
|
|
|
.for E in 32 64
|
|
|
|
MLINKS+= \
|
|
|
|
gelf_checksum.3 elf${E}_checksum.3 \
|
|
|
|
gelf_fsize.3 elf${E}_fsize.3 \
|
|
|
|
gelf_getehdr.3 elf${E}_getehdr.3 \
|
|
|
|
gelf_getphdr.3 elf${E}_getphdr.3 \
|
|
|
|
gelf_getshdr.3 elf${E}_getshdr.3 \
|
|
|
|
gelf_newehdr.3 elf${E}_newehdr.3 \
|
|
|
|
gelf_newphdr.3 elf${E}_newphdr.3 \
|
|
|
|
gelf_xlatetof.3 elf${E}_xlatetof.3 \
|
|
|
|
gelf_xlatetof.3 elf${E}_xlatetom.3
|
|
|
|
.endfor
|
|
|
|
|
2014-01-15 22:35:55 +00:00
|
|
|
VERSION_MAP= ${SRCDIR}/Version.map
|
2006-11-11 17:16:35 +00:00
|
|
|
|
|
|
|
libelf_convert.c: elf_types.m4 libelf_convert.m4
|
|
|
|
libelf_fsize.c: elf_types.m4 libelf_fsize.m4
|
|
|
|
libelf_msize.c: elf_types.m4 libelf_msize.m4
|
|
|
|
|
|
|
|
.include <bsd.lib.mk>
|
|
|
|
|
2006-11-12 18:43:25 +00:00
|
|
|
# Keep the .SUFFIXES line after the include of bsd.lib.mk
|
2006-11-11 17:16:35 +00:00
|
|
|
.SUFFIXES: .m4 .c
|
|
|
|
.m4.c:
|
2014-01-15 22:35:55 +00:00
|
|
|
m4 -D SRCDIR=${SRCDIR} ${M4FLAGS} ${.IMPSRC} > ${.TARGET}
|
|
|
|
|