Allow gdb to be cross-compiled.
[dragonfly.git] / gnu / usr.bin / gdb / libbfd / Makefile
CommitLineData
643b986c 1# $DragonFly: src/gnu/usr.bin/gdb/libbfd/Makefile,v 1.3 2008/07/28 22:33:21 corecode Exp $
b6fca148
JS
2
3.include "../Makefile.inc"
4
5LIB= bfd
6INTERNALLIB= true
7
8CONTRIBDIR= ${BASEDIR}/bfd
9.PATH: ${CONTRIBDIR}
10
11CFLAGS+= -I${BASEDIR}/include -I${CONTRIBDIR} -I${.CURDIR} -I${.OBJDIR}
0c3d4888
SS
12# XXX no clue what DEBUGDIR is for
13CFLAGS+= -DDEBUGDIR='"/usr/lib/debug"'
b6fca148
JS
14
15SRCS= archive.c archive64.c archures.c bfd.c bfdio.c bfdwin.c binary.c
16SRCS+= cache.c coffgen.c cofflink.c corefile.c dwarf1.c dwarf2.c
0c3d4888 17SRCS+= elf-eh-frame.c elf-strtab.c elf.c elflink.c elf-attrs.c
b6fca148
JS
18SRCS+= format.c hash.c ihex.c init.c libbfd.c linker.c merge.c opncls.c
19SRCS+= reloc.c section.c simple.c srec.c stab-syms.c stabs.c syms.c
20SRCS+= targets.c tekhex.c
21
22SRCS+= targmatch.h
23CLEANFILES+= elf64-target.h elf32-target.h targmatch.h
24
25targmatch.h: config.bfd targmatch.sed
26 sed -f ${CONTRIBDIR}/targmatch.sed < ${CONTRIBDIR}/config.bfd > ${.TARGET}
27
28elf32-target.h: elfxx-target.h
29 sed -e s/NN/32/g < ${CONTRIBDIR}/elfxx-target.h > ${.TARGET}
30elf64-target.h: elfxx-target.h
31 sed -e s/NN/64/g < ${CONTRIBDIR}/elfxx-target.h > ${.TARGET}
32
643b986c
SS
33TARGET_ARCH?= ${MACHINE_ARCH}
34.include "Makefile.${TARGET_ARCH}"
35
36SRCS+= bfd.h bfdver.h
37CLEANFILES+= bfd.h bfdver.h
38
39# Used to do keyword replacement in bfd-X.h
40#
41BFD_ARCH_SIZE?=64
42BFD_HOST_64_BIT_DEFINED?=1
43BFD_HOST_LONG_LONG?=1
44.include "Makefile.host.${MACHINE_ARCH}"
45
46bfd.h: ${CONTRIBDIR}/bfd-in2.h
47 sed -e "s/@wordsize@/${BFD_ARCH_SIZE}/g" \
48 -e "s/@bfd_default_target_size@/${BFD_DEFAULT_TARGET_SIZE}/g" \
49 -e "s/@BFD_HOST_64BIT_LONG@/${BFD_HOST_64BIT_LONG}/g" \
50 -e "s/@BFD_HOST_64BIT_LONG_LONG@/${BFD_HOST_64BIT_LONG_LONG}/g" \
51 -e "s/@BFD_HOST_64_BIT@/${BFD_HOST_64_BIT}/g" \
52 -e "s/@BFD_HOST_U_64_BIT@/${BFD_HOST_U_64_BIT}/g" \
53 -e "s/@BFD_HOST_64_BIT_DEFINED@/${BFD_HOST_64_BIT_DEFINED}/g" \
54 -e "s/@BFD_HOST_LONG_LONG@/${BFD_HOST_LONG_LONG}/g" \
55 -e "s/@bfd_file_ptr@/${BFD_HOST_64_BIT}/g" \
56 -e "s/@BFD_HOSTPTR_T@/${BFD_HOSTPTR_T}/g" \
57 < ${CONTRIBDIR}/bfd-in2.h > bfd.h.new
58 mv -f bfd.h.new bfd.h
59
60bfdver.h: ${CONTRIBDIR}/version.h
61 sed -e "s/@bfd_version_string@/\"2.18.50.20070907\"/g" \
62 -e "s/@bfd_version_package@/\"(GNU Binutils, GDB packaged)\"/g" \
63 -e "s/@bfd_version@/218500000/g" \
64 < ${CONTRIBDIR}/version.h > bfdver.h.new
65 mv -f bfdver.h.new bfdver.h
b6fca148 66
0c3d4888
SS
67SRCS+= bfd_stdint.h
68CLEANFILES+= bfd_stdint.h
69
70bfd_stdint.h:
71 touch ${.TARGET}
72
b6fca148 73.include <bsd.lib.mk>