xref: /netbsd-src/external/gpl3/binutils/usr.bin/common/Makefile.prog (revision dd7241df2fae9da4ea2bd20a68f001fa86ecf909)
1*dd7241dfSchristos#	$NetBSD: Makefile.prog,v 1.12 2024/06/30 16:10:21 christos Exp $
231580a89Sskrll#
331580a89Sskrll# Common Makefile fragment for a binutils program.
431580a89Sskrll#
531580a89Sskrll
60d76fcf3SmattBINUTILS_MACHINE_ARCH=${MACHINE_ARCH:C/armv[4-7]/arm/}
762d79eecSchristosCPPFLAGS+=	-I${.CURDIR}/../common/arch/${BINUTILS_MACHINE_ARCH}
8b36ddc07Smatt
962d79eecSchristos.include <bsd.init.mk>
1031580a89Sskrll
1131580a89Sskrll.include "${.CURDIR}/../common/Makefile.inc"
12b36ddc07Smatt.include "${.CURDIR}/../common/arch/${BINUTILS_MACHINE_ARCH}/defs.mk"
1331580a89Sskrll
1431580a89Sskrll# Might end in "-new" in GNU makefile
1531580a89SskrllXPROG=		${PROG:c++filt=cxxfilt}
1631580a89SskrllBUPROG=		${G_PROGRAMS:M${XPROG}*:S/-/_/}
1731580a89Sskrll
1831580a89SskrllSRCS=		${G_${BUPROG}_OBJECTS:.o=.c} \
1931580a89Sskrll		${G_${BUPROG}_DEPENDENCIES:M*.o:.o=.c}
203b173307SchristosMAN=		${G_man_MANS:T:M${PROG}.1}
2131580a89Sskrll
2231580a89Sskrll
2331580a89Sskrll.if !empty(G_${BUPROG}_DEPENDENCIES:M*/libopcodes*)
2455c4079bSchristosPROGDPLIBS+=	opcodes	${TOP}/${BFDSUBDIR}/libopcodes
2531580a89Sskrll.endif
2631580a89Sskrll
2731580a89Sskrll.if !empty(G_${BUPROG}_DEPENDENCIES:M*/libbfd*)
2855c4079bSchristosPROGDPLIBS+=	bfd	${TOP}/${BFDSUBDIR}/libbfd
29*dd7241dfSchristosPROGDPLIBS+=	sframe	${TOP}/${BFDSUBDIR}/libsframe
3031580a89Sskrll.endif
3131580a89Sskrll
3231580a89Sskrll.if !empty(G_${BUPROG}_DEPENDENCIES:M*/libiberty*)
3355c4079bSchristosPROGDPLIBS+=	iberty	${TOP}/${BFDSUBDIR}/libiberty
3431580a89Sskrll.endif
3531580a89Sskrll
3631580a89Sskrll.PATH: ${DIST}/binutils ${DIST}/binutils/doc
3731580a89Sskrll
3831580a89Sskrll.include <bsd.prog.mk>
3931580a89Sskrll
40ce483308SmattLDADD+=		-lintl -lz -lm
41ce483308SmattDPADD+=		${LIBINTL} ${LIBZ} ${LIBM}
42c4855991Schristos
4331580a89Sskrll# Override the .y.c and .y.l rules *after* <bsd.prog.mk>
4431580a89Sskrll.y.c .l.c:
45