-
Notifications
You must be signed in to change notification settings - Fork 0
/
b.bat
48 lines (42 loc) · 1.21 KB
/
b.bat
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
@echo off
REM Variables
set INPUT_FILE=sialk.c
set OUTPUT_FILE=s
set EXAMPLE_FILE=input.sialk
REM Check if an argument is provided
if "%~1" neq "" (
set EXAMPLE_FILE=%~1
)
REM Clear screen
cls
REM Delete file
if exist "%OUTPUT_FILE%" (
del "%OUTPUT_FILE%"
)
REM Check for efence library
REM where /R "C:\Program Files" efence.dll >nul 2>&1
REM if %errorlevel% neq 0 (
REM echo efence library is missing
REM echo Install efence - Electric Fence Malloc Debugger
REM exit /b 1
REM )
REM Compile
REM gcc -g -ggdb -g -o "%OUTPUT_FILE%" "%INPUT_FILE%"
REM gcc -g -fsanitize=undefined,address -Walloca -o "%OUTPUT_FILE%" "%INPUT_FILE%" -lefence
gcc -g -fsanitize=undefined,address -Walloca -o "%OUTPUT_FILE%" "%INPUT_FILE%"
if %errorlevel% neq 0 (
echo Compilation failed!
exit /b 1
)
REM Check if compilation was successful
if exist "%OUTPUT_FILE%" (
"%OUTPUT_FILE%" "%EXAMPLE_FILE%"
REM set LSAN_OPTIONS=verbosity=1:log_threads=1
REM "%OUTPUT_FILE%" "%EXAMPLE_FILE%"
REM set ASAN_OPTIONS=detect_leaks=1
REM "%OUTPUT_FILE%" "%EXAMPLE_FILE%"
REM set LSAN_OPTIONS=verbosity=1:log_threads=1:detect_leaks=1
REM "%OUTPUT_FILE%" "%EXAMPLE_FILE%"
) else (
echo Compilation failed!
)