!! WARNING !!
This has been tested and works for me.. I can't guarantee it works for you. Use on own risk!
!! END OF WARNING !!
Finally got my N64 build environment up and running some day ago
And noticed that my PSYQ libs wasn't up to date. So I wrote this crappy bash script to convert all ELF o/a files to PSYQ obj/lib and then I thought maybe someone else could use it too :shrug:
save to ConvToPSYQ.sh:
Usage (crapy guide):
* You will need something like MinGW/MSYS or Cygwin to run.
* You need the PSYQ toolchain (duh)
* You need the search path to the psyq bin location in your PATH environment variable.
1. Make a copy of your lib folder. !! Needed as this script WILL delete the o/a files after converting them. !!
2. Put ConvToPSYQ.sh in this new folder.
3. Open up MSYS and go to this folder.
4. run the script.
5. Wait...
6. If you got anymore files to convert, like the .o files in the "PR" dir. Move ConvToPSYQ.sh there and repeat step 4-5
6. Done
ex:
# cd c:/ultra/newlib [ENTER]
# ConvToPSYQ.sh [ENTER]
...
# mv ConvToPSYQ.sh PR/ConvToPSYQ.sh
# ConvToPSYQ.sh [ENTER]
...
This has been tested and works for me.. I can't guarantee it works for you. Use on own risk!
!! END OF WARNING !!
Finally got my N64 build environment up and running some day ago

And noticed that my PSYQ libs wasn't up to date. So I wrote this crappy bash script to convert all ELF o/a files to PSYQ obj/lib and then I thought maybe someone else could use it too :shrug:
save to ConvToPSYQ.sh:
Code:
#!/bin/sh
# Converts o to obj and a to lib
# Convert any archived o files.
ConvArchive()
{
ls *.a|while read archiv; do
# Create a working folder for current archive.
dirnam=$archiv"_dir"
mkdir $dirnam
# Extract archive and delete.
mv $archiv $dirnam"/"$archiv
cd $dirnam
ar x $archiv
rm -f $archiv
# Set new filename.
archiv=${archiv%.a}.lib
# Convert archived o files.
ls *.o|while read fil; do
elfconv $fil
rm -f $fil
fil=${fil%.o}.obj
psylib2 -a $archiv $fil
rm -f $fil
done
# Move to correct folder.
mv $archiv ../$archiv
# Proccess next archive.
cd ..
rm -f -r $dirnam
done
}
# Convert any standalone o files.
ls *.o|while read fil; do
elfconv $fil
rm $fil
done
# Convert archives.
ConvArchive
exit 0
* You will need something like MinGW/MSYS or Cygwin to run.
* You need the PSYQ toolchain (duh)
* You need the search path to the psyq bin location in your PATH environment variable.
1. Make a copy of your lib folder. !! Needed as this script WILL delete the o/a files after converting them. !!
2. Put ConvToPSYQ.sh in this new folder.
3. Open up MSYS and go to this folder.
4. run the script.
5. Wait...
6. If you got anymore files to convert, like the .o files in the "PR" dir. Move ConvToPSYQ.sh there and repeat step 4-5

6. Done
ex:
# cd c:/ultra/newlib [ENTER]
# ConvToPSYQ.sh [ENTER]
...
# mv ConvToPSYQ.sh PR/ConvToPSYQ.sh
# ConvToPSYQ.sh [ENTER]
...