1*c9ea9e7aSLionel Sambuc# $NetBSD: Makefile.prog,v 1.9 2013/08/06 05:35:57 matt Exp $ 218a5822eSThomas Veerman# 318a5822eSThomas Veerman# Common Makefile fragment for a binutils program. 418a5822eSThomas Veerman# 518a5822eSThomas Veerman 618a5822eSThomas Veerman.include <bsd.own.mk> 718a5822eSThomas Veerman 8*c9ea9e7aSLionel SambucBINUTILS_MACHINE_ARCH=${MACHINE_ARCH:C/armv[4-7]/arm/} 9*c9ea9e7aSLionel Sambuc 1018a5822eSThomas VeermanTOP= ${NETBSDSRCDIR}/external/gpl3/binutils 1118a5822eSThomas Veerman 1218a5822eSThomas Veerman.include "${.CURDIR}/../common/Makefile.inc" 13*c9ea9e7aSLionel Sambuc.include "${.CURDIR}/../common/arch/${BINUTILS_MACHINE_ARCH}/defs.mk" 1418a5822eSThomas Veerman 1518a5822eSThomas Veerman# Might end in "-new" in GNU makefile 1618a5822eSThomas VeermanXPROG= ${PROG:c++filt=cxxfilt} 1718a5822eSThomas VeermanBUPROG= ${G_PROGRAMS:M${XPROG}*:S/-/_/} 1818a5822eSThomas Veerman 1918a5822eSThomas VeermanSRCS= ${G_${BUPROG}_OBJECTS:.o=.c} \ 2018a5822eSThomas Veerman ${G_${BUPROG}_DEPENDENCIES:M*.o:.o=.c} 2118a5822eSThomas VeermanMAN= ${G_man_MANS:M${PROG}.1} 2218a5822eSThomas Veerman 23*c9ea9e7aSLionel SambucCPPFLAGS+= -I${.CURDIR}/../common/arch/${BINUTILS_MACHINE_ARCH} 2418a5822eSThomas Veerman 2518a5822eSThomas Veerman.if !empty(G_${BUPROG}_DEPENDENCIES:M*/libopcodes*) 26*c9ea9e7aSLionel SambucPROGDPLIBS+= opcodes ${TOP}/${BFDSUBDIR}/libopcodes 2718a5822eSThomas Veerman.endif 2818a5822eSThomas Veerman 2918a5822eSThomas Veerman.if !empty(G_${BUPROG}_DEPENDENCIES:M*/libbfd*) 30*c9ea9e7aSLionel SambucPROGDPLIBS+= bfd ${TOP}/${BFDSUBDIR}/libbfd 3118a5822eSThomas Veerman.endif 3218a5822eSThomas Veerman 3318a5822eSThomas Veerman.if !empty(G_${BUPROG}_DEPENDENCIES:M*/libiberty*) 34*c9ea9e7aSLionel SambucPROGDPLIBS+= iberty ${TOP}/${BFDSUBDIR}/libiberty 3518a5822eSThomas Veerman.endif 3618a5822eSThomas Veerman 3718a5822eSThomas Veerman.PATH: ${DIST}/binutils ${DIST}/binutils/doc 3818a5822eSThomas Veerman 3918a5822eSThomas Veerman.include <bsd.prog.mk> 4018a5822eSThomas Veerman 41*c9ea9e7aSLionel Sambuc.if !defined(__MINIX) 42*c9ea9e7aSLionel SambucLDADD+= -lintl -lz -lm 43*c9ea9e7aSLionel SambucDPADD+= ${LIBINTL} ${LIBZ} ${LIBM} 44*c9ea9e7aSLionel Sambuc.else 45*c9ea9e7aSLionel SambucLDADD+= -lz -lm 46*c9ea9e7aSLionel SambucDPADD+= ${LIBZ} ${LIBM} 47*c9ea9e7aSLionel Sambuc.endif # !defined(__MINIX) 48*c9ea9e7aSLionel Sambuc 4918a5822eSThomas Veerman# Override the .y.c and .y.l rules *after* <bsd.prog.mk> 5018a5822eSThomas Veerman.y.c .l.c: 51