1
0
Files
irix-657m-src/eoe/cmd/ksh/install/readonly
2022-09-29 17:59:04 +03:00

28 lines
641 B
Plaintext
Executable File

: "Make readonly data into text for sharing"
error=0 CC=${CC-cc}
flags=
while test '' != "$1"
do case $1 in
-*) flags="$flags $1";;
*) break;;
esac
shift
done
for i in "$@"
do x=`basename "$i" .c`
${CC} $flags -S "$i"
sed -e 's/^\([ ]*\.*\)data/\1text/
s/\([^:][ ]*\.*\)zero[ ][ ]*/\1set .,.+/
s/\([^:][ ]*\.*\)space[ ][ ]*4/\1byte 0,0,0,0/
s/\([^:][ ]*\.*\)space[ ][ ]*3/\1byte 0,0,0/
s/\([^:][ ]*\.*\)space[ ][ ]*2/\1byte 0,0/
s/\([^:][ ]*\.*\)space[ ][ ]*1/\1byte 0/' "$x.s" > data$$.s
mv data$$.s "$x.s"
if ${CC} -c "$x.s"
then rm -f "$x.s"
else error=1
${CC} ${flags} -c "$i"
fi
done
exit $error