annotate build_release @ 974:fd7702bcc034

FindFirstFile makes more sense for getting modification times of a path than using CreateFile and GetFileTimes
author Michael Pavone <pavone@retrodev.com>
date Fri, 22 Apr 2016 19:18:15 -0700
parents 574495372d1c
children 4cbc349a82a9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
806
2dfcd20a00b6 Added script for building and packaging releases
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1 #!/bin/sh
2dfcd20a00b6 Added script for building and packaging releases
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
2
2dfcd20a00b6 Added script for building and packaging releases
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3 set -e
2dfcd20a00b6 Added script for building and packaging releases
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4
2dfcd20a00b6 Added script for building and packaging releases
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5 if [ -z "$OS" ]; then
2dfcd20a00b6 Added script for building and packaging releases
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
6 OS=`uname -s`
2dfcd20a00b6 Added script for building and packaging releases
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7 fi
2dfcd20a00b6 Added script for building and packaging releases
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
8
2dfcd20a00b6 Added script for building and packaging releases
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
9 if [ $OS = "Linux" ]; then
2dfcd20a00b6 Added script for building and packaging releases
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
10 cd sdl
2dfcd20a00b6 Added script for building and packaging releases
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
11 ./configure
2dfcd20a00b6 Added script for building and packaging releases
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
12 make clean all
2dfcd20a00b6 Added script for building and packaging releases
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
13 cd ..
2dfcd20a00b6 Added script for building and packaging releases
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
14 rm -rf lib
2dfcd20a00b6 Added script for building and packaging releases
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
15 mkdir lib
2dfcd20a00b6 Added script for building and packaging releases
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
16 cp sdl/build/.libs/libSDL2-*.so.*.*.* lib
2dfcd20a00b6 Added script for building and packaging releases
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
17 sdl=`ls lib`
2dfcd20a00b6 Added script for building and packaging releases
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
18 link=`echo $sdl | sed -E 's/(so\.[0-9]*).*/\1/'`
2dfcd20a00b6 Added script for building and packaging releases
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
19 cd lib
2dfcd20a00b6 Added script for building and packaging releases
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
20 ln -s "$sdl" "$link"
2dfcd20a00b6 Added script for building and packaging releases
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
21 ln -s "$sdl" libSDL2.so
2dfcd20a00b6 Added script for building and packaging releases
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
22 cd ..
811
b1a09ef90755 Do a clean build of glew from release script
Michael Pavone <pavone@retrodev.com>
parents: 806
diff changeset
23 cd glew
b1a09ef90755 Do a clean build of glew from release script
Michael Pavone <pavone@retrodev.com>
parents: 806
diff changeset
24 make clean all
b1a09ef90755 Do a clean build of glew from release script
Michael Pavone <pavone@retrodev.com>
parents: 806
diff changeset
25 cd ..
806
2dfcd20a00b6 Added script for building and packaging releases
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
26 fi
2dfcd20a00b6 Added script for building and packaging releases
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
27
2dfcd20a00b6 Added script for building and packaging releases
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
28 make PORTABLE=1 clean all
2dfcd20a00b6 Added script for building and packaging releases
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
29 if [ $OS = "Windows" ]; then
2dfcd20a00b6 Added script for building and packaging releases
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
30 binaries="dis.exe zdis.exe stateview.exe vgmplay.exe blastem.exe SDL2.dll"
2dfcd20a00b6 Added script for building and packaging releases
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
31 cmd="wine blastem.exe"
2dfcd20a00b6 Added script for building and packaging releases
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
32 txt=".txt"
2dfcd20a00b6 Added script for building and packaging releases
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
33 else
812
574495372d1c Finish OS X support in build_release script. Fix a name conflict in vgmplay on OS X. Call set_exe_str in vgmplay and stateview
Michael Pavone <pavone@retrodev.com>
parents: 811
diff changeset
34 if [ $OS = "Darwin" ]; then
574495372d1c Finish OS X support in build_release script. Fix a name conflict in vgmplay on OS X. Call set_exe_str in vgmplay and stateview
Michael Pavone <pavone@retrodev.com>
parents: 811
diff changeset
35 binaries="dis zdis stateview vgmplay blastem termhelper Frameworks"
574495372d1c Finish OS X support in build_release script. Fix a name conflict in vgmplay on OS X. Call set_exe_str in vgmplay and stateview
Michael Pavone <pavone@retrodev.com>
parents: 811
diff changeset
36 else
574495372d1c Finish OS X support in build_release script. Fix a name conflict in vgmplay on OS X. Call set_exe_str in vgmplay and stateview
Michael Pavone <pavone@retrodev.com>
parents: 811
diff changeset
37 binaries="dis zdis stateview vgmplay blastem termhelper lib"
574495372d1c Finish OS X support in build_release script. Fix a name conflict in vgmplay on OS X. Call set_exe_str in vgmplay and stateview
Michael Pavone <pavone@retrodev.com>
parents: 811
diff changeset
38 fi
806
2dfcd20a00b6 Added script for building and packaging releases
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
39 cmd="./blastem"
2dfcd20a00b6 Added script for building and packaging releases
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
40 txt=""
2dfcd20a00b6 Added script for building and packaging releases
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
41 fi
2dfcd20a00b6 Added script for building and packaging releases
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
42 ver=`$cmd -v | awk '/blastem/ { gsub(/\r/, "", $2); print $2 }'`
2dfcd20a00b6 Added script for building and packaging releases
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
43 if [ $OS = "Windows" ]; then
2dfcd20a00b6 Added script for building and packaging releases
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
44 suffix='-win32'
2dfcd20a00b6 Added script for building and packaging releases
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
45 elif [ $OS = "Darwin" ]; then
2dfcd20a00b6 Added script for building and packaging releases
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
46 suffix='-osx'
2dfcd20a00b6 Added script for building and packaging releases
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
47 else
2dfcd20a00b6 Added script for building and packaging releases
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
48 suffix=`file ./blastem | sed -E 's/^[^:]*: [^ ]* ([0-9]*)-bit .*/\1/'`
2dfcd20a00b6 Added script for building and packaging releases
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
49 fi
2dfcd20a00b6 Added script for building and packaging releases
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
50 dir="blastem${suffix}-${ver}"
2dfcd20a00b6 Added script for building and packaging releases
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
51 echo $dir
2dfcd20a00b6 Added script for building and packaging releases
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
52 rm -rf "$dir"
2dfcd20a00b6 Added script for building and packaging releases
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
53 mkdir "$dir"
2dfcd20a00b6 Added script for building and packaging releases
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
54 cp -r $binaries shaders default.cfg rom.db "$dir"
2dfcd20a00b6 Added script for building and packaging releases
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
55 for file in README COPYING CHANGELOG; do
2dfcd20a00b6 Added script for building and packaging releases
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
56 cp "$file" "$dir"/"$file$txt"
2dfcd20a00b6 Added script for building and packaging releases
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
57 done
812
574495372d1c Finish OS X support in build_release script. Fix a name conflict in vgmplay on OS X. Call set_exe_str in vgmplay and stateview
Michael Pavone <pavone@retrodev.com>
parents: 811
diff changeset
58 if [ $OS = "Darwin" ]; then
574495372d1c Finish OS X support in build_release script. Fix a name conflict in vgmplay on OS X. Call set_exe_str in vgmplay and stateview
Michael Pavone <pavone@retrodev.com>
parents: 811
diff changeset
59 cp SDL-LICENSE "$dir"
574495372d1c Finish OS X support in build_release script. Fix a name conflict in vgmplay on OS X. Call set_exe_str in vgmplay and stateview
Michael Pavone <pavone@retrodev.com>
parents: 811
diff changeset
60 else
574495372d1c Finish OS X support in build_release script. Fix a name conflict in vgmplay on OS X. Call set_exe_str in vgmplay and stateview
Michael Pavone <pavone@retrodev.com>
parents: 811
diff changeset
61 cp sdl/COPYING.txt "$dir"/SDL-LICENSE$txt
574495372d1c Finish OS X support in build_release script. Fix a name conflict in vgmplay on OS X. Call set_exe_str in vgmplay and stateview
Michael Pavone <pavone@retrodev.com>
parents: 811
diff changeset
62 fi
806
2dfcd20a00b6 Added script for building and packaging releases
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
63 cp glew/LICENSE.txt "$dir"/GLEW-LICENSE$txt
2dfcd20a00b6 Added script for building and packaging releases
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
64
2dfcd20a00b6 Added script for building and packaging releases
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
65 if [ $OS = "Windows" ]; then
2dfcd20a00b6 Added script for building and packaging releases
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
66 rm -f "${dir}.zip"
2dfcd20a00b6 Added script for building and packaging releases
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
67 zip -r "${dir}.zip" "$dir"
2dfcd20a00b6 Added script for building and packaging releases
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
68 else
2dfcd20a00b6 Added script for building and packaging releases
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
69 rm -f "${dir}.tar.gz"
2dfcd20a00b6 Added script for building and packaging releases
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
70 tar -cvzf "${dir}.tar.gz" "$dir"
2dfcd20a00b6 Added script for building and packaging releases
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
71 fi