NetBSD/gnu/usr.bin/binutils/common/Makefile.prog
2003-04-11 22:46:02 +00:00

57 lines
1.3 KiB
Makefile

# $NetBSD: Makefile.prog,v 1.6 2003/04/11 22:46:02 thorpej Exp $
#
# Common Makefile fragment for a binutils program.
#
.include <bsd.own.mk>
TOP= ${NETBSDSRCDIR}/gnu
DIST= ${TOP}/dist/toolchain
.include "${.CURDIR}/../common/arch/${MACHINE_ARCH}/defs.mk"
# Might end in "-new" in GNU makefile
XPROG= ${PROG:c++filt=cxxfilt}
BUPROG= ${G_PROGRAMS:M${XPROG}*:S/-/_/}
SRCS= ${G_${BUPROG}_OBJECTS:.o=.c} \
${G_${BUPROG}_DEPENDENCIES:M*.o:.o=.c}
MAN= ${G_man_MANS:M${PROG}.1}
CPPFLAGS+= -I${.CURDIR}/../common/arch/${MACHINE_ARCH}
LDADD= -lintl
DPADD= ${LIBINTL}
.if !empty(G_${BUPROG}_DEPENDENCIES:M*/libopcodes*)
OPCODESOBJ!= cd ${TOP}/lib/libopcodes && ${PRINTOBJDIR}
LDADD+= -L${OPCODESOBJ} -lopcodes
.if ${MKPICLIB} != "no"
DPADD+= ${OPCODESOBJ}/libopcodes_pic.a
.else
DPADD+= ${OPCODESOBJ}/libopcodes.a
.endif
.endif
.if !empty(G_${BUPROG}_DEPENDENCIES:M*/libbfd*)
BFDOBJ!= cd ${TOP}/lib/libbfd && ${PRINTOBJDIR}
LDADD+= -L${BFDOBJ} -lbfd
.if ${MKPICLIB} != "no"
DPADD+= ${BFDOBJ}/libbfd_pic.a
.else
DPADD+= ${BFDOBJ}/libbfd.a
.endif
.endif
.if !empty(G_${BUPROG}_DEPENDENCIES:M*/libiberty*)
IBERTYOBJ!= cd ${TOP}/lib/libiberty && ${PRINTOBJDIR}
LDADD+= -L${IBERTYOBJ} -liberty
DPADD+= ${IBERTYOBJ}/libiberty.a
.endif
.y.c .l.c:
.PATH: ${DIST}/binutils ${DIST}/binutils/doc
.include <bsd.prog.mk>