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