aboutsummaryrefslogtreecommitdiff
path: root/lib/libelf/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libelf/Makefile')
-rw-r--r--lib/libelf/Makefile13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/libelf/Makefile b/lib/libelf/Makefile
index f1200920d958..58692cfe0f3e 100644
--- a/lib/libelf/Makefile
+++ b/lib/libelf/Makefile
@@ -65,10 +65,23 @@ SRCS= elf.c \
INCS= libelf.h gelf.h
+#
+# 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
+
GENSRCS= libelf_fsize.c libelf_msize.c libelf_convert.c
CLEANFILES= ${GENSRCS}
+CLEANDIRS= sys
CFLAGS+= -I. -I${SRCDIR} -I${TOP}/common
+sys/elf32.h sys/elf64.h sys/elf_common.h: ${.CURDIR}/../../sys/${.TARGET}
+ mkdir -p ${.OBJDIR}/sys
+ ln -sf ${.CURDIR}/../../sys/${.TARGET} ${.TARGET}
+
SHLIB_MAJOR= 1
MAN= elf.3 \