1
|
1 |
#!/usr/bin/env python
|
|
2 |
# Copyright (C) 2005, Giovanni Bajo
|
|
3 |
# Based on previous work under copyright (c) 1999, 2002 McMillan Enterprises, Inc.
|
|
4 |
#
|
|
5 |
# This program is free software; you can redistribute it and/or
|
|
6 |
# modify it under the terms of the GNU General Public License
|
|
7 |
# as published by the Free Software Foundation; either version 2
|
|
8 |
# of the License, or (at your option) any later version.
|
|
9 |
#
|
|
10 |
# This program is distributed in the hope that it will be useful,
|
|
11 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13 |
# GNU General Public License for more details.
|
|
14 |
#
|
|
15 |
# You should have received a copy of the GNU General Public License
|
|
16 |
# along with this program; if not, write to the Free Software
|
|
17 |
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
18 |
import sys, string, os
|
|
19 |
if sys.platform[:3] == 'win':
|
|
20 |
stripopts = ('',)
|
|
21 |
consoleopts = ('', '--noconsole')
|
|
22 |
else:
|
|
23 |
stripopts = ('', '--strip')
|
|
24 |
consoleopts = ('',)
|
|
25 |
if string.find(sys.executable, ' ') > -1:
|
|
26 |
exe = '"%s"' % sys.executable
|
|
27 |
else:
|
|
28 |
exe = sys.executable
|
|
29 |
if sys.platform[:3] == 'win':
|
|
30 |
spec = "%s ../../Makespec.py --tk %%s %%s %%s %%s %%s --out t%%d hanoi.py" % exe
|
|
31 |
bld = "%s ../../Build.py t%%d/hanoi.spec" % exe
|
|
32 |
else:
|
|
33 |
spec = "%s ../../Makespec.py --tk %%s %%s %%s %%s %%s --out /u/temp/t%%d hanoi.py" % exe
|
|
34 |
bld = "%s ../../Build.py /u/temp/t%%d/hanoi.spec" % exe
|
|
35 |
|
|
36 |
i = 0
|
|
37 |
for bldconfig in ('--onedir', '--onefile'):
|
|
38 |
for console in consoleopts:
|
|
39 |
for dbg in ('--debug', ''):
|
|
40 |
for stripopt in stripopts:
|
|
41 |
for upxopt in ('', '--upx'):
|
|
42 |
cmd = spec % (bldconfig, console, dbg, stripopt, upxopt, i)
|
|
43 |
os.system(cmd)
|
|
44 |
os.system(bld % i)
|
|
45 |
if sys.platform[:5] == 'linux':
|
|
46 |
if bldconfig == '--onedir':
|
|
47 |
os.system("ln -s /u/temp/t%d/disthanoi/hanoi hanoi%d" % (i,i))
|
|
48 |
else:
|
|
49 |
os.system("ln -s /u/temp/t%d/hanoi hanoi%d" % (i,i))
|
|
50 |
i += 1
|
|
51 |
|