Support linux build

This commit is contained in:
Jaby 2023-10-09 22:34:42 +02:00
parent a16d0c10dc
commit d230d1579a
8 changed files with 160 additions and 201 deletions

View File

@ -1,19 +0,0 @@
@echo off
rem build_all [clean]
set build_type=build
IF NOT "%~1" == "" (
set build_type=%~1
)
mkdir bin\
cd src\Tools\
call build_all.bat update
call build_all.bat %build_type%
cd ..\Library\
call run_make.bat %build_type% release
cd ..\..\
PAUSE

View File

@ -1,82 +1,87 @@
{ {
"folders": [ "folders": [
{ {
"path": ".", "path": ".",
"name": "PoolBox" "name": "PoolBox"
} }
], ],
"tasks": { "tasks": {
"version": "2.0.0", "version": "2.0.0",
"tasks": [ "tasks": [
{ {
"label": "build", "label": "build",
"type": "shell", "type": "shell",
"command": "wsl make ${input:project}_${input:target} BUILD_PROFILE=${input:build profile} PSX_LICENSE_PATH=$(wslpath ${env:PSX_LICENSE_PATH}) JABY_ENGINE_DIR=$(wslpath ${env:JABY_ENGINE_PATH})", "windows": { // v re-export for WSL v re-export for WSL
"group": { "command": "wsl make ${input:project}_${input:target} BUILD_PROFILE=${input:build profile} PSX_LICENSE_PATH=$(wslpath ${env:PSX_LICENSE_PATH}) JABY_ENGINE_DIR=$(wslpath ${env:JABY_ENGINE_PATH})",
"kind": "build", },
"isDefault": true "linux": {
}, "command": "make ${input:project}_${input:target} BUILD_PROFILE=${input:build profile}",
"options": { },
"env": { "group": {
"PATH": "${env:JABY_ENGINE_PATH}/bin;${env:PATH}" "kind": "build",
} "isDefault": true
} },
}, "options": {
{ "env": {
"label": "read memory map", "PATH": "${env:JABY_ENGINE_PATH}/bin;${env:PATH}"
"type": "shell", }
"command": "psxreadmap.exe ${input:output memory map} application/bin/PSX-${input:build profile}/PoolBox.elf", }
"problemMatcher": [], },
"options": { {
"env": { "label": "read memory map",
"PATH": "${env:JABY_ENGINE_PATH}/bin;${env:PATH}" "type": "shell",
} "command": "psxreadmap.exe ${input:output memory map} application/bin/PSX-${input:build profile}/PoolBox.elf",
} "problemMatcher": [],
} "options": {
], "env": {
"inputs": [ "PATH": "${env:JABY_ENGINE_PATH}/bin;${env:PATH}"
{ }
"id": "build profile", }
"type": "pickString", }
"options": ["debug", "release"], ],
"default": "release", "inputs": [
"description": "The build profile for PoolBox" {
}, "id": "build profile",
{ "type": "pickString",
"id": "project", "options": ["debug", "release"],
"type": "pickString", "default": "release",
"options": ["all", "assets", "application", "cd"], "description": "The build profile for PoolBox"
"default": "all", },
"description": "Project to build" {
}, "id": "project",
{ "type": "pickString",
"id": "target", "options": ["all", "assets", "application", "cd"],
"type": "pickString", "default": "all",
"options": ["all", "clean", "rebuild"], "description": "Project to build"
"default": "all", },
"description": "the build target" {
}, "id": "target",
{ "type": "pickString",
"id": "output memory map", "options": ["all", "clean", "rebuild"],
"type": "pickString", "default": "all",
"options": ["", "-o application/bin/PoolBox.map"], "description": "the build target"
"default": "", },
"description": "Output a memory map" {
} "id": "output memory map",
] "type": "pickString",
}, "options": ["", "-o application/bin/PoolBox.map"],
"settings": { "default": "",
"C_Cpp.default.includePath": [ "description": "Output a memory map"
"${env:JABY_ENGINE_PATH}/include" }
], ]
"C_Cpp.default.compilerPath": "", },
"C_Cpp.default.cStandard": "c17", "settings": {
"C_Cpp.default.cppStandard": "c++20", "C_Cpp.default.includePath": [
"C_Cpp.default.intelliSenseMode": "linux-gcc-x86", "${env:JABY_ENGINE_PATH}/include"
"C_Cpp.default.compilerArgs": [ ],
], "C_Cpp.default.compilerPath": "",
"C_Cpp.default.defines": [ "C_Cpp.default.cStandard": "c17",
"JABYENGINE_PAL" "C_Cpp.default.cppStandard": "c++20",
], "C_Cpp.default.intelliSenseMode": "linux-gcc-x86",
} "C_Cpp.default.compilerArgs": [
],
"C_Cpp.default.defines": [
"JABYENGINE_PAL"
],
}
} }

View File

