2 # $NetBSD: mknative-binutils,v 1.6 2009/11/08 15:33:29 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 getvars gas
/Makefile \
96 | write_mk external
/gpl
3/binutils
/usr.bin
/gas
/arch
/$MACHINE_ARCH/defs.mk
98 for f
in config itbl-cpu obj-format targ-cpu targ-env
; do
99 write_c external
/gpl
3/binutils
/usr.bin
/gas
/arch
/$MACHINE_ARCH/$f.h
<$_TMPDIR/gas
/$f.h
104 mkdir
-p $_TOP/external
/gpl
3/binutils
/usr.bin
/gprof
/arch
/$MACHINE_ARCH
106 getvars gprof
/Makefile \
107 DEFS gprof_OBJECTS INCLUDES TEXINFOS \
108 | write_mk external
/gpl
3/binutils
/usr.bin
/gprof
/arch
/$MACHINE_ARCH/defs.mk
110 write_c external
/gpl
3/binutils
/usr.bin
/gprof
/arch
/$MACHINE_ARCH/gconfig.h
<$_TMPDIR/gprof
/gconfig.h
114 mkdir
-p $_TOP/external
/gpl
3/binutils
/usr.bin
/ld
/arch
/$MACHINE_ARCH
117 getvars ld
/Makefile \
118 DEFS EMUL EMULATION_OFILES INCLUDES OFILES STRINGIFY TEXINFOS
119 getvars ld
/Makefile \
120 target_alias |
sed 's,[\._0-9A-Z]*$,,'
121 } | write_mk external
/gpl
3/binutils
/usr.bin
/ld
/arch
/$MACHINE_ARCH/defs.mk
123 for f
in config ldemul-list
; do
124 write_c external
/gpl
3/binutils
/usr.bin
/ld
/arch
/$MACHINE_ARCH/$f.h
<$_TMPDIR/ld
/$f.h
131 all|binutils
) # everything (uses "canadian cross" temp environment)
139 *) echo invalid arguments
; exit 1;;