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