1# This is included explicitly at the top of each sub-Makefile.  We can't
2# use the normal "Makefile.inc" mechanism, because we need some of these
3# definitions before the sub-Makefile is processed.
4
5RELTOP:= ../..
6
7# RELTOP is the relative path to this point in the source or object
8# tree, from any subdirectory of same.  It gets extra "../" prefixes
9# added to it as we descend into subdirectories.
10
11RELSRC=	${RELTOP}/../../../contrib/binutils-2.34
12SRCDIR=	${.CURDIR}/${RELSRC}
13
14CFLAGS+= -I${.CURDIR} -I${.OBJDIR}
15CFLAGS+= -I${SRCDIR}/include
16
17TARGET_CANONICAL=		x86_64-pc-dragonfly
18BFD_HOST_64_BIT_DEFINED?=	1
19BFD_HOST_64BIT_LONG?=		1
20BFD_HOST_64BIT_LONG_LONG?=	0
21BFD_HOST_64_BIT?=		long
22BFD_HOST_U_64_BIT?=		unsigned long
23BFD_HOSTPTR_T?=			unsigned long
24BFD_ARCH_SIZE?=			64
25BFD_DEFAULT_TARGET_SIZE?=	64
26
27bfd.h:	${SRCDIR}/bfd/bfd-in2.h
28	sed -e "s/@supports_plugins@/1/g" \
29	    -e "s/@wordsize@/${BFD_ARCH_SIZE}/g" \
30	    -e "s/@bfd_default_target_size@/${BFD_DEFAULT_TARGET_SIZE}/g" \
31	    -e "s/@BFD_HOST_64BIT_LONG@/${BFD_HOST_64BIT_LONG}/g" \
32	    -e "s/@BFD_HOST_64BIT_LONG_LONG@/${BFD_HOST_64BIT_LONG_LONG}/g" \
33	    -e "s/@BFD_HOST_64_BIT@/${BFD_HOST_64_BIT}/g" \
34	    -e "s/@BFD_HOST_U_64_BIT@/${BFD_HOST_U_64_BIT}/g" \
35	    -e "s/@BFD_HOST_64_BIT_DEFINED@/${BFD_HOST_64_BIT_DEFINED}/g" \
36	    -e "s/@bfd_file_ptr@/${BFD_HOST_64_BIT}/g" \
37	    -e "s/@BFD_HOSTPTR_T@/${BFD_HOSTPTR_T}/g" \
38	    < ${.ALLSRC} > bfd.h.new
39	mv -f bfd.h.new bfd.h
40