release.sh 3.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #! /bin/bash
  2. #
  3. # picodrive release build script
  4. #
  5. # creates builds for the supported platforms in the release directory
  6. #
  7. # usage: release.sh <version>
  8. #
  9. # expects toolchains to be installed in $HOME/opt:
  10. # gph: arm-open2x-linux
  11. # needs additional libpng, ATM in src/gp2x/armroot/lib
  12. # dingux: opendingux-toolchain (the old 2012 version)
  13. # retrofw: mipsel-linux-uclibc (the retrofw toolchain)
  14. # gcw0: gcw0-toolchain
  15. # rg350: rg350-toolchain (+ mips-toolchain for newer gcc)
  16. # psp: pspdev
  17. mkdir -p release-$1
  18. trap "exit" ERR
  19. # GPH devices: gp2x, wiz, caanoo, with ubuntu arm gcc 4.7
  20. # note that -msoft-float has a changed float ABI with gcc >= 4.8...
  21. TC=$HOME/opt/open2x/gcc-4.1.1-glibc-2.3.6 CROSS_COMPILE=arm-linux-gnueabi- CFLAGS="-I$TC/arm-open2x-linux/include -I$HOME/src/gp2x/armroot/include -U_FORTIFY_SOURCE" LDFLAGS="-B$TC/lib/gcc/arm-open2x-linux/4.1.1 -B$TC/arm-open2x-linux/lib -L$TC/arm-open2x-linux/lib -L$HOME/src/gp2x/armroot/lib" ./configure --platform=gp2x
  22. make clean all
  23. make -C platform/gp2x rel VER=$1
  24. mv PicoDrive_$1.zip release-$1/PicoDrive-gph_$1.zip
  25. # dingux: dingoo a320, ritmix rzx-50, JZ4755 or older (mips32r1 w/o fpu)
  26. # NB works for legacy dingux and possibly opendingux before gcw0
  27. TC=$HOME/opt/opendingux-toolchain PATH=$TC/usr/bin:$PATH CROSS_COMPILE=mipsel-linux- CFLAGS="-I $TC/usr/include -I $TC/usr/include/SDL -Wno-unused-result -mabicalls" LDFLAGS="--sysroot $TC" ./configure --platform=dingux
  28. TC=$HOME/opt/opendingux-toolchain PATH=$TC/usr/bin:$PATH make clean all
  29. mv PicoDrive-dge.zip release-$1/PicoDrive-dge_$1.zip
  30. # retrofw: rs-97 and similar, JZ4760 (mips32r1 with fpu)
  31. TC=$HOME/opt/mipsel-linux-uclibc PATH=$TC/bin:$PATH CROSS_COMPILE=mipsel-linux- CFLAGS="-I $TC/include -I $TC/include/SDL -Wno-unused-result" LDFLAGS="--sysroot $TC/mipsel-buildroot-linux-uclibc/sysroot" ./configure --platform=retrofw
  32. TC=$HOME/opt/mipsel-linux-uclibc PATH=$TC/bin:$PATH make clean all
  33. mv PicoDrive.opk release-$1/PicoDrive-retrofw_$1.opk
  34. # gcw0: JZ4770 (mips32r2 with fpu), swapped X/Y buttons, SDK toolchain
  35. #TC=$HOME/opt/gcw0-toolchain PATH=$TC/usr/bin:$PATH CROSS_COMPILE=mipsel-linux- TS=$TC/usr/mipsel-gcw0-linux-uclibc/sysroot CFLAGS="-I$TS/usr/include -I$TS/usr/include/SDL" LDFLAGS="--sysroot $TS" ./configure --platform=gcw0
  36. #TC=$HOME/opt/gcw0-toolchain PATH=$TC/usr/bin:$PATH make clean all
  37. # gcw0: JZ4770 (mips32r2 with fpu), swapped X/Y buttons, newer generic gcc
  38. TC=$HOME/opt/gcw0-toolchain PATH=$HOME/opt/mips-toolchain/bin:$PATH CROSS_COMPILE=mipsel-linux- TS=$TC/usr/mipsel-gcw0-linux-uclibc/sysroot CFLAGS="-I$TS/usr/include -I$TS/usr/include/SDL -mabicalls" LDFLAGS="--sysroot $TS -Wl,--dynamic-linker=/lib/ld-uClibc.so.0" ./configure --platform=gcw0
  39. PATH=$HOME/opt/mips-toolchain/usr/bin:$PATH make clean all
  40. mv PicoDrive.opk release-$1/PicoDrive-gcw0_$1.opk
  41. # rg350: JZ4770, SDK toolchain
  42. #TC=$HOME/opt/rg350-toolchain PATH=$TC/usr/bin:$PATH CROSS_COMPILE=mipsel-linux- TS=$TC/usr/mipsel-gcw0-linux-uclibc/sysroot CFLAGS="-I$TS/usr/include -I$TS/usr/include/SDL" LDFLAGS="--sysroot $TS" ./configure --platform=rg350
  43. #TC=$HOME/opt/rg350-toolchain PATH=$TC/usr/bin:$PATH make clean all
  44. # rg350, gkd350h etc: JZ4770 or newer, newer generic gcc
  45. # NB this may or may not work on the newer opendingux beta
  46. TC=$HOME/opt/rg350-toolchain PATH=$HOME/opt/mips-toolchain/bin:$PATH CROSS_COMPILE=mipsel-linux- TS=$TC/usr/mipsel-gcw0-linux-uclibc/sysroot CFLAGS="-I$TS/usr/include -I$TS/usr/include/SDL -mabicalls" LDFLAGS="--sysroot $TS -Wl,--dynamic-linker=/lib/ld-uClibc.so.0" ./configure --platform=opendingux
  47. PATH=$HOME/opt/mips-toolchain/usr/bin:$PATH make clean all
  48. mv PicoDrive.opk release-$1/PicoDrive-opendingux_$1.opk
  49. # psp (experimental), pspdev SDK toolchain
  50. TC=$HOME/opt/pspdev PATH=$TC/bin:$PATH CROSS_COMPILE=psp- CFLAGS="-I$TC/psp/sdk/include -D_POSIX_C_SOURCE=199506L" LDFLAGS="-L$TC/psp/sdk/lib" ./configure --platform=psp
  51. TC=$HOME/opt/pspdev PATH=$TC/bin:$PATH make clean all
  52. make -C platform/psp rel VER=$1
  53. mv PicoDrive_psp_$1.zip release-$1/PicoDrive-psp_$1.zip