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