aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/objcopy/Makefile
blob: 2f3386d95ebe7e288bf32aa3a9239457021ffcfb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
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>