From 413a5ff047cc5d7c6ad0ac2c9867c9fcbca47377 Mon Sep 17 00:00:00 2001 From: Brendan Zabarauskas Date: Sat, 8 Sep 2012 18:54:32 +1000 Subject: [PATCH] Rename repository to 'omath' --- Makefile | 34 ++++++++++++++++++++++------ src/mat.rs | 1 + src/{om3d.rc => omath.rc} | 2 +- sublime/om3d.sublime-project | 10 -------- sublime/omath.sublime-project | 14 ++++++++++++ test/test_mat.rs | 4 ++-- test/{test_om3d.rc => test_omath.rc} | 6 ++--- test/test_quat.rs | 6 ++--- test/test_vec.rs | 2 +- 9 files changed, 52 insertions(+), 27 deletions(-) rename src/{om3d.rc => omath.rc} (90%) delete mode 100644 sublime/om3d.sublime-project create mode 100644 sublime/omath.sublime-project rename test/{test_om3d.rc => test_omath.rc} (70%) diff --git a/Makefile b/Makefile index da1ab23..9216074 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,30 @@ -# adapted from https://github.com/z0w0/rusty-math/blob/master/Makefile +TARGET = omath + +ROOT_DIR = . + +SRC_DIR = $(ROOT_DIR)/src +SRC_CRATE = $(TARGET).rc +BUILD_DIR = $(ROOT_DIR)/lib + +TEST = test_$(TARGET) +TEST_DIR = $(ROOT_DIR)/test +TEST_BUILD_DIR = $(TEST_DIR)/build +TEST_CRATE = $(TEST).rc + +$(TARGET): + @echo "Building $(TARGET)" + @rustc $(SRC_DIR)/$(SRC_CRATE) --lib -g --out-dir=$(BUILD_DIR) + @echo "Success! \o/" + +all: $(TARGET) -all: - rustc src/om3d.rc --lib --out-dir=lib test: all - rustc --test -L lib test/test_om3d.rc -o test/build/test_om3d.elf - ./test/build/test_om3d.elf + @echo "..." + @echo "Building $(TEST)" + @rustc --test -L lib $(TEST_DIR)/$(TEST_CRATE) -g --out-dir=$(TEST_BUILD_DIR) + @echo "Success! \o/" + @$(TEST_BUILD_DIR)/$(TEST) + clean: - rm -R -f ./lib/* - rm -R -f ./test/build/* \ No newline at end of file + rm -R -f $(BUILD_DIR)/* + rm -R -f $(TEST_BUILD_DIR)/* \ No newline at end of file diff --git a/src/mat.rs b/src/mat.rs index 1a0e3b1..11d2729 100644 --- a/src/mat.rs +++ b/src/mat.rs @@ -440,6 +440,7 @@ impl mat3: Matrix3 { y = self[1][2] - self[2][1] * s; z = self[0][1] - self[1][0] * s; } + return quat(w, x, y, z); } } diff --git a/src/om3d.rc b/src/omath.rc similarity index 90% rename from src/om3d.rc rename to src/omath.rc index d5bf43f..94096bd 100644 --- a/src/om3d.rc +++ b/src/omath.rc @@ -1,4 +1,4 @@ -#[link(name = "om3d", +#[link(name = "omath", vers = "0.1", author = "Brendan Zabarauskas")]; diff --git a/sublime/om3d.sublime-project b/sublime/om3d.sublime-project deleted file mode 100644 index 95f76b1..0000000 --- a/sublime/om3d.sublime-project +++ /dev/null @@ -1,10 +0,0 @@ -{ - "folders": - [ - { - "path": "../", - "file_exclude_patterns": ["*.sublime-workspace"], - "folder_exclude_patterns": ["*.dSYM"] - } - ] -} diff --git a/sublime/omath.sublime-project b/sublime/omath.sublime-project new file mode 100644 index 0000000..8e685cf --- /dev/null +++ b/sublime/omath.sublime-project @@ -0,0 +1,14 @@ +{ + "folders": + [ + { + "path": "../", + "file_exclude_patterns": ["*.sublime-workspace"], + "folder_exclude_patterns": ["*.dSYM"] + }, + { + "path": "/usr/local/src/rust/src", + "name": "rust" + } + ] +} diff --git a/test/test_mat.rs b/test/test_mat.rs index 3cbb476..da70330 100644 --- a/test/test_mat.rs +++ b/test/test_mat.rs @@ -1,5 +1,5 @@ -import om3d::mat::*; -import om3d::vec::*; +import omath::mat::*; +import omath::vec::*; // TODO diff --git a/test/test_om3d.rc b/test/test_omath.rc similarity index 70% rename from test/test_om3d.rc rename to test/test_omath.rc index 14f569d..312257e 100644 --- a/test/test_om3d.rc +++ b/test/test_omath.rc @@ -1,12 +1,12 @@ -#[link(name = "om3d-test", +#[link(name = "test_omath", vers = "0.1", author = "Brendan Zabarauskas")]; -#[comment = "Unittests for om3d"]; +#[comment = "Unittests for omath"]; #[crate_type = "unittests"]; use std; -use om3d; +use omath; mod test_mat; mod test_math; diff --git a/test/test_quat.rs b/test/test_quat.rs index b7be5c8..13442a2 100644 --- a/test/test_quat.rs +++ b/test/test_quat.rs @@ -1,6 +1,6 @@ -import om3d::mat::*; -import om3d::quat::*; -import om3d::vec::*; +import omath::mat::*; +import omath::quat::*; +import omath::vec::*; // TODO diff --git a/test/test_vec.rs b/test/test_vec.rs index 46fcf93..094d0f3 100644 --- a/test/test_vec.rs +++ b/test/test_vec.rs @@ -1,5 +1,5 @@ import std::cmp::FuzzyEq; -import om3d::vec::*; +import omath::vec::*; // TODO