xref: /netbsd-src/external/gpl3/binutils.old/usr.bin/common/Makefile.prog (revision e992f068c547fd6e84b3f104dc2340adcc955732)
1#	$NetBSD: Makefile.prog,v 1.9 2024/06/29 16:36:04 christos Exp $
2#
3# Common Makefile fragment for a binutils program.
4#
5
6BINUTILS_MACHINE_ARCH=${MACHINE_ARCH:C/armv[4-7]/arm/}
7CPPFLAGS+=	-I${.CURDIR}/../common/arch/${BINUTILS_MACHINE_ARCH}
8
9.include <bsd.init.mk>
10
11.include "${.CURDIR}/../common/Makefile.inc"
12.include "${.CURDIR}/../common/arch/${BINUTILS_MACHINE_ARCH}/defs.mk"
13
14# Might end in "-new" in GNU makefile
15XPROG=		${PROG:c++filt=cxxfilt}
16BUPROG=		${G_PROGRAMS:M${XPROG}*:S/-/_/}
17
18SRCS=		${G_${BUPROG}_OBJECTS:.o=.c} \
19		${G_${BUPROG}_DEPENDENCIES:M*.o:.o=.c}
20MAN=		${G_man_MANS:T:M${PROG}.1}
21
22
23.if !empty(G_${BUPROG}_DEPENDENCIES:M*/libopcodes*)
24PROGDPLIBS+=	opcodes	${TOP}/${BFDSUBDIR}/libopcodes
25.endif
26
27.if !empty(G_${BUPROG}_DEPENDENCIES:M*/libbfd*)
28PROGDPLIBS+=	bfd	${TOP}/${BFDSUBDIR}/libbfd
29.endif
30
31.if !empty(G_${BUPROG}_DEPENDENCIES:M*/libiberty*)
32PROGDPLIBS+=	iberty	${TOP}/${BFDSUBDIR}/libiberty
33.endif
34
35.PATH: ${DIST}/binutils ${DIST}/binutils/doc
36
37.include <bsd.prog.mk>
38
39LDADD+=		-lintl -lz -lm
40DPADD+=		${LIBINTL} ${LIBZ} ${LIBM}
41
42# Override the .y.c and .y.l rules *after* <bsd.prog.mk>
43.y.c .l.c:
44