Subversion Repositories eduke32

Rev

Rev 4129 | Rev 4131 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4129 Rev 4130
Line 12... Line 12...
12
make64=( make SYNTHESIS=1 PLATFORM=WINDOWS CROSS='x86_64-w64-mingw32-' CC='x86_64-w64-mingw32-gcc-4.8.0' AS='nasm' PRETTY_OUTPUT=0 )
12
make64=( make SYNTHESIS=1 PLATFORM=WINDOWS CROSS='x86_64-w64-mingw32-' CC='x86_64-w64-mingw32-gcc-4.8.0' AS='nasm' PRETTY_OUTPUT=0 )
13
clean=veryclean
13
clean=veryclean
14
14
15
# the following file paths are relative to $source
15
# the following file paths are relative to $source
16
targets=( eduke32$exe mapster32$exe )
16
targets=( eduke32$exe mapster32$exe )
17
package=package
17
package=$top/$source/package/package
18
not_src_packaged=( $package/ebacktrace1.dll $package/ebacktrace1-64.dll )
18
not_src_packaged=( package/debug/win32/ebacktrace1.dll package/debug/win64/ebacktrace1-64.dll )
19
19
20
# group that owns the resulting packages
20
# group that owns the resulting packages
21
group=dukeworld
21
group=dukeworld
22
22
23
# some variables
23
# some variables
24
dobuild=
24
dobuild=
25
25
26
# controls resulting package filenames... will support linux later
26
# controls resulting package filenames... will support linux later
27
basename=eduke32
27
basename=eduke32
28
platform=win32
-
 
29
28
30
# if the output dir doesn't exist, create it
29
# if the output dir doesn't exist, create it
31
if [ ! -e $output ]
30
if [ ! -e $output ]
32
then
31
then
33
    mkdir -p $output
32
    mkdir -p $output
Line 81... Line 80...
81
            echo "Build failed! Bailing out..."
80
            echo "Build failed! Bailing out..."
82
            rm -f $lockfile
81
            rm -f $lockfile
83
            exit
82
            exit
84
        fi
83
        fi
85
    done
84
    done
-
 
85
-
 
86
    # create the output directory
-
 
87
    mkdir -p $output/$date-$head
-
 
88
}
-
 
89
-
 
90
function package_start ()
-
 
