ea7318a9fd397ff3272d4787d94e791d51e14341
[deliverable/binutils-gdb.git] / sim / ppc / build-psim
1 #!/bin/sh
2
3 case "`uname -s`-`uname -r`" in
4 NetBSD* )
5 cflags="-Wall -Wno-unused -Wmissing-prototypes -Werror"
6 ;;
7 SunOS-5* )
8 cflags="-gstabs+"
9 ;;
10 SunOS-4* )
11 cflags="-Werror"
12 ;;
13 esac
14
15 for target in "$@"
16 do
17
18 echo ""
19 echo "$target"
20 echo ""
21
22 if [ $# -gt 1 ]
23 then
24 make clean
25 fi
26
27 case $target in
28 *unsafe* )
29 with_trace="-DWITH_TRACE=0"
30 with_assert="-DWITH_ASSERT=0"
31 unsafe_flags="-g0 -fomit-frame-pointer -fno-strength-reduce"
32 ;;
33 *safe* )
34 with_trace=
35 with_assert=
36 unsafe_flags="-g0"
37 ;;
38 * )
39 with_trace=
40 with_assert=
41 unsafe_flags=
42 ;;
43 esac
44
45 case $target in
46 *little* )
47 with_target_byte_order="-DWITH_TARGET_BYTE_ORDER=LITTLE_ENDIAN"
48 ;;
49 *big* )
50 with_target_byte_order="-DWITH_TARGET_BYTE_ORDER=BIG_ENDIAN"
51 ;;
52 * )
53 with_target_byte_order=
54 ;;
55 esac
56
57 case $target in
58 *vea* )
59 with_environment="-DWITH_ENVIRONMENT=VIRTUAL_ENVIRONMENT"
60 with_smp="-DWITH_SMP=0"
61 ;;
62 *oea* )
63 with_environment="-DWITH_ENVIRONMENT=OPERATING_ENVIRONMENT"
64 with_smp="-DWITH_SMP=2"
65 ;;
66 * )
67 with_environment=
68 with_smp=
69 ;;
70 esac
71
72 case $target in
73 *complex* )
74 igen_opcode_rules="IGEN_OPCODE_RULES=ppc-opcode-complex"
75 igen_flags="-e -r 1024"
76 opt_flags="-O2"
77 ;;
78 *simple* )
79 igen_opcode_rules="IGEN_OPCODE_RULES=ppc-opcode-simple"
80 igen_flags="-e"
81 opt_flags="-O2"
82 ;;
83 * )
84 igen_opcode_rules=
85 igen_flags=
86 opt_flags=
87 ;;
88 esac
89
90 case $target in
91 *64* )
92 with_target_word_bitsize="-DWITH_TARGET_WORD_BITSIZE=64"
93 igen_flags="$igen_flags -f 32"
94 ;;
95 *32* )
96 with_target_word_bitsize="-DWITH_TARGET_WORD_BITSIZE=32"
97 igen_flags="$igen_flags -f 64"
98 ;;
99 * )
100 with_target_word_bitsize=
101 igen_flags="$igen_flags -f 64"
102 ;;
103 esac
104
105 case $target in
106 *inline* )
107 default_inline="-DDEFAULT_INLINE=2"
108 ;;
109 * )
110 default_inline=
111 ;;
112 esac
113
114 case $target in
115 *nomon* )
116 with_mon="-DWITH_MON=0"
117 ;;
118 * )
119 with_mon=
120 ;;
121 esac
122
123 case $target in
124 *bswap* )
125 with_bswap="-DWITH_BSWAP=1"
126 ;;
127 * )
128 with_bswap=
129 ;;
130 esac
131
132 if ( set -x ; make \
133 $igen_opcode_rules \
134 IGEN_FLAGS="$igen_flags" \
135 INLINE_CFLAGS=" \
136 $cflags \
137 $unsafe_flags \
138 $opt_flags \
139 $with_bswap \
140 $with_target_byte_order \
141 $with_environment \
142 $with_smp \
143 $default_inline \
144 $with_target_word_bitsize \
145 $with_trace \
146 $with_assert \
147 $with_mon \
148 " )
149 then
150 rm -f psim-${target}-failed
151 ( set -x ; cp psim psim-$target )
152 else
153 ( set -x ; touch psim-${target}-failed )
154 fi
155 done
This page took 0.031596 seconds and 3 git commands to generate.