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