Makefile.prog revision 1.1.6.1 1 # $NetBSD: Makefile.prog,v 1.1.6.1 2014/05/22 15:54:48 yamt Exp $
2 #
3 # Common Makefile fragment for a binutils program.
4 #
5
6 .include <bsd.own.mk>
7
8 BINUTILS_MACHINE_ARCH=${MACHINE_ARCH:C/armv[4-7]/arm/}
9
10 TOP= ${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
16 XPROG= ${PROG:c++filt=cxxfilt}
17 BUPROG= ${G_PROGRAMS:M${XPROG}*:S/-/_/}
18
19 SRCS= ${G_${BUPROG}_OBJECTS:.o=.c} \
20 ${G_${BUPROG}_DEPENDENCIES:M*.o:.o=.c}
21 MAN= ${G_man_MANS:M${PROG}.1}
22
23 CPPFLAGS+= -I${.CURDIR}/../common/arch/${BINUTILS_MACHINE_ARCH}
24
25 .if !empty(G_${BUPROG}_DEPENDENCIES:M*/libopcodes*)
26 PROGDPLIBS+= opcodes ${TOP}/${BFDSUBDIR}/libopcodes
27 .endif
28
29 .if !empty(G_${BUPROG}_DEPENDENCIES:M*/libbfd*)
30 PROGDPLIBS+= bfd ${TOP}/${BFDSUBDIR}/libbfd
31 .endif
32
33 .if !empty(G_${BUPROG}_DEPENDENCIES:M*/libiberty*)
34 PROGDPLIBS+= iberty ${TOP}/${BFDSUBDIR}/libiberty
35 .endif
36
37 .PATH: ${DIST}/binutils ${DIST}/binutils/doc
38
39 .include <bsd.prog.mk>
40
41 LDADD+= -lintl -lz -lm
42 DPADD+= ${LIBINTL} ${LIBZ} ${LIBM}
43
44 # Override the .y.c and .y.l rules *after* <bsd.prog.mk>
45 .y.c .l.c:
46