91
{
-
 
92
    mkdir -p $package
-
 
93
-
 
94
    cd $package
-
 
95
-
 
96
    cp -R $top/$source/package/common/* ./
-
 
97
}
-
 
98
-
 
99
function package_debug ()
-
 
100
{
-
 
101
    cp -R $top/$source/package/debug/${*}/* ./
-
 
102
}
-
 
103
-
 
104
function package_game_lunatic ()
-
 
105
{
-
 
106
    # Package some Lunatic test and demo files.
-
 
107
    mkdir -p lunatic/test
-
 
108
    cp $top/$source/source/lunatic/test.lua lunatic
-
 
109
    cp $top/$source/source/lunatic/test/test_{bitar,geom,rotspr}.lua lunatic/test
-
 
110
    cp $top/$source/source/lunatic/test/{delmusicsfx,helixspawner}.lua lunatic/test
-
 
111
}
-
 
112
-
 
113
function package_sdk ()
-
 
114
{
-
 
115
    cp -R $top/$source/package/sdk/* ./
-
 
116
}
-
 
117
-
 
118
function package_execute ()
-
 
119
{
-
 
120
    echo 7z a -mx9 -t7z $output/$date-$head/${*}_$date-$head.7z *
-
 
121
    7z a -mx9 -t7z $output/$date-$head/${*}_$date-$head.7z *
-
 
122
-
 
123
    cd $top/$source
-
 
124
-
 
125
    rm -rf $package
86
}
126
}
87
127
88
if [ $dobuild ]
128
if [ $dobuild ]
89
then
129
then
90
    echo "Launching a build..."
130
    echo "Launching a build..."
Line 92... Line 132...
92
    cd $top/$source
132
    cd $top/$source
93
133
94
    # throw the svn revision into a header.  this is ugly.
134
    # throw the svn revision into a header.  this is ugly.
95
    echo "s_buildRev = \"r$head\";" > source/rev.h
135
    echo "s_buildRev = \"r$head\";" > source/rev.h
96
136
-
 
137
    # get the date in the YYYYMMDD format (ex: 20091001)
-
 
138
    date=`date +%Y%m%d`
-
 
139
97
140
98
    # 32-bit debug
141
    # 32-bit debug
99
142
100
    # clean the tree and build
143
    # clean the tree and build
101
    echo "${make[@]}" RELEASE=0 $clean all
144
    echo "${make[@]}" RELEASE=0 $clean all
102
    "${make[@]}" RELEASE=0 $clean all
145
    "${make[@]}" RELEASE=0 $clean all
103
146
104
    # make sure all the targets were produced
147
    # make sure all the targets were produced
105
    verifytargets
148
    verifytargets
106
149
107
    # move the targets to $package
150
    # package game
-
 
151
    package_start
108
    echo mv -f eduke32$exe "$package/eduke32.debug$exe"
152
    package_debug win32
109
    mv -f eduke32$exe "$package/eduke32.debug$exe"
153
    mv -f eduke32$exe "$package/eduke32.debug$exe"
110
    echo mv -f mapster32$exe "$package/mapster32.debug$exe"
154
    package_execute ${basename}_win32_debug
-
 
155
-
 
156
    # package sdk
-
 
157
    package_start
-
 
158
    package_debug win32
-
 
159
    package_sdk
111
    mv -f mapster32$exe "$package/mapster32.debug$exe"
160
    mv -f mapster32$exe "$package/mapster32.debug$exe"
-
 
161
    package_execute ${basename}-sdk_win32_debug
112
162
113
163
114
    # 64-bit debug
164
    # 64-bit debug
115
165
116
    # clean the tree and build
166
    # clean the tree and build
Line 118... Line 168...
118
    "${make64[@]}" RELEASE=0 $clean all
168
    "${make64[@]}" RELEASE=0 $clean all
119
169
120
    # make sure all the targets were produced
170
    # make sure all the targets were produced
121
    verifytargets
171
    verifytargets
122
172
123
    # move the targets to $package
173
    # package game
-
 
174
    package_start
-
 
175
    package_debug win64
124
    echo mv -f eduke32$exe "$package/eduke64.debug$exe"
176
    mv -f eduke32$exe "$package/eduke32.debug$exe"
125
    mv -f eduke32$exe "$package/eduke64.debug$exe"
177
    package_execute ${basename}_win64_debug
-
 
178
-
 
179
    # package sdk
-
 
180
    package_start
-
 
181
    package_debug win64
-
 
182
    package_sdk
126
    echo mv -f mapster32$exe "$package/mapster64.debug$exe"
183
    mv -f mapster32$exe "$package/mapster32.debug$exe"
127
    mv -f mapster32$exe "$package/mapster64.debug$exe"
184
    package_execute ${basename}-sdk_win64_debug
128
185
129
186
130
    # 32-bit Lunatic (pre-)release
187
    # 32-bit Lunatic (pre-)release
131
188
132
    BUILD_LUNATIC="`echo $headlog | grep BUILD_LUNATIC`"
189
    BUILD_LUNATIC="`echo $headlog | grep BUILD_LUNATIC`"
Line 137... Line 194...
137
        "${make[@]}" LUNATIC=1 $clean all
194
        "${make[@]}" LUNATIC=1 $clean all
138
195
139
        # make sure all the targets were produced
196
        # make sure all the targets were produced
140
        verifytargets
197
        verifytargets
141
198
142
        # move the targets to $package
199
        # package game
-
 
200
        package_start
143
        echo mv -f eduke32$exe "$package/leduke32_PREVIEW$exe"
201
        package_game_lunatic
144
        mv -f eduke32$exe "$package/leduke32_PREVIEW$exe"
202
        mv -f eduke32$exe "$package/leduke32_PREVIEW$exe"
-
 
203
        package_execute l${basename}-lunatic-PREVIEW_win32
145
    fi
204
    fi
146
205
147
206
148
    # 32-bit release
207
    # 32-bit release
149
208
Line 152... Line 211...
152
    "${make[@]}" $clean all
211
    "${make[@]}" $clean all
153
212
154
    # make sure all the targets were produced
213
    # make sure all the targets were produced
155
    verifytargets
214
    verifytargets
156
215
157
    # move the targets to $package
216
    # package game
158
    echo mv -f eduke32$exe "$package/eduke32$exe"
217
    package_start
159
    mv -f eduke32$exe "$package/eduke32$exe"
218
    mv -f eduke32$exe "$package/eduke32$exe"
160
    echo mv -f mapster32$exe "$package/mapster32$exe"
219
    package_execute ${basename}_win32
-
 
220
-
 
221
    # package sdk
-
 
222
    package_start
-
 
223
    package_sdk
161
    mv -f mapster32$exe "$package/mapster32$exe"
224
    mv -f mapster32$exe "$package/mapster32$exe"
-
 
225
    package_execute ${basename}-sdk_win32
162
226
163
227
164
    # 64-bit release
228
    # 64-bit release
165
229
166
    # clean the tree and build
230
    # clean the tree and build
Line 168... Line 232...
168
    "${make64[@]}" $clean all
232
    "${make64[@]}" $clean all
169
233
170
    # make sure all the targets were produced
234
    # make sure all the targets were produced
171
    verifytargets
235
    verifytargets
172
236
173
    # move the targets to $package
237
    # package game
174
    echo mv -f eduke32$exe "$package/eduke64$exe"
238
    package_start
175
    mv -f eduke32$exe "$package/eduke64$exe"
239
    mv -f eduke32$exe "$package/eduke32$exe"
176
    echo mv -f mapster32$exe "$package/mapster64$exe"
-
 
177
    mv -f mapster32$exe "$package/mapster64$exe"
-
 
178
-
 
179
-
 
180
-
 
181
    # get the date in the YYYYMMDD format (ex: 20091001)
-
 
182
    date=`date +%Y%m%d`
-
 
183
   
-
 
184
    # create the output directory
-
 
185
    mkdir $output/$date-$head
-
 
186
-
 
187
    # package the binary snapshot
240
    package_execute ${basename}_win64
188
    cd $package
-
 
189
-
 
190
    # Package some Lunatic test and demo files.
-
 
191
    if [ -n "$BUILD_LUNATIC" ]; then
-
 
192
        mkdir -p lunatic/test
-
 
193
        cp $top/$source/source/lunatic/test.lua lunatic
-
 
194
        cp $top/$source/source/lunatic/test/test_{bitar,geom,rotspr}.lua lunatic/test
-
 
195
        cp $top/$source/source/lunatic/test/{delmusicsfx,helixspawner}.lua lunatic/test
-
 
196
    fi
-
 
197
241
-
 
242
    # package sdk
-
 
243
    package_start
-
 
244
    package_sdk
198
    echo 7z a -mx9 -t7z $output/$date-$head/${basename}_${platform}_$date-$head.7z *
245
    mv -f mapster32$exe "$package/mapster32$exe"
199
    7z a -mx9 -t7z $output/$date-$head/${basename}_${platform}_$date-$head.7z *
246
    package_execute ${basename}-sdk_win64
200
247
201
    # Remove the packaged Lunatic test/demo files.
-
 
202
    if [ -n "$BUILD_LUNATIC" ]; then
-
 
203
        rm lunatic/test/*.lua lunatic/test.lua
-
 
204
        rmdir lunatic/test
-
 
205
        rmdir lunatic
-
 
206
    fi
-
 
207
248
208
    cd $top/$source
249
    # clean up
209
250
210
    # hack to restore [e]obj/keep.me
251
    # hack to restore [e]obj/keep.me
211
    echo svn update -r $head
252
    echo svn update -r $head
212
    svn update -r $head
253
    svn update -r $head
213
   
254
Line 245... Line 286...
245
    # like in whatever script executes this one
286
    # like in whatever script executes this one
246
    chmod -R g+w $output/$date-$head
287
    chmod -R g+w $output/$date-$head
247
    chown -R :$group $output/$date-$head
288
    chown -R :$group $output/$date-$head
248
289
249
   # link eduke32_latest.zip to the new archive
290
    # link eduke32_latest.zip to the new archive
250
    ln -sf $output/$date-$head/${basename}_${platform}_$date-$head.7z $output/eduke32_latest.7z
291
    ln -sf $output/$date-$head/${basename}_win32_$date-$head.7z $output/eduke32_latest.7z
251
292
252
    rm -f $lockfile
293
    rm -f $lockfile
253
else
294
else
254
    echo "Nothing to do."
295
    echo "Nothing to do."
255
    rm -f $lockfile
296
    rm -f $lockfile