summaryrefslogtreecommitdiff
path: root/external/gpl3/binutils/usr.bin/common/Makefile.prog
blob: 054fa608a2e7b5e6c80deda2904bcbaad67965cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#	$NetBSD: Makefile.prog,v 1.11 2022/12/26 16:41:00 christos Exp $
#
# Common Makefile fragment for a binutils program.
#

BINUTILS_MACHINE_ARCH=${MACHINE_ARCH:C/armv[4-7]/arm/}
CPPFLAGS+=	-I${.CURDIR}/../common/arch/${BINUTILS_MACHINE_ARCH}

.include <bsd.init.mk>

.include "${.CURDIR}/../common/Makefile.inc"
.include "${.CURDIR}/../common/arch/${BINUTILS_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:T:M${PROG}.1}


.if !empty(G_${BUPROG}_DEPENDENCIES:M*/libopcodes*)
PROGDPLIBS+=	opcodes	${TOP}/${BFDSUBDIR}/libopcodes
.endif

.if !empty(G_${BUPROG}_DEPENDENCIES:M*/libbfd*)
PROGDPLIBS+=	bfd	${TOP}/${BFDSUBDIR}/libbfd
.endif

.if !empty(G_${BUPROG}_DEPENDENCIES:M*/libiberty*)
PROGDPLIBS+=	iberty	${TOP}/${BFDSUBDIR}/libiberty
.endif

.PATH: ${DIST}/binutils ${DIST}/binutils/doc

.include <bsd.prog.mk>

LDADD+=		-lintl -lz -lm
DPADD+=		${LIBINTL} ${LIBZ} ${LIBM}

# Override the .y.c and .y.l rules *after* <bsd.prog.mk>
.y.c .l.c: