summaryrefslogtreecommitdiffstats
path: root/win/build.py
blob: 3a9fbc7cad540179ff1be3038a513e4ab684c396 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import os, sys
from wb import system, config, home_fn, cd_home

os.environ['PATH'] += ";%s\\VC" % (os.path.normpath(config['MSVC']),)

def build_vc(cmd):
    system('cmd /c "vcvarsall.bat x86 && %s"' % (cmd,))

def main():
    cd_home()
    build_vc("nmake /f %s" % (home_fn('msvc.mak'),))

def clean():
    cd_home()
    build_vc("nmake /f %s clean" % (home_fn('msvc.mak'),))

# if we are run directly, and not loaded as a module

if __name__ == "__main__":
    if len(sys.argv) == 2 and sys.argv[1] == 'clean':
        clean()
    else:
        main()