Compare commits
No commits in common. "master" and "b7e340b5622431e74bddb6bde664ef1465b59b9e" have entirely different histories.
master
...
b7e340b562
5 changed files with 7 additions and 84 deletions
21
Makefile
21
Makefile
|
|
@ -1,28 +1,15 @@
|
||||||
build: clean
|
build: clean
|
||||||
mkdir -p ./bin/debug/
|
mkdir -p ./bin/
|
||||||
odin build ./src/ -out:bin/debug/odin_runner.exe -debug
|
odin build ./src/ -out:bin/odin_runner.exe -debug
|
||||||
|
|
||||||
build_rel: clean_rel
|
|
||||||
mkdir -p ./bin/release/
|
|
||||||
odin build ./src/ -out:bin/release/odin_runner.exe
|
|
||||||
|
|
||||||
run:
|
run:
|
||||||
./bin/debug/odin_runner.exe
|
./bin/odin_runner.exe
|
||||||
|
|
||||||
run_rel:
|
|
||||||
./bin/release/odin_runner.exe
|
|
||||||
|
|
||||||
check:
|
check:
|
||||||
odin check ./src/
|
odin check ./src/
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -rf ./bin/debug/
|
rm -rf ./bin/odin_runner.*
|
||||||
|
|
||||||
clean_rel:
|
|
||||||
rm -rf ./bin/release/
|
|
||||||
|
|
||||||
cleanall:
|
|
||||||
rm -rf ./bin/
|
|
||||||
|
|
||||||
nuke:
|
nuke:
|
||||||
rm -rf ./bin
|
rm -rf ./bin
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,8 @@
|
||||||
"collections": [],
|
"collections": [],
|
||||||
"flags": [],
|
"flags": [],
|
||||||
"source": "./src/",
|
"source": "./src/",
|
||||||
"output_dir": "",
|
"output_dir": "./bin/",
|
||||||
"binary_name": ""
|
"binary_name": "binary_name.bin"
|
||||||
},
|
},
|
||||||
"configurations": [
|
"configurations": [
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -2,13 +2,10 @@
|
||||||
Because I can.
|
Because I can.
|
||||||
|
|
||||||
# How to use
|
# How to use
|
||||||
|
Usage:
|
||||||
Usage examples:
|
|
||||||
```
|
|
||||||
* `odin_runner` - Run the default command with the defautl configuration (i.e. build with the defaults)
|
* `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` - Same as above
|
||||||
* `odin_runner build debug` - Same as above but with an explicit configuration (`debug`)
|
* `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` - Runs odin check with the defaults
|
||||||
* `odin_runner check debug` - Same as above but with an explicit configuration (`debug`)
|
* `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`)
|
* `odin_runner clean debug` - Cleans up build artefacts in the build directory of an explicit configuration (`debug`)
|
||||||
```
|
|
||||||
|
|
|
||||||
BIN
src.bin
Executable file
BIN
src.bin
Executable file
Binary file not shown.
|
|
@ -16,26 +16,6 @@ execute_command :: proc(
|
||||||
configuration: ConfigurationTargets,
|
configuration: ConfigurationTargets,
|
||||||
) -> (
|
) -> (
|
||||||
error: ExecutionError,
|
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]
|
target_config, found_target_in_config := configuration[target_name]
|
||||||
if !found_target_in_config && 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_string(&sb, command_to_string(command))
|
||||||
strings.write_byte(&sb, ' ')
|
strings.write_byte(&sb, ' ')
|
||||||
|
|
||||||
// Append the command
|
|
||||||
if def_config, ok := configuration[DEFAULT_TARGET_NAME]; ok && !found_target_in_config {
|
if def_config, ok := configuration[DEFAULT_TARGET_NAME]; ok && !found_target_in_config {
|
||||||
strings.write_string(&sb, string(def_config.source))
|
strings.write_string(&sb, string(def_config.source))
|
||||||
} else if found_target_in_config {
|
} else if found_target_in_config {
|
||||||
|
|
@ -90,26 +69,6 @@ build_or_check :: proc(
|
||||||
strings.write_string(&sb, flag)
|
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)
|
compile_flags = strings.to_string(sb)
|
||||||
|
|
||||||
|
|
@ -119,23 +78,3 @@ build_or_check :: proc(
|
||||||
|
|
||||||
return
|
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
|
|
||||||
}
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue