diff options
| author | Ed Maste <emaste@FreeBSD.org> | 2025-03-31 13:37:35 +0000 |
|---|---|---|
| committer | Ed Maste <emaste@FreeBSD.org> | 2025-04-11 19:44:40 +0000 |
| commit | ca0fc8ef2f97709d3dfeac54e2c762e1c6ec6559 (patch) | |
| tree | c6080675a1b0a2992cc63fdd2a0aac4765a1f612 /usr.bin/elfcopy | |
| parent | 971e22b7793c279e1a5fe8f3f025eaffbd6b18b1 (diff) | |
Diffstat (limited to 'usr.bin/elfcopy')
| -rw-r--r-- | usr.bin/elfcopy/Makefile | 50 | ||||
| -rw-r--r-- | usr.bin/elfcopy/Makefile.depend | 19 |
2 files changed, 69 insertions, 0 deletions
diff --git a/usr.bin/elfcopy/Makefile b/usr.bin/elfcopy/Makefile new file mode 100644 index 000000000000..2f3386d95ebe --- /dev/null +++ b/usr.bin/elfcopy/Makefile @@ -0,0 +1,50 @@ +.include <src.opts.mk> + +PACKAGE= elftoolchain + +ELFTCDIR= ${SRCTOP}/contrib/elftoolchain +ELFCOPYDIR= ${ELFTCDIR}/elfcopy + +.PATH: ${ELFCOPYDIR} + +PROG= elfcopy +MAN= elfcopy.1 + +.if ${MK_LLVM_BINUTILS} == "no" + +LINKS+= ${BINDIR}/${PROG} ${BINDIR}/objcopy +LINKS+= ${BINDIR}/${PROG} ${BINDIR}/strip +MAN+= objcopy.1 strip.1 + +objcopy.1: elfcopy.1 + sed -e 's/\.Dt ELFCOPY 1/.Dt OBJCOPY 1/' \ + -e '/\.Nm elfcopy ,/d' < ${.ALLSRC} > ${.TARGET} +CLEANFILES+= objcopy.1 + +.endif + +SRCS= archive.c ascii.c binary.c main.c pe.c sections.c segments.c symbols.c + +WARNS?= 5 + +LIBADD= archive elftc elf pe + +CFLAGS+=-I${ELFTCDIR}/libelftc -I${ELFTCDIR}/libpe -I${ELFTCDIR}/common +CFLAGS+=-DWITH_PE=1 + + + +# This same hack is in lib/libelf/Makefile and usr.bin/readelf/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/elf_common.h +CLEANDIRS= sys +CFLAGS+= -I. +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/elfcopy/Makefile.depend b/usr.bin/elfcopy/Makefile.depend new file mode 100644 index 000000000000..898aa8b2b146 --- /dev/null +++ b/usr.bin/elfcopy/Makefile.depend @@ -0,0 +1,19 @@ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + include \ + include/xlocale \ + lib/${CSU_DIR} \ + lib/libarchive \ + lib/libc \ + lib/libcompiler_rt \ + lib/libelf \ + lib/libelftc \ + lib/libpe \ + + +.include <dirdeps.mk> + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif |
