2 # $NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp $
4 # Shell script for generating all the constants needed for a native
5 # platform build of src/external/gpl3/binutils
13 _VPATH
=`grep VPATH ${_TMPDIR}/Makefile | sed 's,^.*=[ ]*,,'`
15 .
$_TOP/tools
/gcc
/mknative.common
17 ##### external/gpl3/binutils/lib/libbfd #####
20 mkdir
-p $_TOP/external
/gpl
3/binutils
/lib
/libbfd
/arch
/$MACHINE_ARCH
23 getvars bfd
/Makefile \
24 libbfd_la_DEPENDENCIES libbfd_la_OBJECTS DEFS \
26 } | write_mk external
/gpl
3/binutils
/lib
/libbfd
/arch
/$MACHINE_ARCH/defs.mk
28 write_c external
/gpl
3/binutils
/lib
/libbfd
/arch
/$MACHINE_ARCH/bfd.h
<$_TMPDIR/bfd
/bfd.h
29 write_c external
/gpl
3/binutils
/lib
/libbfd
/arch
/$MACHINE_ARCH/bfdver.h
<$_TMPDIR/bfd
/bfdver.h
30 write_c external
/gpl
3/binutils
/lib
/libbfd
/arch
/$MACHINE_ARCH/bfd_stdint.h
<$_TMPDIR/bfd
/bfd_stdint.h
33 cat $_TMPDIR/bfd
/config.h
34 } | write_c external
/gpl
3/binutils
/lib
/libbfd
/arch
/$MACHINE_ARCH/config.h
37 ##### external/gpl3/binutils/lib/libopcodes #####
40 mkdir
-p $_TOP/external
/gpl
3/binutils
/lib
/libopcodes
/arch
/$MACHINE_ARCH
43 getvars opcodes
/Makefile \
44 archdefs BFD_MACHINES libopcodes_la_SOURCES
45 } | write_mk external
/gpl
3/binutils
/lib
/libopcodes
/arch
/$MACHINE_ARCH/defs.mk
48 cat $_TMPDIR/opcodes
/config.h
49 } | write_c external
/gpl
3/binutils
/lib
/libopcodes
/arch
/$MACHINE_ARCH/config.h
52 ##### external/gpl3/binutils/lib/libiberty #####
55 mkdir
-p $_TOP/external
/gpl
3/binutils
/lib
/libiberty
/arch
/$MACHINE_ARCH
57 getvars libiberty
/Makefile \
58 ALLOCA EXTRA_OFILES LIBOBJS REQUIRED_OFILES \
59 | write_mk external
/gpl
3/binutils
/lib
/libiberty
/arch
/$MACHINE_ARCH/defs.mk
61 write_c external
/gpl
3/binutils
/lib
/libiberty
/arch
/$MACHINE_ARCH/config.h \
62 <$_TMPDIR/libiberty
/config.h
65 ##### external/gpl3/binutils/usr.bin #####
70 mkdir
-p $_TOP/external
/gpl
3/binutils
/usr.bin
/common
/arch
/$MACHINE_ARCH
73 getvars binutils
/Makefile \
74 VERSION DEFS INCLUDES PROGRAMS
75 getvars binutils
/doc
/Makefile \
77 getvars bfd
/doc
/Makefile \
78 PKGVERSION |
sed 's,\\\(.\),\1,'
79 getvars bfd
/doc
/Makefile \
82 for f
in `getvars binutils/Makefile PROGRAMS | sed 'y,-,_,;s,^[^=]*=,,'`; do
83 getvars binutils
/Makefile
${f}_OBJECTS
${f}_DEPENDENCIES
85 } | write_mk external
/gpl
3/binutils
/usr.bin
/common
/arch
/$MACHINE_ARCH/defs.mk
87 write_c external
/gpl
3/binutils
/usr.bin
/common
/arch
/$MACHINE_ARCH/config.h \
88 <$_TMPDIR/binutils
/config.h
92 mkdir
-p $_TOP/external
/gpl
3/binutils
/usr.bin
/gas
/arch
/$MACHINE_ARCH
94 grep -v DEPDIR
"$_TMPDIR/gas/Makefile" > "$_TMPDIR/gas/Makefile.nodeps"
95 getvars gas
/Makefile.nodeps \
96 DEFS INCLUDES as_new_OBJECTS as_new_LDADD |
97 sed -e s
/G_as_new_OBJECTS
/G_OBJS
/ \
98 -e s
/G_as_new_LDADD
=/G_OBJS
+=/ \
100 write_mk external
/gpl
3/binutils
/usr.bin
/gas
/arch
/$MACHINE_ARCH/defs.mk
102 for f
in config itbl-cpu obj-format targ-cpu targ-env
; do
103 write_c external
/gpl
3/binutils
/usr.bin
/gas
/arch
/$MACHINE_ARCH/$f.h
<$_TMPDIR/gas
/$f.h
108 mkdir
-p $_TOP/external
/gpl
3/binutils
/usr.bin
/gprof
/arch
/$MACHINE_ARCH
110 getvars gprof
/Makefile \
111 DEFS gprof_OBJECTS INCLUDES TEXINFOS \
112 | write_mk external
/gpl
3/binutils
/usr.bin
/gprof
/arch
/$MACHINE_ARCH/defs.mk
114 write_c external
/gpl
3/binutils
/usr.bin
/gprof
/arch
/$MACHINE_ARCH/gconfig.h
<$_TMPDIR/gprof
/gconfig.h
118 mkdir
-p $_TOP/external
/gpl
3/binutils
/usr.bin
/ld
/arch
/$MACHINE_ARCH
121 getvars ld
/Makefile \
122 DEFS EMUL EMULATION_OFILES INCLUDES OFILES STRINGIFY TEXINFOS
123 getvars ld
/Makefile \
124 target_alias |
sed 's,[\._0-9A-Z]*$,,'
125 getvars ld
/Makefile \
126 enable_initfini_array
127 } | write_mk external
/gpl
3/binutils
/usr.bin
/ld
/arch
/$MACHINE_ARCH/defs.mk
129 for f
in config ldemul-list
; do
130 write_c external
/gpl
3/binutils
/usr.bin
/ld
/arch
/$MACHINE_ARCH/$f.h
<$_TMPDIR/ld
/$f.h
137 all|binutils
) # everything (uses "canadian cross" temp environment)
145 *) echo invalid arguments
; exit 1;;