Allow gdb to be cross-compiled.
[dragonfly.git] / gnu / usr.bin / gdb / libbfd / Makefile
1 # $DragonFly: src/gnu/usr.bin/gdb/libbfd/Makefile,v 1.3 2008/07/28 22:33:21 corecode Exp $
2
3 .include "../Makefile.inc"
4
5 LIB=    bfd
6 INTERNALLIB=    true
7
8 CONTRIBDIR=     ${BASEDIR}/bfd
9 .PATH:  ${CONTRIBDIR}
10
11 CFLAGS+=        -I${BASEDIR}/include -I${CONTRIBDIR} -I${.CURDIR} -I${.OBJDIR}
12 # XXX no clue what DEBUGDIR is for
13 CFLAGS+=        -DDEBUGDIR='"/usr/lib/debug"'
14
15 SRCS=   archive.c archive64.c archures.c bfd.c bfdio.c bfdwin.c binary.c
16 SRCS+=  cache.c coffgen.c cofflink.c corefile.c dwarf1.c dwarf2.c
17 SRCS+=  elf-eh-frame.c elf-strtab.c elf.c elflink.c elf-attrs.c
18 SRCS+=  format.c hash.c ihex.c init.c libbfd.c linker.c merge.c opncls.c
19 SRCS+=  reloc.c section.c simple.c srec.c stab-syms.c stabs.c syms.c
20 SRCS+=  targets.c tekhex.c
21
22 SRCS+=          targmatch.h
23 CLEANFILES+=    elf64-target.h elf32-target.h targmatch.h
24
25 targmatch.h: config.bfd targmatch.sed
26         sed -f ${CONTRIBDIR}/targmatch.sed < ${CONTRIBDIR}/config.bfd > ${.TARGET}
27
28 elf32-target.h: elfxx-target.h
29         sed -e s/NN/32/g < ${CONTRIBDIR}/elfxx-target.h > ${.TARGET}
30 elf64-target.h: elfxx-target.h
31         sed -e s/NN/64/g < ${CONTRIBDIR}/elfxx-target.h > ${.TARGET}
32
33 TARGET_ARCH?=   ${MACHINE_ARCH}
34 .include "Makefile.${TARGET_ARCH}"
35
36 SRCS+=          bfd.h bfdver.h
37 CLEANFILES+=    bfd.h bfdver.h
38
39 # Used to do keyword replacement in bfd-X.h
40 #
41 BFD_ARCH_SIZE?=64
42 BFD_HOST_64_BIT_DEFINED?=1
43 BFD_HOST_LONG_LONG?=1
44 .include "Makefile.host.${MACHINE_ARCH}"
45
46 bfd.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
60 bfdver.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
66
67 SRCS+=          bfd_stdint.h
68 CLEANFILES+=    bfd_stdint.h
69
70 bfd_stdint.h:
71         touch ${.TARGET}
72
73 .include <bsd.lib.mk>