-
Notifications
You must be signed in to change notification settings - Fork 0
/
unix-zip
executable file
·32 lines (24 loc) · 968 Bytes
/
unix-zip
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# /bin/bash
# Convert zip command line and inc file from RISC OS format to unix format
# and run GCCSDK_INSTALL_ENV zip on it
if [ "$GCCSDK_INSTALL_ENV" == "" ] ; then
echo "GCCSDK_INSTALL_ENV is not defined"
exit 1
fi
# Convert RISC OS file names to unix format and use autobuilder cross zip
ZIPCMD=`echo "$GCCSDK_INSTALL_ENV/bin/zip -, $*" | sed -e"s:\.:/:g" -e"s:\^:..:g" -e"s:/inc:-cross\.inc:" -e"s:\([0-9]\)/:\1\.:g"`
# Parse out include file name
INCFILE=`echo "${@: -1}" | sed -e"s:\.:/:g" -e"s:-i@::" -e"s:/inc::" -e"s:\^:..:"`
# Create unix format include file
sed -e"s:\.:/:g" -e"s:/a$:.a:" $INCFILE.inc > $INCFILE-cross.inc
# Process files to turn *.h to RISC OS format h/*
for file in $(find) ; do
if echo $file | grep "\.h$" > /dev/null ; then
filename=$(basename $file | sed s#\.h\$##)
dirname=$(echo $file | sed s#/$filename\.h\$##)
mkdir -p $dirname/h
mv $file $dirname/h/$filename
fi
done
# Do the zip
$ZIPCMD