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 build: clean
mkdir -p ./bin/ mkdir -p ./bin/debug/
odin build ./src/ -out:bin/odin_runner.exe -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: run:
./bin/odin_runner.exe ./bin/debug/odin_runner.exe
run_rel:
./bin/release/odin_runner.exe
check: check:
odin check ./src/ odin check ./src/
clean: clean:
rm -rf ./bin/odin_runner.* rm -rf ./bin/debug/
clean_rel:
rm -rf ./bin/release/
cleanall:
rm -rf ./bin/
nuke: nuke:
rm -rf ./bin rm -rf ./bin

View file

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

View file

@ -9,6 +9,27 @@ ExecutionError :: enum {
None, None,
ErrorDuringCommandExecution, 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( build_or_check :: proc(
command: Command, command: Command,
target_name: TargetName, target_name: TargetName,
@ -99,26 +120,6 @@ build_or_check :: proc(
return 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( clean :: proc(
command: Command, command: Command,
target_name: TargetName, target_name: TargetName,