(odin) added testproject for odin
This commit is contained in:
1 parent
4b969dfc42
commit
403d5d687e
3 files changed
+63
No files matched your search
@@ -0,0 +1,11 @@
|
||||
# ignore executable
|
||||
bin/
|
||||
navigator
|
||||
|
||||
# ignore generated documents
|
||||
*.pdf
|
||||
|
||||
# ignore archives
|
||||
*.tar
|
||||
*.tar.*
|
||||
*.zip
|
||||
@@ -0,0 +1,36 @@
|
||||
SHELL := /usr/bin/env bash
|
||||
|
||||
PREFIX :=
|
||||
OD := $(PREFIX)odin
|
||||
|
||||
SRC_DIR := src
|
||||
BIN_DIR := bin
|
||||
MK_DIR := $(BIN_DIR)
|
||||
|
||||
NAME := $(shell basename "$(shell pwd)")
|
||||
|
||||
BINARY := $(BIN_DIR)/$(NAME)
|
||||
|
||||
SRC := $(shell find $(SRC) -type f -name "*.odin")
|
||||
|
||||
FLAGS := -target:linux_amd64
|
||||
|
||||
.PHONY: all build clean rebuild run test
|
||||
|
||||
all: $(MK_DIR) $(BINARY)
|
||||
|
||||
build: all
|
||||
|
||||
clean:
|
||||
rm -rf $(MK_DIR)
|
||||
|
||||
rebuild: clean all
|
||||
|
||||
run: $(BINARY)
|
||||
@$(BINARY)
|
||||
|
||||
$(BINARY): $(SRC)
|
||||
$(OD) build $(FLAGS) -out:$(BINARY) $(SRC_DIR)
|
||||
|
||||
$(MK_DIR):
|
||||
mkdir -p $(MK_DIR)
|
||||
@@ -0,0 +1,16 @@
|
||||
package test_project
|
||||
|
||||
import "core:os"
|
||||
import "core:fmt"
|
||||
|
||||
main :: proc()
|
||||
{
|
||||
if 1 >= len( os.args ) do return;
|
||||
switch os.args[ 1 ]
|
||||
{
|
||||
case `push`:
|
||||
fmt.println( "push stuff around" );
|
||||
case `pop`:
|
||||
fmt.println( "pop the balloos" );
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user