This commit is contained in:
Stefan Stefanov 2024-01-18 18:11:35 +02:00
parent 162ab2001b
commit bfea21078e
3 changed files with 40 additions and 26 deletions

View file

@ -1,15 +1,28 @@
build: clean
mkdir -p ./bin/
odin build ./src/ -out:bin/odin_runner.exe -debug
mkdir -p ./bin/debug/
odin build ./src/ -out:bin/debug/odin_runner.exe -debug
build_rel: clean_rel
mkdir -p ./bin/release/
odin build ./src/ -out:bin/release/odin_runner.exe
run:
./bin/odin_runner.exe
./bin/debug/odin_runner.exe
run_rel:
./bin/release/odin_runner.exe
check:
odin check ./src/
clean:
rm -rf ./bin/odin_runner.*
rm -rf ./bin/debug/
clean_rel:
rm -rf ./bin/release/
cleanall:
rm -rf ./bin/
nuke:
rm -rf ./bin

View file

@ -3,8 +3,8 @@
"collections": [],
"flags": [],
"source": "./src/",
"output_dir": "./bin/",
"binary_name": "binary_name.bin"
"output_dir": "",
"binary_name": ""
},
"configurations": [
{

View file

@ -9,6 +9,27 @@ ExecutionError :: enum {
None,
ErrorDuringCommandExecution,
}
execute_command :: proc(
command: Command,
target_name: TargetName,
configuration: ConfigurationTargets,
) -> (
error: ExecutionError,
) {
if command == .CHECK || command == .BUILD {
return build_or_check(command, target_name, configuration)
}
if command == .CLEAN {
return clean(command, target_name, configuration)
}
if command == .TEST {
return test(command, target_name, configuration)
}
return
}
build_or_check :: proc(
command: Command,
target_name: TargetName,
@ -99,26 +120,6 @@ build_or_check :: proc(
return
}
execute_command :: proc(
command: Command,
target_name: TargetName,
configuration: ConfigurationTargets,
) -> (
error: ExecutionError,
) {
if command == .CHECK || command == .BUILD {
return build_or_check(command, target_name, configuration)
}
if command == .CLEAN {
return clean(command, target_name, configuration)
}
if command == .TEST {
return test(command, target_name, configuration)
}
return
}
clean :: proc(
command: Command,
target_name: TargetName,