realpath.3: Sort SEE ALSO.
[dragonfly.git] / gnu / usr.bin / gdb / libbfd / Makefile
1 .include "../Makefile.inc"
2
3 LIB=    bfd
4 INTERNALLIB=    true
5
6 CONTRIBDIR=     ${BASEDIR}/bfd
7 .PATH:  ${CONTRIBDIR}
8
9 CFLAGS+=        -I${BASEDIR}/include -I${CONTRIBDIR} -I${.CURDIR} -I${.OBJDIR}
10 # XXX no clue what DEBUGDIR is for
11 CFLAGS+=        -DDEBUGDIR='"/usr/lib/debug"'
12
13 SRCS=   archive.c archures.c bfd.c bfdio.c \
14         cache.c coffgen.c corefile.c format.c init.c libbfd.c \
15         opncls.c reloc.c section.c syms.c targets.c hash.c \
16         linker.c srec.c binary.c tekhex.c ihex.c stabs.c \
17         stab-syms.c merge.c dwarf2.c simple.c compress.c \
18         verilog.c elf-nacl.c
19
20 # only when USE_MMAP (--with-mmap)
21 #SRCS+= bfdwin.c
22
23 SRCS+=          targmatch.h elf32-target.h elf64-target.h
24 CLEANFILES+=    elf64-target.h elf32-target.h targmatch.h
25
26 targmatch.h: config.bfd targmatch.sed
27         sed -f ${CONTRIBDIR}/targmatch.sed < ${CONTRIBDIR}/config.bfd > ${.TARGET}
28
29 elf32-target.h: elfxx-target.h
30         sed -e s/NN/32/g < ${CONTRIBDIR}/elfxx-target.h > ${.TARGET}
31 elf64-target.h: elfxx-target.h
32         sed -e s/NN/64/g < ${CONTRIBDIR}/elfxx-target.h > ${.TARGET}
33
34 TARGET_ARCH?=   ${MACHINE_ARCH}
35 .include "Makefile.${TARGET_ARCH}"
36
37 _selvec=
38 .for _v in ${VECTORS}
39 CFLAGS+= -DHAVE_${_v}
40 .if !empty(_selvec)
41 _selvec+= ,
42 .endif
43 _selvec+= &${_v}
44 .endfor
45 CFLAGS+= -DSELECT_VECS='${_selvec}'
46 CFLAGS+= -DSELECT_ARCHITECTURES='${ARCHITECTURES:S/^/\&/:S/$/,/} 0'
47 CFLAGS+= -DDEFAULT_VECTOR=${DEFAULT_VECTOR}
48
49
50 SRCS+=          bfd.h
51 CLEANFILES+=    bfd.h
52
53 # Used to do keyword replacement in bfd-X.h
54 #
55 BFD_HOST_64_BIT_DEFINED?=1
56 BFD_HOST_LONG_LONG?=1
57 .include "Makefile.host.${MACHINE_ARCH}"
58
59 bfd.h:  ${CONTRIBDIR}/bfd-in2.h
60         sed -e "s/@wordsize@/${BFD_ARCH_SIZE}/g" \
61             -e "s/@bfd_default_target_size@/${BFD_DEFAULT_TARGET_SIZE}/g" \
62             -e "s/@BFD_HOST_64BIT_LONG@/${BFD_HOST_64BIT_LONG}/g" \
63             -e "s/@BFD_HOST_64BIT_LONG_LONG@/${BFD_HOST_64BIT_LONG_LONG}/g" \
64             -e "s/@BFD_HOST_64_BIT@/${BFD_HOST_64_BIT}/g" \
65             -e "s/@BFD_HOST_U_64_BIT@/${BFD_HOST_U_64_BIT}/g" \
66             -e "s/@BFD_HOST_64_BIT_DEFINED@/${BFD_HOST_64_BIT_DEFINED}/g" \
67             -e "s/@BFD_HOST_LONG_LONG@/${BFD_HOST_LONG_LONG}/g" \
68             -e "s/@bfd_file_ptr@/${BFD_HOST_64_BIT}/g" \
69             -e "s/@BFD_HOSTPTR_T@/${BFD_HOSTPTR_T}/g" \
70             < ${CONTRIBDIR}/bfd-in2.h > bfd.h.new
71         mv -f bfd.h.new bfd.h
72
73 SRCS+=          bfd_stdint.h
74 CLEANFILES+=    bfd_stdint.h
75
76 bfd_stdint.h:
77         touch ${.TARGET}
78
79 .include <bsd.lib.mk>