40 echo "Unknown option $1"
44 echo "Expecting operation mode as first argument"
53 scriptdir
=`dirname $0`
59 while [ $# -ne 0 ] ; do
93 if [ ! -f "$confdir/lib.conf" ]; then
94 echo "Can't find lib.conf in $confdir"
98 libname
=`grep '^name' "$confdir/lib.conf" | sed 's/^name[^a-zA-Z_]*//'`
99 LIBNAME
=`awk </dev/null 'BEGIN { print toupper("'$libname'"); }'`
103 if [ "x$output" = "x" ]; then
108 out
="$prefix/$outname"
109 $AWK -f "$scriptdir/genlibdefs.awk" lib.conf
> $out.new
110 $scriptdir/moveifchanged
$out.new
$out
113 if [ "x$output" = "x" ]; then
114 outname
="functable.c"
118 out
="$prefix/$outname"
119 $AWK -f "$scriptdir/genfunctable.awk" $srcs > $out.new
120 $scriptdir/moveifchanged
$out.new
$out
123 echo "Regenerating fd files for $libname"
124 if [ "x$output" = "x" ]; then
125 outname
="$libname"_lib.fd
129 if [ -d "$prefix/fd" ]; then
130 out
="$prefix/fd/$outname"
132 out
="$prefix/$outname"
134 $AWK -f "$scriptdir/genfd.awk" $srcs > $out.new
135 $scriptdir/moveifchanged
$out.new
$out
138 echo "Regenerating proto files for $libname"
139 if [ "x$output" = "x" ]; then
144 if [ -d "$prefix/proto" ]; then
145 out
="$prefix/proto/$outname"
147 out
="$prefix/$outname"
149 echo "#ifndef PROTO_"$LIBNAME"_H" > $out.new
150 echo "#define PROTO_"$LIBNAME"_H" >> $out.new
152 echo "/*" >> $out.new
153 echo " Copyright © 1995-2004, The AROS Development Team. All rights reserved." >> $out.new
154 echo " Automatically generated by $0" >> $out.new
155 echo "*/" >> $out.new
157 echo "#ifndef AROS_SYSTEM_H" >> $out.new
158 echo "# include <aros/system.h>" >> $out.new
159 echo "#endif" >> $out.new
161 if [ -f headers.tmpl
]; then
163 $1 == "##begin" && $2 == "proto" { doprint=1; next; }
164 $1 == "##end" && $2 == "proto" { doprint=0; next; }
165 { if (doprint) print; }
166 ' headers.tmpl
>> $out.new
168 echo "#include <clib/"$libname"_protos.h>" >> $out.new
169 echo "#include <defines/"$libname".h>" >> $out.new
171 if [ $hasrt -ne 0 ]; then
172 echo "#if defined(ENABLE_RT) && ENABLE_RT && !defined(ENABLE_RT_"$LIBNAME")" >> $out.new
173 echo "# define ENABLE_RT_"$LIBNAME" 1" >> $out.new
174 echo "# include <aros/rt.h>" >> $out.new
175 echo "#endif" >> $out.new
178 echo "#endif /* PROTO_"$LIBNAME"_H */" >> $out.new
179 $scriptdir/moveifchanged
$out.new
$out
182 echo "Regenerating private proto files for $libname"
183 if [ "x$output" = "x" ]; then
184 outname
="$libname"_private.h
188 if [ -d "$prefix/proto" ]; then
189 out
="$prefix/proto/$outname"
191 out
="$prefix/$outname"
193 echo "#ifndef PROTO_"$LIBNAME"_PRIVATE_H" > $out.new
194 echo "#define PROTO_"$LIBNAME"_PRIVATE_H" >> $out.new
196 echo "/*" >> $out.new
197 echo " Copyright © 1995-2004, The AROS Development Team. All rights reserved." >> $out.new
198 echo " Automatically generated by $0" >> $out.new
199 echo "*/" >> $out.new
201 echo "#ifndef PROTO_"$LIBNAME"_H" >> $out.new
202 echo "# include <proto/"$libname".h>" >> $out.new
203 echo "#endif" >> $out.new
205 echo "#include <clib/"$libname"_private_protos.h>" >> $out.new
206 echo "#include <defines/"$libname"_private.h>" >> $out.new
208 echo "#endif /* PROTO_"$LIBNAME"_PRIVATE_H */" >> $out.new
209 $scriptdir/moveifchanged
$out.new
$out
212 echo "Regenerating defines files for $libname"
213 if [ "x$output" = "x" ]; then
218 if [ -d "$prefix/defines" ]; then
219 out
="$prefix/defines/$outname"
221 out
="$prefix/$outname"
223 $AWK -v file=$libdefsfile -f $scriptdir/gendefines.
awk $srcs > $out.new
224 $scriptdir/moveifchanged
$out.new
$out
227 echo "Regenerating private defines files for $libname"
228 if [ "x$output" = "x" ]; then
229 outname
="$libname"_private.h
233 if [ -d "$prefix/defines" ]; then
234 out
="$prefix/defines/$outname"
236 out
="$prefix/$outname"
238 $AWK -v file=$libdefsfile -f $scriptdir/genpdefines.
awk $srcs > $out.new
239 $scriptdir/moveifchanged
$out.new
$out
242 echo "Regenerating clib files for $libname"
243 if [ "x$output" = "x" ]; then
244 outname
="$libname"_protos.h
248 if [ -d "$prefix/clib" ]; then
249 out
="$prefix/clib/$outname"
251 out
="$prefix/$outname"
253 $AWK -v file=$libdefsfile -f $scriptdir/genclib.
awk $srcs > $out.new
254 $scriptdir/moveifchanged
$out.new
$out
257 echo "Regenerating private clib files for $libname"
258 if [ "x$output" = "x" ]; then
259 outname
="$libname"_private_protos.h
263 if [ -d "$prefix/clib" ]; then
264 out
="$prefix/clib/$outname"
266 out
="$prefix/$outname"
268 $AWK -v file=$libdefsfile -f $scriptdir/genpclib.
awk $srcs > $out.new
269 $scriptdir/moveifchanged
$out.new
$out
275 echo "Regenerating inline for $libname"
276 if [ "x$output" = "x" ]; then
281 if [ -d "$prefix/inline" ]; then
282 out
="$prefix/inline/$outname"
284 out
="$prefix/$outname"
286 $AWK -v file=$libdefsfile -f $scriptdir/geninline.
awk $srcs > $out.new
287 $scriptdir/moveifchanged
$out.new
$out