Compare commits

..

No commits in common. "master" and "b7e340b5622431e74bddb6bde664ef1465b59b9e" have entirely different histories.

5 changed files with 7 additions and 84 deletions

View file

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

View file

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

View file

@ -2,13 +2,10 @@
Because I can.
# How to use
Usage examples:
```
Usage:
* `odin_runner` - Run the default command with the defautl configuration (i.e. build with the defaults)
* `odin_runner build` - Same as above
* `odin_runner build debug` - Same as above but with an explicit configuration (`debug`)
* `odin_runner check` - Runs odin check with the defaults
* `odin_runner check debug` - Same as above but with an explicit configuration (`debug`)
* `odin_runner clean debug` - Cleans up build artefacts in the build directory of an explicit configuration (`debug`)
```

BIN
src.bin Executable file

Binary file not shown.

View file

@ -16,26 +16,6 @@ execute_command :: proc(
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,
configuration: ConfigurationTargets,
) -> (
error: ExecutionError,
) {
target_config, found_target_in_config := configuration[target_name]
if !found_target_in_config && target_name != "" {
@ -52,7 +32,6 @@ build_or_check :: proc(
strings.write_string(&sb, command_to_string(command))
strings.write_byte(&sb, ' ')
// Append the command
if def_config, ok := configuration[DEFAULT_TARGET_NAME]; ok && !found_target_in_config {
strings.write_string(&sb, string(def_config.source))
} else if found_target_in_config {
@ -90,26 +69,6 @@ build_or_check :: proc(
strings.write_string(&sb, flag)
}
}
// Append the output dir
if command == .BUILD {
output_dir: Path;binary_name: string
if def_config, ok := configuration[DEFAULT_TARGET_NAME]; ok {
if len(def_config.output_dir) != 0 && len(def_config.binary_name) != 0 {
output_dir = def_config.output_dir
binary_name = def_config.binary_name
}
}
if found_target_in_config {
output_dir = target_config.output_dir
binary_name = target_config.binary_name
}
if len(output_dir) > 0 && len(binary_name) > 0 {
strings.write_string(&sb, " -out:")
strings.write_string(&sb, string(output_dir))
strings.write_string(&sb, binary_name)
}
}
compile_flags = strings.to_string(sb)
@ -119,23 +78,3 @@ build_or_check :: proc(
return
}
clean :: proc(
command: Command,
target_name: TargetName,
configuration: ConfigurationTargets,
) -> (
error: ExecutionError,
) {
return
}
test :: proc(
command: Command,
target_name: TargetName,
configuration: ConfigurationTargets,
) -> (
error: ExecutionError,
) {
return
}