forked from programmerjake/preyproject-lock-screen
-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.cmd
86 lines (79 loc) · 3.82 KB
/
build.cmd
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
85
86
:: Copyright (c) 2015 Jacob Lifshay, Fork Ltd.
:: This file is part of Prey.
::
:: Prey is free software: you can redistribute it and/or modify
:: it under the terms of the GNU General Public License as published by
:: the Free Software Foundation, either version 3 of the License, or
:: (at your option) any later version.
::
:: Prey is distributed in the hope that it will be useful,
:: but WITHOUT ANY WARRANTY; without even the implied warranty of
:: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
:: GNU General Public License for more details.
::
:: You should have received a copy of the GNU General Public License
:: along with Prey. If not, see <http://www.gnu.org/licenses/>.
::
@if "%1"=="" goto help
:parseargs
@if "%1"=="Debug64" goto Debug64
@if "%1"=="Release64" goto Release64
@if "%1"=="Debug32" goto Debug32
@if "%1"=="Release32" goto Release32
@if "%1"=="ZipSource" goto ZipSource
@if "%1"=="ZipAll" goto ZipAll
@if "%1"=="" exit /b
@echo invalid build target
@exit /b
:help
@echo Usage: build.cmd ^<target^> [^<target^> [...]]
@echo Targets: Debug32 Release32 Debug64 Release64 ZipSource ZipAll
@exit /b
:ZipSource
@shift
move /Y lock-screen-src.zip lock-screen-src.zip.bak 2>NUL
zip lock-screen-src.zip -r external_libs res build.cmd *.cpp *.c *.h *.cbp *.rc
@goto parseargs
:ZipAll
@shift
move /Y lock-screen.zip lock-screen.zip.bak 2>NUL
zip lock-screen.zip -r external_libs res build.cmd *.cpp *.c *.h *.cbp *.rc bin
@goto parseargs
:Debug64
@shift
@md obj\Debug 2>NUL
windres -DDEBUG -J rc -O coff -i lock-screen.rc -o obj\Debug\lock-screen.res
g++ -m64 -Wall -std=c++11 -municode -g -DDEBUG -c main.cpp -o obj\Debug\main.o
gcc -m64 -Wall -municode -g -DDEBUG -c md5.c -o obj\Debug\md5.o
@md bin\Debug 2>NUL
g++ -m64 -Lexternal_libs -o bin\Debug\lock-screen.exe obj\Debug\main.o obj\Debug\md5.o obj\Debug\lock-screen.res -municode -static -lgdi32 -luser32 -lkernel32 -lcomctl32 -lole32 -lpropsys_x64
@goto parseargs
:Release64
@shift
@md obj\Release 2>NUL
windres -J rc -O coff -i lock-screen.rc -o obj\Release\lock-screen.res
g++ -m64 -Wall -std=c++11 -municode -O2 -c main.cpp -o obj\Release\main.o
gcc -m64 -Wall -municode -O2 -c md5.c -o obj\Release\md5.o
@md bin\Release 2>NUL
g++ -m64 -Lexternal_libs -o bin\Release\lock-screen.exe obj\Release\main.o obj\Release\md5.o obj\Release\lock-screen.res -municode -static -s -lgdi32 -luser32 -lkernel32 -lcomctl32 -lole32 -lpropsys_x64
@goto parseargs
:Debug32
@shift
@md obj\Debug-x86 2>NUL
windres -DDEBUG -J rc -O coff -i lock-screen.rc -o obj\Debug-x86\lock-screen.res
g++ -m32 -Wall -std=c++11 -municode -g -DDEBUG -c main.cpp -o obj\Debug-x86\main.o
gcc -m32 -Wall -municode -g -DDEBUG -c md5.c -o obj\Debug-x86\md5.o
@md bin\Debug-x86 2>NUL
g++ -m32 -Lexternal_libs -o bin\Debug-x86\lock-screen.exe obj\Debug-x86\main.o obj\Debug-x86\md5.o obj\Debug-x86\lock-screen.res -municode -static -lgdi32 -luser32 -lkernel32 -lcomctl32 -lole32 -lpropsys_x86
@goto parseargs
:Release32
@shift
@md obj\Release-x86 2>NUL
windres -J rc -O coff -i lock-screen.rc -o obj\Release-x86\lock-screen.res
g++ -m32 --std=c++11 -Lexternal_libs -c persistent.cpp -o obj\Release-x86\persistent.o -static -Os -ffunction-sections -fdata-sections -Wl,--gc-sections -lpropsys_x86 -w -lwtsapi32 -luserenv
g++ -m32 -Wall -std=c++11 -municode -O2 -c main.cpp -o obj\Release-x86\main.o
gcc -m32 -Wall -municode -O2 -c md5.c -o obj\Release-x86\md5.o
gcc -m32 -Wall -municode -O2 -c base64.cpp -o obj\Release-x86\base64.o
@md bin\Release-x86 2>NUL
g++ -m32 -Lexternal_libs -o bin\Release-x86\new-prey-lock.exe obj\Release-x86\main.o obj\Release-x86\md5.o obj\Release-x86\base64.o obj\Release-x86\persistent.o obj\Release-x86\lock-screen.res -municode -static -s -lgdi32 -luser32 -lkernel32 -lcomctl32 -lole32 -lpropsys_x86 -lwtsapi32 -luserenv
@goto parseargs