summaryrefslogtreecommitdiff
path: root/external/gpl3/binutils/lib/libbfd/Makefile
blob: 616122a3ebb981db3f007b0e8e4971930e3e7cd3 (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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
#	$NetBSD: Makefile,v 1.13 2015/03/28 07:03:23 matt Exp $

NOLINKLIB=	# defined
NOLINT=		# defined
NOMAN=		# defined
NOPROFILE=	# defined
NOCLANGERROR=	# defined

.include <bsd.own.mk>

# If the platform does not support shared libraries, we need to supply
# *something* for BFD-using programs to link against.  Also provide an
# empty libinstall target so that libbfd.a does not get installed.
.if ${MKPIC} == "no"
MKLINKLIB=	yes
libinstall:	# do nothing
.endif

LIB=		bfd

BFD_MACHINE_ARCH?=	${MACHINE_ARCH:C/armv[4-7]/arm/}

DEFS_MK=${.CURDIR}/arch/${BFD_MACHINE_ARCH}/defs.mk

.if exists(${DEFS_MK})
.include "${DEFS_MK}"

DIST=		${NETBSDSRCDIR}/external/gpl3/binutils/dist

.if defined(__MINIX)
# MINIX: make sure sources are fetched, even when tools not built earlier
GNUHOSTDIST=	${DIST}
.include "${.CURDIR}/../../../../../minix/Makefile.fetchgnu"
.endif # defined(__MINIX)

SHLIB_MAJOR=	13
SHLIB_MINOR=	0

LIBDPLIBS+=	z	${.CURDIR}/../../../../../lib/libz

GCPPFLAGS=	${G_archdefs} ${G_DEFS} ${G_INCLUDES} ${G_TDEFAULTS}
CPPFLAGS+=	-I${.CURDIR}/arch/${BFD_MACHINE_ARCH} -I${DIST}/include -I. \
		-I${DIST}/bfd ${GCPPFLAGS:M-D*} ${GCPPFLAGS:M-I*:N-I.*} \
		-DDEBUGDIR=\"${DEBUGDIR}\"

.if (${BFD_MACHINE_ARCH} == "vax")
CPPFLAGS.elf.c +=	-O0
.endif

GSRCS=		${G_libbfd_la_OBJECTS:libbfd.lo=lib_bfd.lo} \
		${G_libbfd_la_DEPENDENCIES:M*.lo}
SRCS=		${GSRCS:.lo=.c}

DPSRCS+=	elf32-target.h elf64-target.h targmatch.h \
		elf32-ia64.c elf64-ia64.c peigen.c pepigen.c \
		pex64igen.c
CLEANFILES+=	elf32-target.h elf64-target.h targmatch.h \
		elf32-ia64.c elf64-ia64.c peigen.c pepigen.c \
		pex64igen.c

TEXINFO=	bfd.texinfo
INFOFLAGS=	-I${DIST}/bfd/doc

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

.include <bsd.lib.mk>
.include <bsd.info.mk>

${OBJS} ${SOBJS}: elf32-target.h elf64-target.h
targets.o targets.pico: targmatch.h Makefile
.else
.include <bsd.prog.mk> # do nothing
.endif

targmatch.h: config.bfd targmatch.sed
	${_MKTARGET_CREATE}
	${TOOL_SED} -f ${.ALLSRC:M*.sed} ${.ALLSRC:M*.bfd} >$@

elf32-target.h: elfxx-target.h
	${_MKTARGET_CREATE}
	${TOOL_SED} -e s/NN/32/g < $> > $@

elf64-target.h: elfxx-target.h
	${_MKTARGET_CREATE}
	${TOOL_SED} -e s/NN/64/g < $> > $@

elf32-ia64.c: elfnn-ia64.c
	${_MKTARGET_CREATE}
	${TOOL_SED} -e s/NN/32/g < $> > $@

elf64-ia64.c: elfnn-ia64.c
	${_MKTARGET_CREATE}
	${TOOL_SED} -e s/NN/64/g < $> > $@

elf32-riscv.c: elfnn-riscv.c
	${_MKTARGET_CREATE}
	${TOOL_SED} -e s/NN/32/g < $> > $@

elf64-riscv.c: elfnn-riscv.c
	${_MKTARGET_CREATE}
	${TOOL_SED} -e s/NN/64/g < $> > $@

peigen.c: peXXigen.c
	${_MKTARGET_CREATE}
	${TOOL_SED} -e s/XX/pe/g < $> > $@

pepigen.c: peXXigen.c
	${_MKTARGET_CREATE}
	${TOOL_SED} -e s/XX/pep/g < $> > $@

pex64igen.c: peXXigen.c
	${_MKTARGET_CREATE}
	${TOOL_SED} -e s/XX/pex64/g < $> > $@

.if defined(__MINIX) && ${USETOOLS} != "yes"
# Trigger the fetch phase, even when not building tools
${SRCS} realdepend realall realinstall: ${fetch_done}
.endif # defined(__MINIX)