1 # $NetBSD: Makefile.prog,v 1.1 2009/08/18 20:22:08 skrll Exp $
3 # Common Makefile fragment for a binutils program.
8 TOP= ${NETBSDSRCDIR}/external/gpl3/binutils
10 .include "${.CURDIR}/../common/Makefile.inc"
11 .include "${.CURDIR}/../common/arch/${MACHINE_ARCH}/defs.mk"
13 # Might end in "-new" in GNU makefile
14 XPROG= ${PROG:c++filt=cxxfilt}
15 BUPROG= ${G_PROGRAMS:M${XPROG}*:S/-/_/}
17 SRCS= ${G_${BUPROG}_OBJECTS:.o=.c} \
18 ${G_${BUPROG}_DEPENDENCIES:M*.o:.o=.c}
19 MAN= ${G_man_MANS:M${PROG}.1}
21 CPPFLAGS+= -I${.CURDIR}/../common/arch/${MACHINE_ARCH}
26 .if !empty(G_${BUPROG}_DEPENDENCIES:M*/libopcodes*)
27 OPCODESOBJ!= cd ${TOP}/${BFDSUBDIR}/libopcodes && ${PRINTOBJDIR}
28 LDADD+= -L${OPCODESOBJ} -lopcodes
29 .if ${MKPICLIB} != "no"
30 DPADD+= ${OPCODESOBJ}/libopcodes_pic.a
32 DPADD+= ${OPCODESOBJ}/libopcodes.a
36 .if !empty(G_${BUPROG}_DEPENDENCIES:M*/libbfd*)
37 BFDOBJ!= cd ${TOP}/${BFDSUBDIR}/libbfd && ${PRINTOBJDIR}
38 LDADD+= -L${BFDOBJ} -lbfd
39 .if ${MKPICLIB} != "no"
40 DPADD+= ${BFDOBJ}/libbfd_pic.a
42 DPADD+= ${BFDOBJ}/libbfd.a
46 .if !empty(G_${BUPROG}_DEPENDENCIES:M*/libiberty*)
47 IBERTYOBJ!= cd ${TOP}/${BFDSUBDIR}/libiberty && ${PRINTOBJDIR}
48 LDADD+= -L${IBERTYOBJ} -liberty
49 DPADD+= ${IBERTYOBJ}/libiberty.a
52 .PATH: ${DIST}/binutils ${DIST}/binutils/doc
54 .include <bsd.prog.mk>
56 # Override the .y.c and .y.l rules *after* <bsd.prog.mk>