2 # $NetBSD: mknative-gdb,v 1.1 2006/05/29 19:10:58 nathanw Exp $
4 # Shell script for generating all the constants needed for a native
5 # platform build of src/gnu/dist/gdb6.
13 _VPATH
=`grep VPATH ${_TMPDIR}/Makefile | sed 's,^.*=[ ]*,,'`
15 .
$_TOP/tools
/gcc
/mknative.common
17 ##### gnu/usr.bin/gdb6/bfd #####
20 mkdir
-p $_TOP/gnu
/usr.bin
/gdb
6/bfd
/arch
/$MACHINE_ARCH
23 getvars bfd
/Makefile \
24 libbfd_la_DEPENDENCIES libbfd_la_OBJECTS DEFS \
26 } | write_mk gnu
/usr.bin
/gdb
6/bfd
/arch
/$MACHINE_ARCH/defs.mk
28 write_c gnu
/usr.bin
/gdb
6/bfd
/arch
/$MACHINE_ARCH/bfd.h
<$_TMPDIR/bfd
/bfd.h
29 write_c gnu
/usr.bin
/gdb
6/bfd
/arch
/$MACHINE_ARCH/bfdver.h
<$_TMPDIR/bfd
/bfdver.h
32 cat $_TMPDIR/bfd
/config.h
33 } | write_c gnu
/usr.bin
/gdb
6/bfd
/arch
/$MACHINE_ARCH/config.h
36 ##### gnu/lib/opcodes #####
38 get_gdb_libopcodes
() {
39 mkdir
-p $_TOP/gnu
/usr.bin
/gdb
6/opcodes
/arch
/$MACHINE_ARCH
42 getvars opcodes
/Makefile \
43 archdefs BFD_MACHINES libopcodes_la_SOURCES
44 } | write_mk gnu
/usr.bin
/gdb
6/opcodes
/arch
/$MACHINE_ARCH/defs.mk
47 cat $_TMPDIR/opcodes
/config.h
48 } | write_c gnu
/usr.bin
/gdb
6/opcodes
/arch
/$MACHINE_ARCH/config.h
51 ##### gnu/lib/libiberty #####
53 get_gdb_libiberty
() {
54 mkdir
-p $_TOP/gnu
/usr.bin
/gdb
6/libiberty
/arch
/$MACHINE_ARCH
56 getvars libiberty
/Makefile \
57 ALLOCA EXTRA_OFILES LIBOBJS REQUIRED_OFILES \
58 | write_mk gnu
/usr.bin
/gdb
6/libiberty
/arch
/$MACHINE_ARCH/defs.mk
60 write_c gnu
/usr.bin
/gdb
6/libiberty
/arch
/$MACHINE_ARCH/config.h \
61 <$_TMPDIR/libiberty
/config.h
64 ##### gnu/usr.bin/gdb6/readline #####
66 get_gdb_libreadline
() {
67 mkdir
-p $_TOP/gnu
/usr.bin
/gdb
6/readline
/arch
/$MACHINE_ARCH
70 getvars readline
/Makefile \
72 } | write_mk gnu
/usr.bin
/gdb
6/readline
/arch
/$MACHINE_ARCH/defs.mk
74 write_c gnu
/usr.bin
/gdb
6/readline
/arch
/$MACHINE_ARCH/config.h \
75 <$_TMPDIR/readline
/config.h
78 ##### gnu/usr.bin/gdb6 #####
81 mkdir
-p $_TOP/gnu
/usr.bin
/gdb
6/arch
/$MACHINE_ARCH
84 getvars gdb
/Makefile \
85 INTERNAL_CFLAGS LIBGDB_OBS SIM_OBS
86 } | write_mk gnu
/usr.bin
/gdb
6/arch
/$MACHINE_ARCH/defs.mk
88 # getvars gdb/gdbserver/Makefile \
89 # INTERNAL_CFLAGS OBS \
90 # | write_mk gnu/usr.bin/gdb/arch/$MACHINE_ARCH/gdbserver.mk
92 write_c gnu
/usr.bin
/gdb
6/arch
/$MACHINE_ARCH/config.h \
93 < $_TMPDIR/gdb
/config.h
95 for f
in init version
; do
96 write_c gnu
/usr.bin
/gdb
6/arch
/$MACHINE_ARCH/$f.c
<$_TMPDIR/gdb
/$f.c
100 if [ -f $_TMPDIR/gdb
/$f.h
]; then
101 ls -l $_TMPDIR/gdb
/$f.h |
sed 's,^.*->.*/gdb/,,;s,^,#include <,;s,$,>,' \
102 | write_c gnu
/usr.bin
/gdb
6/arch
/$MACHINE_ARCH/$f.h
106 case $MACHINE_ARCH in
108 mkdir
-p $_TOP/gnu
/usr.bin
/gdb
6/sim
/arch
/$MACHINE_ARCH
109 write_c gnu
/usr.bin
/gdb
6/sim
/arch
/$MACHINE_ARCH/config.h \
110 <$_TMPDIR/sim
/ppc
/config.h
111 write_c gnu
/usr.bin
/gdb
6/sim
/arch
/$MACHINE_ARCH/cconfig.h \
112 <$_TMPDIR/sim
/common
/cconfig.h
115 mkdir
-p $_TOP/gnu
/usr.bin
/gdb
6/sim
/arch
/$MACHINE_ARCH
116 write_c gnu
/usr.bin
/gdb
6/sim
/arch
/$MACHINE_ARCH/config.h \
117 <$_TMPDIR/sim
/mips
/config.h
118 write_c gnu
/usr.bin
/gdb
6/sim
/arch
/$MACHINE_ARCH/cconfig.h \
119 <$_TMPDIR/sim
/common
/cconfig.h
121 getvars sim
/mips
/Makefile \
122 LIB_OBJS CONFIG_CFLAGS \
123 BUILT_SRC_FROM_IGEN IGEN_OBJS
124 } | write_mk gnu
/usr.bin
/gdb
6/sim
/arch
/$MACHINE_ARCH/defs.mk
134 all|gdb
) # everything (uses "canadian cross" temp environment)
143 *) echo invalid arguments
; exit 1;;