Initial import from FreeBSD RELENG_4:
[dragonfly.git] / gnu / usr.bin / binutils / libbfd / Makefile
1 # $FreeBSD: src/gnu/usr.bin/binutils/libbfd/Makefile,v 1.9.2.3 2002/09/01 23:39:15 obrien Exp $
2
3 .include "../Makefile.inc0"
4
5 .PATH: ${SRCDIR}/bfd ${SRCDIR}/opcodes
6
7 LIB=    bfd
8 SRCS+=  archive.c archive64.c archures.c bfd.c binary.c cache.c \
9         coffgen.c corefile.c elf.c elf-eh-frame.c elf-strtab.c format.c \
10         hash.c ihex.c init.c libbfd.c linker.c merge.c opncls.c reloc.c \
11         section.c srec.c stab-syms.c stabs.c syms.c targets.c tekhex.c \
12         targmatch.h dwarf1.c dwarf2.c config.h
13 .if (${TARGET_ARCH} == "alpha" || ${TARGET_ARCH} == "sparc64")
14 WARNS=  2
15 .endif
16 CFLAGS+= -I${SRCDIR}/bfd
17 CFLAGS+= -DBFD_VERSION=\"${VERSION_DATE}\" -DBFD_VERSION_DATE=${VERSION_DATE}
18 CFLAGS+= -DBFD_VERSION_STRING=\"${VERSION}\"
19 INTERNALLIB=    true
20 CLEANFILES+=    config.h targmatch.h
21
22 # If set, BINUTILSDISTDIR is the path to a directory containing the full GNU
23 # binutils release. FreeBSD only distributes the bits that are required to
24 # build native architectures. BINUTILSDISTDIR is needed to build cross tools.
25 .if defined(BINUTILSDISTDIR) && exists(${BINUTILSDISTDIR})
26 .PATH: ${BINUTILSDISTDIR}/bfd ${BINUTILSDISTDIR}/opcodes
27 CFLAGS+= -I${BINUTILSDISTDIR}/bfd -I${BINUTILSDISTDIR}/include -I.
28 .endif
29
30 SELARCH=
31 .if ${BINUTIL_ARCH} == "sparc64"
32 SELARCH= &bfd_sparc_arch
33 .else
34 .for _a in ${ARCHS}
35 .if ${SELARCH} == ""
36 SELARCH+= &bfd_${_a}_arch
37 .else
38 SELARCH+= ,&bfd_${_a}_arch
39 .endif
40 .endfor
41 .endif
42 CFLAGS+= -DSELECT_ARCHITECTURES="${SELARCH}"
43
44 SELVEC=
45 .for _v in ${VECS}
46 .if ${SELVEC} == ""
47 SELVEC+= &${_v}
48 .else
49 SELVEC+= ,&${_v}
50 .endif
51 .endfor
52 CFLAGS+= -DSELECT_VECS="${SELVEC}"
53
54 targmatch.h: targmatch.sed config.bfd
55         sed -f ${.ALLSRC:M*.sed} ${.ALLSRC:M*.bfd} > ${.TARGET}
56         
57 config.h: config.h.fbsd
58 .if ${BINUTIL_ARCH} == "i386"
59         sed -e 's,!!TRAD_HEADER!!,"hosts/i386bsd.h",g' ${.ALLSRC} > ${.TARGET}
60 .else
61         sed -e 's,!!TRAD_HEADER!!,,g' ${.ALLSRC} > ${.TARGET}
62 .endif
63
64 .include <bsd.lib.mk>