3 APPLICATIONNAME
=SpeakGoodChinese2
4 CURRENTWORKINGDIR
=$
(pwd)
8 TARGETNAME
=${APPLICATIONNAME}
11 PRAATSOURCES
=.
/praat_sources
12 if [[ ${1:-Normal} == "MinGW" ]]; then
13 PRAATSOURCES
=..
/..
/praat_mingw
14 if [[ ! -d ${PRAATSOURCES} ]]; then
17 # Temporary cludge to recompile this file without -O2
18 touch ${PRAATSOURCES}/dwsys
/regularExp.cpp
19 elif [[ -d ..
/praat_sources
]]; then
20 PRAATSOURCES
=..
/praat_sources
21 elif [[ -d ..
/..
/demo_praat_sources
]]; then
22 PRAATSOURCES
=..
/..
/demo_praat_sources
23 elif [[ -d ..
/..
/praat_sources
]]; then
24 PRAATSOURCES
=..
/..
/praat_sources
27 if [[ -e ${PRAATSOURCES}/makefile.defs
&& -n `grep -l mingw32 ${PRAATSOURCES}/makefile.defs` ]]; then
29 if [[ ${1:-Normal} == "MinGW" && ${2:-Normal} == "XP" ]]; then
30 TARGETNAME
=${APPLICATIONNAME}XP.exe
32 TARGETNAME
=${APPLICATIONNAME}.exe
36 elif [[ ${UNAME} == "Darwin" ]]; then
37 MAKECMD
="xcodebuild -project praat64.xcodeproj"
41 #if [[ `ls -d /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.1*.sdk 2>/dev/null` ]]; then
42 # SDK=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk
43 # MAKECMD="xcodebuild -project praat64.xcodeproj -sdk ${SDK}"
44 # EXECPATH="./build/Configuration64/Praat.app"
45 # ZIPNAME=${ZIPNAME}_64.app
46 #elif [[ -d ${PRAATSOURCES}/praat32.xcodeproj && ${1:-Normal} == "OSX32" ]]; then
47 # if [[ -d /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs ]]; then
48 # SDK=`ls -1d /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/*|grep 10.6`
50 # SDK=`ls -1d /Developer/SDKs/*|grep 10.6`
52 # MAKECMD="xcodebuild -project praat32.xcodeproj -sdk ${SDK}"
53 # EXECPATH="./build/Configuration1/Praat.app"
54 # ZIPNAME=${ZIPNAME}_32.app
56 # MAKECMD="xcodebuild -project praat64.xcodeproj"
57 # EXECPATH="./build/Configuration64/Praat.app"
58 # ZIPNAME=${ZIPNAME}_64.app
61 MAKECMD
="xcodebuild -project praat64.xcodeproj"
62 EXECPATH
="./build/Configuration64/Praat.app"
63 ZIPNAME
=${ZIPNAME}_64.app
64 TARGETNAME
=${APPLICATIONNAME}.app
69 if [[ -s ${CURRENTWORKINGDIR}/adaptPraat.
patch ]]; then
70 patch --strip=1 < ${CURRENTWORKINGDIR}/adaptPraat.
patch
72 if [[ -s ${CURRENTWORKINGDIR}/sys_praat_name.
patch ]]; then
73 patch --strip=1 < ${CURRENTWORKINGDIR}/sys_praat_name.
patch
76 # Add demopraatapplication.h
78 rm -f demopraatapplication.h
79 if [[ ${1:-Normal} == "MinGW" && ${2:-Normal} == "XP" ]]; then
80 cat ${CURRENTWORKINGDIR}/${APPLICATIONNAME}expanded.h | sed 's/\(\"build_SHA\$ \= \\\"[^\\]*\)/\1 XP/g' > ${CURRENTWORKINGDIR}/${APPLICATIONNAME}expandedXP.h
81 ln -s ${CURRENTWORKINGDIR}/${APPLICATIONNAME}expandedXP.h .
/demopraatapplication.h
83 ln -s ${CURRENTWORKINGDIR}/${APPLICATIONNAME}expanded.h .
/demopraatapplication.h
85 # Create a file containing the Build number
86 grep 'build_SHA$ = "' ${CURRENTWORKINGDIR}/${APPLICATIONNAME}expanded.praat | grep ':' | perl -ane '/\"([A-F0-9]+)\s+([\d\-]+)(.*)\"/;print "<i>$1</i> <b>$2</b>$3\n";' > ${CURRENTWORKINGDIR}/Build_SHA.html
88 # Get the manual into the tutorials manual
89 cp ..
/fon
/manual_tutorials.cpp ..
/fon
/manual_tutorials.cppORIGINAL
90 NUMLINES
=$
(grep -n '}' ..
/fon
/manual_tutorials.cpp|
tail -1|
sed 's/\:.*//g'|perl
-ane 'print $_-1;')
91 TAILLINES
=$
(wc -l ..
/fon
/manual_tutorials.cpp|perl
-ane "print \$_ - ${NUMLINES}")
92 head -n ${NUMLINES} ..
/fon
/manual_tutorials.cppORIGINAL
> ..
/fon
/manual_tutorials.cpp
93 cat ${CURRENTWORKINGDIR}/manual_
${APPLICATIONNAME}.cpp
>> ..
/fon
/manual_tutorials.cpp
94 tail -${TAILLINES} ..
/fon
/manual_tutorials.cppORIGINAL
>> ..
/fon
/manual_tutorials.cpp
96 # Get the icons into the main folder
97 mv ..
/main
/Praat.icns ..
/main
/PraatBACKUP.icns
98 mv ..
/main
/praat_win.ico ..
/main
/praat_winBACKUP.ico
99 cp ${CURRENTWORKINGDIR}/sgc.icns ..
/main
/Praat.icns
100 cp ${CURRENTWORKINGDIR}/sgc_win.ico ..
/main
/praat_win.ico
105 if [[ -s ${CURRENTWORKINGDIR}/main_Praat.
patch ]]; then
106 patch main_Praat.cpp
${CURRENTWORKINGDIR}/main_Praat.
patch
110 if [[ ${UNAME} == "Darwin" ]]; then
111 ${MAKECMD} OTHER_CFLAGS
='$OTHER_CFLAGS -DDEMOAPP' 2>&1
117 if [[ -s ${CURRENTWORKINGDIR}/adaptPraat.
patch ]]; then
118 patch -R --strip=1 < ${CURRENTWORKINGDIR}/adaptPraat.
patch
120 if [[ -s ${CURRENTWORKINGDIR}/sys_praat_name.
patch ]]; then
121 patch -R --strip=1 < ${CURRENTWORKINGDIR}/sys_praat_name.
patch
125 rm -f demopraatapplication.h ..
/fon
/manual_tutorials.cpp Praat.icns praat_win.ico
126 mv PraatBACKUP.icns Praat.icns
127 mv praat_winBACKUP.ico praat_win.ico
128 mv ..
/fon
/manual_tutorials.cppORIGINAL ..
/fon
/manual_tutorials.cpp
129 if [[ -s ${CURRENTWORKINGDIR}/main_Praat.
patch ]]; then
130 patch -R main_Praat.cpp
${CURRENTWORKINGDIR}/main_Praat.
patch
134 # Move result to correct directory
135 if [[ -d ${CURRENTWORKINGDIR}/${TARGETNAME} ]]; then
136 rm -r ${CURRENTWORKINGDIR}/${TARGETNAME}
138 mv ${EXECPATH} ${CURRENTWORKINGDIR}/${TARGETNAME}
141 cd ${CURRENTWORKINGDIR}
142 zip -r ${ZIPNAME}.
zip ${TARGETNAME}
145 if [[ -n `which md5` ]] ; then
146 if [[ -f ${CURRENTWORKINGDIR}/${TARGETNAME} ]]; then
147 cd ${CURRENTWORKINGDIR}/; md5 ${TARGETNAME} > ${TARGETNAME}.md5
; cd -
149 cd ${CURRENTWORKINGDIR}/; md5 ${ZIPNAME}.zip > ${ZIPNAME}.
zip.md5
; cd -
151 if [[ -n `which md5sum` ]] ; then
152 if [[ -f ${CURRENTWORKINGDIR}/${TARGETNAME} ]]; then
153 cd ${CURRENTWORKINGDIR}/; md5sum ${TARGETNAME} > ${TARGETNAME}.md5
; cd -
155 cd ${CURRENTWORKINGDIR}/; md5sum ${ZIPNAME}.zip > ${ZIPNAME}.
zip.md5
; cd -
159 if [[ -n `which shasum` ]] ; then
160 if [[ -f ${CURRENTWORKINGDIR}/${TARGETNAME} ]]; then
161 cd ${CURRENTWORKINGDIR}/; shasum -p ${TARGETNAME} > ${TARGETNAME}.sha1
; cd -
163 cd ${CURRENTWORKINGDIR}/; shasum -p ${ZIPNAME}.zip > ${ZIPNAME}.
zip.sha1
; cd -