binutils214 stage 1/4. Bring in the build infrastructure (left untied from
[dragonfly.git] / gnu / usr.bin / binutils214 / libbfd / Makefile.i386
1 # $FreeBSD: src/gnu/usr.bin/binutils/libbfd/Makefile.i386,v 1.8.2.2 2002/09/01 23:39:15 obrien Exp $
2 # $DragonFly: src/gnu/usr.bin/binutils214/libbfd/Attic/Makefile.i386,v 1.1 2004/02/01 08:53:04 dillon Exp $
3
4 # see main Makefile
5 SRCS+=  cpu-i386.c 
6 SRCS+=  elf32-i386-fbsd.c elf32-target.h elf32.c elflink.c
7 SRCS+=  elf64-amd64-fbsd.c elf64-target.h elf64-gen.c elf64.c
8 VECS+=  bfd_elf32_i386_vec
9 VECS+=  bfd_elf64_x86_64_vec
10 .if ${TARGET_ARCH} == "i386"
11 CFLAGS+= -DDEFAULT_VECTOR=bfd_elf32_i386_vec
12 .endif
13 CFLAGS+= -DHAVE_bfd_elf32_i386_vec
14
15 .if     defined(BINUTILSDISTDIR) && exists(${BINUTILSDISTDIR})
16 SRCS+=  pe-i386.c pei-i386.c
17 VECS+=  i386pe_vec i386pei_vec
18 CFLAGS+= -DHAVE_i386pe_vec -DHAVE_i386pei_vec
19 .endif
20
21 CLEANFILES+=    elf32-target.h
22
23 elf32-target.h: elfxx-target.h
24         sed -e s/NN/32/g ${.ALLSRC} > ${.TARGET}
25
26 CLEANFILES+=    elf64-target.h
27
28 elf64-target.h: elfxx-target.h
29         sed -e s/NN/64/g ${.ALLSRC} > ${.TARGET}
30
31 CLEANFILES+=    elf64-amd64-fbsd.c
32
33 # Make sure generated binaries are properly branded.  This is kind of a
34 # hack but it's more dependable to override whatever binutils thought it
35 # was going to do then figure out whether binutils supports us natively.
36 #
37 elf32-i386-fbsd.c: ${.CURDIR}/elf-fbsd-brand.c ${SRCDIR}/bfd/elf32-i386.c
38         cat ${.ALLSRC:M*elf-fbsd-brand.c} > ${.TARGET}.new
39         echo "#define elf_backend_post_process_headers elf_fbsd_post_process_headers" \
40             >> ${.TARGET}.new
41         cat ${.ALLSRC:M*elf32-i386.c} >> ${.TARGET}.new
42         mv -f ${.TARGET}.new ${.TARGET}
43
44 elf64-amd64-fbsd.c: ${.CURDIR}/elf-fbsd-brand.c ${SRCDIR}/bfd/elf64-x86-64.c
45         cat ${.ALLSRC:M*elf-fbsd-brand.c} > ${.TARGET}.new
46         echo "#define elf_backend_post_process_headers elf_fbsd_post_process_headers" \
47             >> ${.TARGET}.new
48         cat ${.ALLSRC:M*elf64-x86-64.c} >> ${.TARGET}.new
49         mv -f ${.TARGET}.new ${.TARGET}