From 30876992f140670ac9378406b925d629df31c9af Mon Sep 17 00:00:00 2001 From: Riyyi Date: Thu, 30 Jul 2026 20:46:08 +0200 Subject: [PATCH] Initial commit --- .editorconfig | 8 ++++++++ .gitattributes | 1 + .gitignore | 8 ++++++++ build.sh | 14 ++++++++++++++ fmt.sh | 3 +++ odinfmt.json | 6 ++++++ src/main.odin | 10 ++++++++++ 7 files changed, 50 insertions(+) create mode 100644 .editorconfig create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100755 build.sh create mode 100755 fmt.sh create mode 100644 odinfmt.json create mode 100644 src/main.odin diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..da39e35 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,8 @@ +# editorconfig.org +root = true + +[*] +indent_style = tab +indent_size = 4 +end_of_line = lf +charset = utf-8 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..dfdb8b7 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +*.sh text eol=lf diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f77e912 --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +# Files + +.DS_Store +/hello-world + +# Directories + +*.dSYM/ diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..942b16c --- /dev/null +++ b/build.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +PROJECT="hello-world" +VERSION="dev-$(date -u '+%Y-%m-%d')-$(git rev-parse --short HEAD)" + +if [[ $1 == "debug" ]] +then + shift + + odin build src/ -show-timings -collection:src=src -out:$PROJECT -microarch:native -use-separate-modules -define:VERSION=$VERSION-debug -debug $@ + exit 0 +fi + +odin build src/ -show-timings -collection:src=src -out:$PROJECT -microarch:native -o:speed -define:VERSION=$VERSION $@ diff --git a/fmt.sh b/fmt.sh new file mode 100755 index 0000000..0333539 --- /dev/null +++ b/fmt.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +odinfmt src/ diff --git a/odinfmt.json b/odinfmt.json new file mode 100644 index 0000000..bfe862c --- /dev/null +++ b/odinfmt.json @@ -0,0 +1,6 @@ +{ + "$schema": "https://raw.githubusercontent.com/DanielGavin/ols/master/misc/odinfmt.schema.json", + "character_width": 80, + "tabs": true, + "tabs_width": 4 +} diff --git a/src/main.odin b/src/main.odin new file mode 100644 index 0000000..c76b944 --- /dev/null +++ b/src/main.odin @@ -0,0 +1,10 @@ +package main + +import "core:fmt" + +VERSION :: #config(VERSION, "dev") + +main :: proc() { + fmt.println("Hellope!") + fmt.println(VERSION) +}