-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-reactos-win32-manual.cmd
83 lines (68 loc) · 2.6 KB
/
build-reactos-win32-manual.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
@echo off
:: Going into the script's directory
pushd %~dp0
:: Preparing TCC
set TCC="..\.bin\tcc.exe"
:: Preparing 'windres'
set PATH=%PATH%;C:\cygwin64\bin
set WINDRES="windres.exe"
:: Removing old build folders
echo.
echo Removing old folders
echo --------------------
rmdir cmake-build-reactos-tcc-manual /s /q 2> nul
echo Done :)
:: Compiling
echo.
echo Compiling some tests
echo --------------------
mkdir cmake-build-reactos-tcc-manual
cd cmake-build-reactos-tcc-manual
mkdir lib
echo ^> Copying '.def' files...
copy ..\rsc\*.def lib\ > nul
echo.
echo ^> Compiling '.rc' file...
%WINDRES% -i "../rsc/np_clang_goodies.rc" -o "np_clang_goodies.res"
echo.
:: TODO: Automate this
echo ^> Listing '.c' files...
set NP_C99_GOODIES_C_FILES=
set NP_C99_GOODIES_C_FILES=%NP_C99_GOODIES_C_FILES% ../src/arguments/arguments.c
set NP_C99_GOODIES_C_FILES=%NP_C99_GOODIES_C_FILES% ../src/arguments/help.c
set NP_C99_GOODIES_C_FILES=%NP_C99_GOODIES_C_FILES% ../src/hash/crc32/crc32.c
set NP_C99_GOODIES_C_FILES=%NP_C99_GOODIES_C_FILES% ../src/hashmaps/utils.c
set NP_C99_GOODIES_C_FILES=%NP_C99_GOODIES_C_FILES% ../src/hashmaps/chained/hashmap.c
set NP_C99_GOODIES_C_FILES=%NP_C99_GOODIES_C_FILES% ../src/lists/commons.c
set NP_C99_GOODIES_C_FILES=%NP_C99_GOODIES_C_FILES% ../src/lists/single/sllist.c
set NP_C99_GOODIES_C_FILES=%NP_C99_GOODIES_C_FILES% ../src/lists/double/dllist.c
set NP_C99_GOODIES_C_FILES=%NP_C99_GOODIES_C_FILES% ../src/uuid/uuid.c
set NP_C99_GOODIES_C_FILES=%NP_C99_GOODIES_C_FILES% ../src/uuid/uuid4.c
set NP_C99_GOODIES_C_FILES=%NP_C99_GOODIES_C_FILES% ../src/text.c
echo ^> %NP_C99_GOODIES_C_FILES%
echo.
:: TODO: Add input lib switches
echo ^> Compiling 'np_clang_goodies.dll'...
%TCC% -m64 -DNP_GOODIES_EXPORT_ALL -o np_clang_goodies.dll -shared %NP_C99_GOODIES_C_FILES%
echo.
if not exist "np_clang_goodies.def" (
echo ^> Creating missing 'np_clang_goodies.def'...
%TCC% -impdef np_clang_goodies.dll
echo.
)
echo ^> Moving 'np_clang_goodies.def' into 'lib/'...
move np_clang_goodies.def lib\ > nul
echo.
echo ^> Moving final test executables...
%TCC% -m64 -o test_platform_x64.exe -std=c99 -x c ../tests/misc/test_platform.c
%TCC% -m64 -o example_arguments_basic.exe -std=c99 -x c ../examples/arguments_basic.c %NP_C99_GOODIES_C_FILES%
%TCC% -m64 -o bm_crc32_implementations_x64.exe -std=c99 -x c ../benchmarks/bm_crc32_implementations.c
:: The 'uuid_win32_x64' still crashes, the callback might be broken :/
%TCC% -m64 -Llib -lcrypt32 -lnp_clang_goodies -o uuid_win32_x64.exe -std=c99 -x c ../examples/uuid_win32.c
cd ..
echo Done :)
:: Going back to the original directory
popd
:: Letting the user check the logs
echo.
pause