-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.bat
52 lines (38 loc) · 1.14 KB
/
build.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
49
50
51
52
@echo off
call getcomp.bat gcc12
set path=%path%;G:\p_files\rtdk\WDDK\7600\bin\x86
ml /coff /c src\esfmmidi.asm
move /y esfmmidi.obj bin\
::must not contain spaces!
set buttiolocation=C:\p_files\prog\_proj\CodeCocks\buttio
set esfmulocation=C:\p_files\prog\_proj\CodeCocks\ESS_shenanigans\ESFMu\core
set opts=-std=c11 -mconsole -g -Wall -Wextra -DNONMMAP_FALLBACK -DASM_SRC
set linkinc=-I%buttiolocation%\src\ -L%buttiolocation%\bin\ -I%esfmulocation%
set linkinc=%linkinc% -lwinmm -lbuttio
set compiles=bin\esfmmidi.obj src\main.c src\iodriver.c src\esfmmidi.c src\util.c
set compiles=%compiles% %esfmulocation%\esfm_registers.c %esfmulocation%\esfm.c
set errlog=.\essmidi_err.log
set out=.\bin\essmidi.exe
call :compile
call :checkerr
set opts=-std=c11 -mconsole -g -Wall -Wextra
set linkinc=
set compiles=src\tests.c src\util.c
set errlog=.\tests_err.log
set out=.\bin\tests.exe
call :compile
call :checkerr
exit /B 0
:compile
del %out%
gcc -o %out% %compiles% %opts% %linkinc% 2> %errlog%
exit /B 0
:checkerr
IF %ERRORLEVEL% NEQ 0 (
echo oops!
notepad %errlog%
goto :end
)
for %%R in (%errlog%) do if %%~zR lss 1 del %errlog%
:end
exit /B 0