aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/readelf
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/readelf')
-rw-r--r--usr.bin/readelf/Makefile36
-rw-r--r--usr.bin/readelf/Makefile.depend20
-rw-r--r--usr.bin/readelf/Makefile.depend.options7
3 files changed, 63 insertions, 0 deletions
diff --git a/usr.bin/readelf/Makefile b/usr.bin/readelf/Makefile
new file mode 100644
index 000000000000..d2a386fb0d40
--- /dev/null
+++ b/usr.bin/readelf/Makefile
@@ -0,0 +1,36 @@
+.include <src.opts.mk>
+
+PACKAGE= elftoolchain
+
+ELFTCDIR= ${SRCTOP}/contrib/elftoolchain
+READELFDIR= ${ELFTCDIR}/readelf
+
+.PATH: ${READELFDIR}
+
+PROG= readelf
+SRCS= readelf.c
+
+LIBADD= dwarf elftc elf z
+
+.if ${MK_CASPER} != "no"
+LIBADD+= casper
+LIBADD+= cap_fileargs
+CFLAGS+= -DWITH_CASPER
+.endif
+
+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>
diff --git a/usr.bin/readelf/Makefile.depend b/usr.bin/readelf/Makefile.depend
new file mode 100644
index 000000000000..ddc284fa26a2
--- /dev/null
+++ b/usr.bin/readelf/Makefile.depend
@@ -0,0 +1,20 @@
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcapsicum \
+ lib/libcompiler_rt \
+ lib/libdwarf \
+ lib/libelf \
+ lib/libelftc \
+ lib/libz \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/usr.bin/readelf/Makefile.depend.options b/usr.bin/readelf/Makefile.depend.options
new file mode 100644
index 000000000000..16ba822617d3
--- /dev/null
+++ b/usr.bin/readelf/Makefile.depend.options
@@ -0,0 +1,7 @@
+# This file is not autogenerated - take care!
+
+DIRDEPS_OPTIONS= CASPER
+
+DIRDEPS.CASPER.yes= lib/libcasper/services/cap_fileargs
+
+.include <dirdeps-options.mk>