xref: /freebsd-12.1/usr.bin/objcopy/Makefile (revision 5a9066b4)
19b844631SEd Maste# $FreeBSD$
29b844631SEd Maste
39b844631SEd Maste.include <src.opts.mk>
49b844631SEd Maste
59b844631SEd MasteELFTCDIR=	${SRCTOP}/contrib/elftoolchain
69b844631SEd MasteELFCOPYDIR=	${ELFTCDIR}/elfcopy
79b844631SEd Maste
89b844631SEd Maste.PATH: ${ELFCOPYDIR}
99b844631SEd Maste
109b844631SEd MastePROG=	objcopy
119b844631SEd Masteobjcopy.1: elfcopy.1
129b844631SEd Maste	sed -e 's/\.Dt ELFCOPY 1/.Dt OBJCOPY 1/' \
13*5a9066b4SEd Maste	    -e '/\.Nm elfcopy ,/d' < ${.ALLSRC} > ${.TARGET}
149b844631SEd MasteCLEANFILES+= objcopy.1
159b844631SEd Maste
169b844631SEd MasteSRCS=	archive.c ascii.c binary.c main.c pe.c sections.c segments.c symbols.c
179b844631SEd Maste
189b844631SEd MasteWARNS?=	5
199b844631SEd Maste
209b844631SEd MasteLIBADD=	archive elftc elf pe
219b844631SEd Maste
229b844631SEd MasteCFLAGS+=-I${ELFTCDIR}/libelftc -I${ELFTCDIR}/libpe -I${ELFTCDIR}/common
239b844631SEd MasteCFLAGS+=-DWITH_PE=1
249b844631SEd Maste
259b844631SEd MasteMAN=	${PROG}.1 strip.1
269b844631SEd Maste
279b844631SEd MasteLINKS=	${BINDIR}/${PROG} ${BINDIR}/strip
289b844631SEd Maste
299b844631SEd Maste# This same hack is in lib/libelf/Makefile and usr.bin/readelf/Makefile
309b844631SEd Maste# We need to link against the correct version of these files. One
319b844631SEd Maste# solution is to include SRCTOP/sys in the include path. This causes
329b844631SEd Maste# problems when a header file in sys depends on a file in another
339b844631SEd Maste# part of the tree, e.g. a machine dependent header.
349b844631SEd Maste#
359b844631SEd MasteSRCS+=		sys/elf_common.h
369b844631SEd MasteCLEANDIRS=	sys
379b844631SEd MasteCFLAGS+=	-I.
389b844631SEd Mastesys/elf_common.h: ${SRCTOP}/sys/${.TARGET} .NOMETA
399b844631SEd Maste	mkdir -p ${.OBJDIR}/sys
409b844631SEd Maste	ln -sf ${.ALLSRC} ${.TARGET}
419b844631SEd Maste
429b844631SEd Maste.include <bsd.prog.mk>
43