@ -1,75 +1,71 @@
{ {
"folders": [ "folders": [
{ {
"name": "JabyEngine", "name": "JabyEngine",
"path": ".", "path": ".",
}, },
{ {
"name": "Include", "name": "Include",
"path": "..\\..\\include" "path": "..\\..\\include"
}, },
{ {
"name": "Root", "name": "Root",
"path": "..\\.." "path": "..\\.."
} }
], ],
"tasks": { "tasks": {
"version": "2.0.0", "version": "2.0.0",
"tasks": [ "tasks": [
{ {
"label": "make", "label": "make",
"type": "shell", "type": "shell",
"command": "./run_make.bat ${input:target} ${input:build cfg}", "windows": {
"group": "build" "command": "wsl make ${input:target} BUILD_PROFILE=${input:build cfg}",
}, },
{ "linux": {
"label": "Build Libary and Tools", "command": "make ${input:target} BUILD_PROFILE=${input:build cfg}",
"type": "shell", },
"command": "./build_all.bat ${input:target}", "group": "build"
"group": "build", }
"options": { ],
"cwd": "../.." "inputs": [
} {
}, "id": "build cfg",
], "type": "pickString",
"inputs": [ "options": ["debug", "release"],
{ "default": "release",
"id": "build cfg", "description": "build configuration"
"type": "pickString", },
"options": ["debug", "release"], {
"default": "release", "id": "target",
"description": "build configuration" "type": "pickString",
}, "options": ["all", "clean", "rebuild"],
{ "default": "all",
"id": "target", "description": "build target",
"type": "pickString", }
"options": ["build", "clean", "rebuild"], ]
"default": "build", },
"description": "build target", "settings": {
} "cmake.configureOnOpen": false,
] "C_Cpp.default.includePath": [
}, "include",
"settings": { "../../include"
"cmake.configureOnOpen": false, ],
"C_Cpp.default.includePath": [ "C_Cpp.default.compilerPath": "",
"include", "C_Cpp.default.cStandard": "c17",
"../../include" "C_Cpp.default.cppStandard": "c++20",
], "C_Cpp.default.intelliSenseMode": "linux-gcc-x86",
"C_Cpp.default.compilerPath": "", "C_Cpp.default.compilerArgs": [
"C_Cpp.default.cStandard": "c17", ],
"C_Cpp.default.cppStandard": "c++20", "C_Cpp.default.defines": [
"C_Cpp.default.intelliSenseMode": "linux-gcc-x86", "JABYENGINE_PAL"
"C_Cpp.default.compilerArgs": [ ],
], "files.exclude": {
"C_Cpp.default.defines": [ "**/*.o": true,
"JABYENGINE_PAL" "**/*.dep": true
], },
"files.exclude": { "files.associations": {
"**/*.o": true, "stdio.h": "c"
"**/*.dep": true }
}, }
"files.associations": {
"stdio.h": "c"
}
}
} }

View File

@ -1,11 +0,0 @@
@echo off
rem run_make.bat build|clean|rebuild debug|release
IF %1 == build (
set make_target=all
) else (
set make_target=%1
)
@echo make %make_target% BUILD_PROFILE=%2
wsl make %make_target% BUILD_PROFILE=%2

View File

@ -1,4 +0,0 @@
set bin_linux_projects=%bin_projects% %bin_linux_projects%
set clean_projects_linux=%clean_projects% %clean_projects_linux%
set bin_projects=
set clean_projects=

View File

@ -1,4 +0,0 @@
set bin_projects=psxcdgen psxcdgen_ex psxcdread psxreadmap wslpath
set bin_linux_projects=cpp_out psxcdgen_ex jaby_engine_fconv mkoverlay wslpath
set clean_projects=cdtypes
set clean_projects_linux=tool_helper

View File

@ -1,4 +0,0 @@
set bin_projects=%bin_projects% %bin_linux_projects%
set clean_projects=%clean_projects% %clean_projects_linux%
set bin_linux_projects=
set clean_projects_linux=

View File

@ -10,7 +10,7 @@ fi
cd $1 cd $1
if [ $2 = build ]; then if [ $2 = build ]; then
echo "cargo build $1 --$3" echo "cargo build $1 --$3"
cargo build --$3 --target=$target $HOME/.cargo/bin/cargo build --$3 --target=$target
if [ $? = 0 ]; then if [ $? = 0 ]; then
cp target/$target/$3/$1 ../../../bin cp target/$target/$3/$1 ../../../bin
@ -20,17 +20,17 @@ if [ $2 = build ]; then
exit $? exit $?
elif [ $2 = run ]; then elif [ $2 = run ]; then
echo "cargo run $1 --$3" echo "cargo run $1 --$3"
cargo run --$3 --target=$target $HOME/.cargo/bin/cargo run --$3 --target=$target
exit $? exit $?
elif [ $2 = check ]; then elif [ $2 = check ]; then
echo "cargo check $1 --$3" echo "cargo check $1 --$3"
cargo check --$3 --target=$target $run_args $HOME/.cargo/bin/cargo check --$3 --target=$target $run_args
exit $? exit $?
elif [ $2 = clean ]; then elif [ $2 = clean ]; then
echo "cargo clean $1" echo "cargo clean $1"
cargo clean $HOME/.cargo/bin/cargo clean
exit $? exit $?
else else