-
Notifications
You must be signed in to change notification settings - Fork 0
/
0_2_build_system.bat
31 lines (24 loc) · 1.2 KB
/
0_2_build_system.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
@echo off
set KERNEL_NAME=\"Q-STEP\"
set KERNEL_VERSION=\"0.0.1\"
set ASSEMBLER=ToolChain\fasm.exe
set COMPILER=ToolChain\fbc.exe
set CFLAGS=-c -nodeflibs -lang fb -arch 486 -i userland/include -i shared
set LINKER=Toolchain\bin\linux\ld.exe
set AFLAGS=
echo compile userland apps
if not exist obj mkdir obj
if not exist bin mkdir bin
if not exist bin\userland mkdir bin\userland
if not exist bin\sys mkdir bin\sys
%ASSEMBLER% userland/userland_header.asm obj/userland_header.o
echo compile system binaries
for /d %%j in (userland\sys\*.*) do (
if exist userland\sys\%%~nj\main.bas echo %COMPILER% %CFLAGS% userland/sys/%%~nj/main.bas -o obj/%%~nj.o
if exist userland\sys\%%~nj\main.bas %COMPILER% %CFLAGS% userland/sys/%%~nj/main.bas -o obj/%%~nj.o
if exist userland\sys\%%~nj\main.bas echo %LINKER% obj/userland_header.o obj/%%~nj.o -T userland/userland.ld -o bin/sys/%%~nj.bin
if exist userland\sys\%%~nj\main.bas %LINKER% obj/userland_header.o obj/%%~nj.o -T userland/userland.ld -o bin/sys/%%~nj.bin
if exist userland\sys\%%~nj/main.asm echo %ASSEMBLER% userland/sys/%%~nj/main.asm bin/sys/%%~nj.bin
if exist userland\sys\%%~nj/main.asm %ASSEMBLER% userland/sys/%%~nj/main.asm bin/sys/%%~nj.bin
)
pause