]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - usr.bin/elfcopy/Makefile
MFC r315170:
[FreeBSD/FreeBSD.git] / usr.bin / elfcopy / Makefile
1 # $FreeBSD$
2
3 .include <src.opts.mk>
4
5 ELFTCDIR=       ${SRCTOP}/contrib/elftoolchain
6 ELFCOPYDIR=     ${ELFTCDIR}/elfcopy
7
8 .PATH: ${ELFCOPYDIR}
9
10 .if ${MK_ELFCOPY_AS_OBJCOPY} != "no"
11 PROG=   objcopy
12 objcopy.1: elfcopy.1
13         sed -e 's/\.Dt ELFCOPY 1/.Dt OBJCOPY 1/' \
14             -e 's/\.Nm elfcopy/.Nm objcopy/' < ${.ALLSRC} > ${.TARGET}
15 CLEANFILES+= objcopy.1
16 .else
17 PROG=   elfcopy
18 .endif
19
20 SRCS=   archive.c ascii.c binary.c main.c pe.c sections.c segments.c symbols.c
21
22 WARNS?= 5
23
24 LIBADD= archive elftc elf pe
25
26 CFLAGS+=-I${ELFTCDIR}/libelftc -I${ELFTCDIR}/libpe -I${ELFTCDIR}/common
27 CFLAGS+=-DWITH_PE=1
28
29 MAN=    ${PROG}.1 strip.1
30
31 LINKS=  ${BINDIR}/${PROG} ${BINDIR}/strip
32
33 # This same hack is in lib/libelf/Makefile and usr.bin/readelf/Makefile
34 # We need to link against the correct version of these files. One
35 # solution is to include SRCTOP/sys in the include path. This causes
36 # problems when a header file in sys depends on a file in another
37 # part of the tree, e.g. a machine dependent header.
38 #
39 SRCS+=          sys/elf_common.h
40 CLEANDIRS=      sys
41 CFLAGS+=        -I.
42 sys/elf_common.h: ${SRCTOP}/sys/${.TARGET} .NOMETA
43         mkdir -p ${.OBJDIR}/sys
44         ln -sf ${.ALLSRC} ${.TARGET}
45
46 .include <bsd.prog.mk>