xref: /minix3/external/gpl3/binutils/lib/libbfd/Makefile (revision 18a5822eff3a5bdeb6301a60d7d6269594c7ce35)
1#	$NetBSD: Makefile,v 1.6 2011/09/25 04:32:46 christos Exp $
2
3NOLINKLIB=	# defined
4NOLINT=		# defined
5NOMAN=		# defined
6NOPROFILE=	# defined
7NOCLANGERROR=	# defined
8
9.include <bsd.own.mk>
10
11# If the platform does not support shared libraries, we need to supply
12# *something* for BFD-using programs to link against.  Also provide an
13# empty libinstall target so that libbfd.a does not get installed.
14.if ${MKPIC} == "no"
15MKLINKLIB=	yes
16libinstall:	# do nothing
17.endif
18
19LIB=		bfd
20
21BFD_MACHINE_ARCH?=	${MACHINE_ARCH}
22
23.if exists(${.CURDIR}/arch/${BFD_MACHINE_ARCH}/defs.mk)
24.include "${.CURDIR}/arch/${BFD_MACHINE_ARCH}/defs.mk"
25
26DIST=		${NETBSDSRCDIR}/external/gpl3/binutils/dist
27
28SHLIB_MAJOR=	12
29SHLIB_MINOR=	0
30
31LIBDPLIBS+=	z	${.CURDIR}/../../../../../lib/libz
32
33GCPPFLAGS=	${G_archdefs} ${G_DEFS} ${G_INCLUDES} ${G_TDEFAULTS}
34CPPFLAGS+=	-I${.CURDIR}/arch/${BFD_MACHINE_ARCH} -I${DIST}/include -I. \
35		-I${DIST}/bfd ${GCPPFLAGS:M-D*} ${GCPPFLAGS:M-I*:N-I.*} \
36		-DDEBUGDIR=\"${DEBUGDIR}\"
37
38GSRCS=		${G_libbfd_la_OBJECTS:libbfd.lo=lib_bfd.lo} \
39		${G_libbfd_la_DEPENDENCIES:M*.lo}
40SRCS=		${GSRCS:.lo=.c}
41
42DPSRCS+=	elf32-target.h elf64-target.h targmatch.h \
43		elf32-ia64.c elf64-ia64.c peigen.c pepigen.c
44CLEANFILES+=	elf32-target.h elf64-target.h targmatch.h \
45		elf32-ia64.c elf64-ia64.c peigen.c pepigen.c
46
47TEXINFO=	bfd.texinfo
48INFOFLAGS=	-I${DIST}/bfd/doc
49
50.PATH: ${DIST}/bfd ${DIST}/bfd/doc
51
52.include <bsd.lib.mk>
53.include <bsd.info.mk>
54
55${OBJS} ${SOBJS}: elf32-target.h elf64-target.h
56targets.o targets.pico: targmatch.h Makefile
57.else
58.include <bsd.prog.mk> # do nothing
59.endif
60
61targmatch.h: config.bfd targmatch.sed
62	${_MKTARGET_CREATE}
63	${TOOL_SED} -f ${.ALLSRC:M*.sed} ${.ALLSRC:M*.bfd} >$@
64
65elf32-target.h: elfxx-target.h
66	${_MKTARGET_CREATE}
67	${TOOL_SED} -e s/NN/32/g < $> > $@
68
69elf64-target.h: elfxx-target.h
70	${_MKTARGET_CREATE}
71	${TOOL_SED} -e s/NN/64/g < $> > $@
72
73elf32-ia64.c: elfxx-ia64.c
74	${_MKTARGET_CREATE}
75	${TOOL_SED} -e s/NN/32/g < $> > $@
76
77elf64-ia64.c: elfxx-ia64.c
78	${_MKTARGET_CREATE}
79	${TOOL_SED} -e s/NN/64/g < $> > $@
80
81peigen.c: peXXigen.c
82	${_MKTARGET_CREATE}
83	${TOOL_SED} -e s/XX/pe/g < $> > $@
84
85pepigen.c: peXXigen.c
86	${_MKTARGET_CREATE}
87	${TOOL_SED} -e s/XX/pep/g < $> > $@
88
89pex64igen.c: peXXigen.c
90	${_MKTARGET_CREATE}
91	${TOOL_SED} -e s/XX/pex64/g < $> > $@
92