| Commit | Line | Data |
|---|---|---|
| a968ac75 SS |
1 | # $DragonFly: src/gnu/usr.bin/binutils217/libbfd/Makefile,v 1.1 2007/04/13 12:24:32 corecode Exp $ |
| 2 | ||
| 3 | .include "../Makefile.inc0" | |
| 4 | ||
| 5 | .PATH: ${SRCDIR}/bfd ${SRCDIR}/opcodes | |
| 6 | ||
| 7 | CONTRIBDIR= ${SRCDIR}/bfd | |
| 8 | ||
| 9 | LIB= bfd | |
| 10 | SRCS+= archive.c archive64.c archures.c bfd.c bfdio.c binary.c cache.c \ | |
| 11 | coffgen.c corefile.c elf.c elf-eh-frame.c elf-strtab.c format.c \ | |
| 12 | hash.c ihex.c init.c libbfd.c linker.c merge.c opncls.c reloc.c \ | |
| 13 | section.c simple.c srec.c stab-syms.c stabs.c syms.c \ | |
| 14 | targets.c tekhex.c \ | |
| 15 | targmatch.h dwarf1.c dwarf2.c config.h bfd.h bfdver.h | |
| 16 | .if (${TARGET_ARCH} == "alpha" || ${TARGET_ARCH} == "sparc64") | |
| 17 | WARNS= 2 | |
| 18 | .endif | |
| 19 | CFLAGS+= -I${SRCDIR}/bfd | |
| 20 | INTERNALLIB= true | |
| 21 | ||
| 22 | CLEANFILES+= bfd.h bfdver.h targmatch.h | |
| 23 | ||
| 24 | # If set, BINUTILSDISTDIR is the path to a directory containing the full GNU | |
| 25 | # binutils release. FreeBSD only distributes the bits that are required to | |
| 26 | # build native architectures. BINUTILSDISTDIR is needed to build cross tools. | |
| 27 | .if defined(BINUTILSDISTDIR) && exists(${BINUTILSDISTDIR}) | |
| 28 | .PATH: ${BINUTILSDISTDIR}/bfd ${BINUTILSDISTDIR}/opcodes | |
| 29 | CFLAGS+= -I${BINUTILSDISTDIR}/bfd -I${BINUTILSDISTDIR}/include -I. | |
| 30 | .endif | |
| 31 | ||
| 32 | # XXX broken | |
| 33 | SELARCH= | |
| c1543a89 | 34 | .if ${BINUTIL_ARCH} == "x86_64" |
| a968ac75 SS |
35 | SELARCH= &bfd_i386_arch |
| 36 | .else | |
| 37 | .for _a in ${ARCHS} | |
| 38 | .if ${SELARCH} == "" | |
| 39 | SELARCH+= &bfd_${_a}_arch | |
| 40 | .else | |
| 41 | SELARCH+= ,&bfd_${_a}_arch | |
| 42 | .endif | |
| 43 | .endfor | |
| 44 | .endif | |
| 45 | CFLAGS+= -DSELECT_ARCHITECTURES="${SELARCH}" | |
| 46 | ||
| 47 | SELVEC= | |
| 48 | .for _v in ${VECS} | |
| 49 | CFLAGS+= -DHAVE_${_v} | |
| 50 | .if ${SELVEC} == "" | |
| 51 | SELVEC+= &${_v} | |
| 52 | .else | |
| 53 | SELVEC+= ,&${_v} | |
| 54 | .endif | |
| 55 | .endfor | |
| 56 | .if defined(DEFAULT_VECTOR) | |
| 57 | CFLAGS+= -DDEFAULT_VECTOR=${DEFAULT_VECTOR} | |
| 58 | .endif | |
| 59 | CFLAGS+= -DSELECT_VECS="${SELVEC}" | |
| 60 | ||
| 61 | # Used to do keyword replacement in bfd-X.h | |
| 62 | # | |
| 63 | .if ${MACHINE_ARCH} == "i386" | |
| 64 | BFD_HOST_64BIT_LONG?=0 | |
| 65 | BFD_HOST_64_BIT?=long long | |
| 66 | BFD_HOST_U_64_BIT?=unsigned long long | |
| 67 | .else | |
| 68 | BFD_HOST_64BIT_LONG?=1 | |
| 69 | BFD_HOST_64_BIT?=long long | |
| 70 | BFD_HOST_U_64_BIT?=unsigned long long | |
| 71 | .endif | |
| 72 | BFD_HOST_64_BIT_DEFINED?=1 | |
| 73 | BFD_HOST_LONG_LONG?=1 | |
| 74 | ||
| 75 | bfd.h: ${SRCDIR}/bfd/bfd-in2.h | |
| 76 | sed -e "s/@wordsize@/${BFD_ARCH_SIZE}/g" \ | |
| 77 | -e "s/@bfd_default_target_size@/${BFD_DEFAULT_TARGET_SIZE}/g" \ | |
| 78 | -e "s/@BFD_HOST_64BIT_LONG@/${BFD_HOST_64BIT_LONG}/g" \ | |
| 79 | -e "s/@BFD_HOST_64_BIT@/${BFD_HOST_64_BIT}/g" \ | |
| 80 | -e "s/@BFD_HOST_U_64_BIT@/${BFD_HOST_U_64_BIT}/g" \ | |
| 81 | -e "s/@BFD_HOST_64_BIT_DEFINED@/${BFD_HOST_64_BIT_DEFINED}/g" \ | |
| 82 | -e "s/@BFD_HOST_LONG_LONG@/${BFD_HOST_LONG_LONG}/g" \ | |
| 83 | -e "s/@bfd_file_ptr@/${BFD_HOST_64_BIT}/g" \ | |
| 84 | < ${SRCDIR}/bfd/bfd-in2.h > bfd.h.new | |
| 85 | mv -f bfd.h.new bfd.h | |
| 86 | ||
| 87 | bfdver.h: ${SRCDIR}/bfd/version.h | |
| 88 | sed -e "s/@bfd_version_string@/\\\"`echo -n ${VERSION}`\\\"/g" \ | |
| 89 | -e "s/@bfd_version@/${VERSION_BFD}/g" \ | |
| 90 | < ${SRCDIR}/bfd/version.h > bfdver.h.new | |
| 91 | mv -f bfdver.h.new bfdver.h | |
| 92 | ||
| 93 | # match targets defined in the assembler's targ-env.h with an output vector. | |
| c1543a89 | 94 | # XXX i386-*-dragonfly and x86_64-*-dragonfly are obsolete, but not quite |
| a968ac75 SS |
95 | # removed from the binutils build yet. |
| 96 | targmatch.h: targmatch.sed config.bfd | |
| 97 | sed -f ${.ALLSRC:M*.sed} ${.ALLSRC:M*.bfd} > ${.TARGET}.new | |
| 98 | echo ${TARGMATCH:Q} >> ${.TARGET}.new | |
| 99 | mv -f ${.TARGET}.new ${.TARGET} | |
| 100 | ||
| 101 | .include <bsd.lib.mk> |