summaryrefslogtreecommitdiff
path: root/compile_windows.cmd
blob: f3063791a53ee5f8a1df97cb14c5ccc8e53d4085 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
@echo off

set startdir=%CD%

set script_name=%0
set build_smtube=true
set smtube_svn_dir=..\..\smtube
set smtube_params=
set qmake_defs=
set use_svn_revision=

:arg_loop
if [%1]==[] (

  goto compile

) else if [%1]==[pe] (

  set qmake_defs=PORTABLE_APP
  set smtube_params=pe

) else if [%1]==[nosmtube] (

  set build_smtube=false

) else if [%1]==[-h] (

  echo How to use:
  echo.
  echo Add ^`pe^' to compile portable.
  echo Add ^`nosmtube^' to disable compiling smtube.
  echo.
  echo To compile SMPlayer/SMTube non-portable, enter no arguments.
  echo.
  echo ex: %script_name% pe nosmtube
  goto end

) else (

  echo configure: error: unrecognized option: `%1'
  echo Try `%script_name% -h' for more information
  goto end

) 

shift
goto arg_loop

:compile

call getrev.cmd

cd zlib
mingw32-make -fwin32\makefile.gcc

cd ..\webserver
mingw32-make

cd ..\src
lrelease smplayer.pro
qmake "DEFINES += %qmake_defs%"
mingw32-make

if [%errorlevel%]==[0] (
  if [%build_smtube%]==[true] (
    if exist %smtube_svn_dir%\compile_windows.cmd (

      cd %smtube_svn_dir%
      call compile_windows.cmd %smtube_params%
      :: Return to starting directory
      cd %startdir%

    ) else (

      echo SMTube not found in specified directory... skipping
    )
  )
) else (
echo Compilation error, script aborted
:: Resets errorlevel to 0
ver >nul
)

:end