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