2016-02-10 19:39:36 +00:00
|
|
|
# $Id: Makefile 3381 2016-01-30 19:39:47Z jkoshy $
|
2014-01-15 08:43:20 +00:00
|
|
|
|
|
|
|
TOP= ..
|
|
|
|
|
2016-02-10 19:39:36 +00:00
|
|
|
.include "${TOP}/mk/elftoolchain.components.mk"
|
|
|
|
|
2014-01-15 08:43:20 +00:00
|
|
|
PROG= elfcopy
|
|
|
|
|
2016-02-10 19:39:36 +00:00
|
|
|
SRCS= archive.c ascii.c binary.c main.c sections.c segments.c \
|
|
|
|
symbols.c
|
2014-01-15 08:43:20 +00:00
|
|
|
|
|
|
|
WARNS?= 5
|
|
|
|
|
|
|
|
DPADD= ${LIBELF} ${LIBELFTC}
|
|
|
|
LDADD= -lelf -lelftc
|
|
|
|
|
|
|
|
.if !defined(LIBELF_AR)
|
|
|
|
LDADD+= -larchive
|
|
|
|
.endif
|
|
|
|
|
2016-02-10 19:39:36 +00:00
|
|
|
.if defined(WITH_PE) && ${WITH_PE:tl} == "yes"
|
|
|
|
SRCS+= pe.c
|
|
|
|
CFLAGS+= -DWITH_PE=1
|
|
|
|
|
|
|
|
DPADD+= ${LIBPE}
|
|
|
|
LDADD+= -lpe
|
|
|
|
.endif
|
|
|
|
|
2014-01-15 08:43:20 +00:00
|
|
|
MAN= elfcopy.1 mcs.1 strip.1
|
2016-02-10 19:39:36 +00:00
|
|
|
MLINKS= elfcopy.1 objcopy.1
|
2014-01-15 08:43:20 +00:00
|
|
|
|
|
|
|
NO_SHARED?= yes
|
|
|
|
|
2016-02-10 19:39:36 +00:00
|
|
|
LINKS= ${BINDIR}/elfcopy ${BINDIR}/mcs \
|
|
|
|
${BINDIR}/elfcopy ${BINDIR}/objcopy \
|
|
|
|
${BINDIR}/elfcopy ${BINDIR}/strip
|
2014-01-15 08:43:20 +00:00
|
|
|
|
2016-02-10 19:39:36 +00:00
|
|
|
EXTRA_TARGETS= mcs strip objcopy
|
2014-01-15 08:43:20 +00:00
|
|
|
|
|
|
|
CLEANFILES+= ${EXTRA_TARGETS}
|
|
|
|
|
|
|
|
# Create in-place symbolic links to "elfcopy" at build time.
|
|
|
|
|
|
|
|
all: ${EXTRA_TARGETS}
|
|
|
|
|
|
|
|
${EXTRA_TARGETS}: ${PROG}
|
|
|
|
ln -s ${PROG} ${.TARGET}
|
|
|
|
|
|
|
|
.include "${TOP}/mk/elftoolchain.prog.mk"
|
|
|
|
|
|
|
|
.if ${OS_HOST} == "OpenBSD"
|
|
|
|
CFLAGS+= -I/usr/local/include
|
|
|
|
LDFLAGS+= -L/usr/local/lib
|
|
|
|
.endif
|