ld-225: fix ldscripts (allows binutils 2.25 to build world)
[dragonfly.git] / gnu / usr.bin / binutils225 / block2 / ld / Makefile.x86_64
1 TARGET_TUPLE?=  x86_64-just-dragonfly
2
3 NATIVE_EMULATION=       elf_x86_64
4 X86_EMULATION=          elf_i386
5 L1OM_EMULATION=         elf_l1om
6 K1OM_EMULATION=         elf_k1om
7 HOST=                   ${TARGET_TUPLE}
8 FLAGS_GROUPS=           emul
9 emul_FLAGS=             -DDEFAULT_EMULATION=\"${NATIVE_EMULATION}\" \
10                         -DTARGET=\"${TARGET_TUPLE}\"
11 emul_FLAGS_FILES=       ldmain.c
12
13 _x86_64_path=   ${USRDATA_PREFIX}/lib:${USRDATA_PREFIX}/usr/lib
14 _i386_path=     ${USRDATA_PREFIX}/lib/i386:${USRDATA_PREFIX}/usr/lib/i386
15
16 .for EMUL in ${NATIVE_EMULATION} ${X86_EMULATION} ${L1OM_EMULATION} ${K1OM_EMULATION}
17 EMS+=                   ${EMUL}
18 SRCS+=                  e${EMUL}.c
19 CLEANFILES+=            e${EMUL}.c
20 . for ext in ${ELF_SCR_EXT}
21 LDSCRIPTS_${EMUL}+=     ${EMUL}.${ext}
22 . endfor
23 LDSCRIPTS+=             ${LDSCRIPTS_${EMUL}}
24 .endfor
25
26 e${NATIVE_EMULATION}.c ${LDSCRIPTS_${NATIVE_EMULATION}}: \
27     emulparams/${NATIVE_EMULATION}.sh emultempl/elf32.em \
28     scripttempl/elf.sc genscripts.sh stringify.sed
29         sh ${SRCDIR}/ld/genscripts.sh \
30                 ${SRCDIR:Q}/ld \
31                 ${_x86_64_path:Q} \
32                 "" \
33                 "" \
34                 ${HOST} \
35                 ${TARGET_TUPLE:Q} \
36                 ${TARGET_TUPLE:Q} \
37                 ${NATIVE_EMULATION:Q} \
38                 "" \
39                 no \
40                 yes \
41                 ${NATIVE_EMULATION:Q} \
42                 ${TARGET_TUPLE:Q}
43
44 e${X86_EMULATION}.c ${LDSCRIPTS_${X86_EMULATION}}: \
45     emulparams/${X86_EMULATION}.sh emultempl/elf32.em \
46     scripttempl/elf.sc genscripts.sh stringify.sed
47         sh ${SRCDIR}/ld/genscripts.sh \
48                 ${SRCDIR:Q}/ld \
49                 ${_i386_path:Q} \
50                 "" \
51                 "" \
52                 ${HOST} \
53                 ${TARGET_TUPLE:Q} \
54                 ${TARGET_TUPLE:Q} \
55                 ${X86_EMULATION:Q} \
56                 "" \
57                 no \
58                 yes \
59                 ${X86_EMULATION:Q} \
60                 ${TARGET_TUPLE:Q}
61
62 e${L1OM_EMULATION}.c ${LDSCRIPTS_${L1OM_EMULATION}}: \
63     emulparams/${L1OM_EMULATION}.sh emultempl/elf32.em \
64     scripttempl/elf.sc genscripts.sh stringify.sed
65         sh ${SRCDIR}/ld/genscripts.sh \
66                 ${SRCDIR:Q}/ld \
67                 ${_x86_64_path:Q} \
68                 "" \
69                 "" \
70                 ${HOST} \
71                 ${TARGET_TUPLE:Q} \
72                 ${TARGET_TUPLE:Q} \
73                 ${L1OM_EMULATION:Q} \
74                 "" \
75                 no \
76                 yes \
77                 ${L1OM_EMULATION:Q} \
78                 ${TARGET_TUPLE:Q}
79
80 e${K1OM_EMULATION}.c ${LDSCRIPTS_${K1OM_EMULATION}}: \
81     emulparams/${K1OM_EMULATION}.sh emultempl/elf32.em \
82     scripttempl/elf.sc genscripts.sh stringify.sed
83         sh ${SRCDIR}/ld/genscripts.sh \
84                 ${SRCDIR:Q}/ld \
85                 ${_x86_64_path:Q} \
86                 "" \
87                 "" \
88                 ${HOST} \
89                 ${TARGET_TUPLE:Q} \
90                 ${TARGET_TUPLE:Q} \
91                 ${K1OM_EMULATION:Q} \
92                 "" \
93                 no \
94                 yes \
95                 ${K1OM_EMULATION:Q} \
96                 ${TARGET_TUPLE:Q}