Skip to content
This repository has been archived by the owner on Jul 6, 2019. It is now read-only.

Commit

Permalink
Merge pull request #167 from farcaller/toss-code-around
Browse files Browse the repository at this point in the history
Moved all rust code into src
  • Loading branch information
farcaller committed Sep 4, 2014
2 parents dca6004 + 2b34c21 commit 46911c2
Show file tree
Hide file tree
Showing 24 changed files with 24 additions and 25 deletions.
37 changes: 19 additions & 18 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,18 @@ Context.create(__FILE__, ENV['PLATFORM'])

provide_stdlibs

# shiny
# collect-all task for tests
desc "Run tests"
task :test

# external dependencies
compile_rust :shiny_crate, {
source: 'thirdparty/shiny/src/lib.rs'.in_root,
produce: 'thirdparty/shiny/src/lib.rs'.in_root.as_rlib.in_build,
out_dir: true,
build_for: :host,
}

# tests
desc "Run tests"
task :test
compile_rust :hamcrest_crate, {
source: 'thirdparty/hamcrest-rust/src/hamcrest/lib.rs'.in_root,
produce: 'thirdparty/hamcrest-rust/src/hamcrest/lib.rs'.in_root.as_rlib.in_build,
Expand All @@ -44,38 +45,38 @@ compile_rust :core_crate, {

# ioreg
compile_rust :ioreg_crate, {
source: 'ioreg/ioreg.rs'.in_root,
produce: 'ioreg/ioreg.rs'.in_root.as_rlib.in_build,
source: 'ioreg/ioreg.rs'.in_source,
produce: 'ioreg/ioreg.rs'.in_source.as_rlib.in_build,
out_dir: true,
build_for: :host,
}

compile_rust :macro_ioreg, {
source: 'macro/ioreg.rs'.in_root,
source: 'macro/ioreg.rs'.in_source,
deps: [:ioreg_crate],
produce: 'macro/ioreg.rs'.in_root.as_dylib.in_build,
produce: 'macro/ioreg.rs'.in_source.as_dylib.in_build,
out_dir: true,
build_for: :host,
}

rust_tests :ioreg_test, {
source: 'ioreg/test.rs'.in_root,
source: 'ioreg/test.rs'.in_source,
deps: [:core_crate, :macro_ioreg, :shiny_crate],
produce: 'ioreg_test'.in_build,
}

# zinc crate
compile_rust :zinc_crate, {
source: 'lib.rs'.in_source,
source: 'zinc/lib.rs'.in_source,
deps: [:core_crate, :rlibc_crate, :macro_ioreg],
produce: 'lib.rs'.in_source.as_rlib.in_build,
produce: 'zinc/lib.rs'.in_source.as_rlib.in_build,
out_dir: true,
recompile_on: [:triple, :platform],
}

# zinc isr crate
compile_rust :zinc_isr, {
source: 'hal/isr.rs'.in_source,
source: 'zinc/hal/isr.rs'.in_source,
deps: :core_crate,
produce: 'isr.o'.in_intermediate,
recompile_on: [:triple],
Expand All @@ -91,22 +92,22 @@ compile_rust :zinc_isr, {

# platform tree
compile_rust :platformtree_crate, {
source: 'platformtree/platformtree.rs'.in_root,
produce: 'platformtree/platformtree.rs'.in_root.as_rlib.in_build,
source: 'platformtree/platformtree.rs'.in_source,
produce: 'platformtree/platformtree.rs'.in_source.as_rlib.in_build,
out_dir: true,
build_for: :host,
optimize: 0,
}

rust_tests :platformtree_test, {
source: 'platformtree/platformtree.rs'.in_root,
source: 'platformtree/platformtree.rs'.in_source,
deps: :hamcrest_crate,
produce: 'platformtree_test'.in_build,
}

# zinc test
rust_tests :zinc_test, {
source: 'lib.rs'.in_source,
source: 'zinc/lib.rs'.in_source,
deps: [:core_crate, :macro_ioreg, :hamcrest_crate, :shiny_crate],
produce: 'zinc_test'.in_build,
recompile_on: [:platform],
Expand All @@ -115,9 +116,9 @@ rust_tests :zinc_test, {

# macros
compile_rust :macro_platformtree, {
source: 'macro/platformtree.rs'.in_root,
source: 'macro/platformtree.rs'.in_source,
deps: [:platformtree_crate],
produce: 'macro/platformtree.rs'.in_root.as_dylib.in_build,
produce: 'macro/platformtree.rs'.in_source.as_dylib.in_build,
out_dir: true,
build_for: :host,
optimize: 0,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 1 addition & 3 deletions ioreg/test.rs → src/ioreg/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@
#[phase(plugin,link)] extern crate shiny;
extern crate core;


#[allow(dead_code)]
#[path="../src/zinc/util/volatile_cell.rs"] mod volatile_cell;
#[path="../zinc/util/volatile_cell.rs"] mod volatile_cell;

#[cfg(test)]
mod test {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ pub mod builder;
pub mod node;
pub mod parser;

#[path="../src/zinc/hal/lpc17xx/platformtree.rs"] mod lpc17xx_pt;
#[path="../src/zinc/drivers/drivers_pt.rs"] mod drivers_pt;
#[path="../zinc/hal/lpc17xx/platformtree.rs"] mod lpc17xx_pt;
#[path="../zinc/drivers/drivers_pt.rs"] mod drivers_pt;

#[cfg(test)] mod test_helpers;
#[cfg(test)] mod parser_test;
File renamed without changes.
4 changes: 2 additions & 2 deletions support/build/context.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def initialize(rakefile, platform)
def root_dir(*args); File.join(@root_path, *args); end

# Returns path relative to $root/src
def src_dir(*args); File.join(root_dir, 'src/zinc', *args); end
def src_dir(*args); File.join(root_dir, 'src', *args); end

# Returns path relative to $root/build
def build_dir(*args)
Expand All @@ -71,7 +71,7 @@ def build_dir(*args)
end

# Returns path relative to $src/hal/$platform
def platform_dir(*args); src_dir('hal', @platform.name, *args); end
def platform_dir(*args); src_dir('zinc/hal', @platform.name, *args); end

# Returns path relative to $build/intermediate
def intermediate_dir(*args); build_dir('intermediate', *args); end
Expand Down

8 comments on commit 46911c2

@hacknbot
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TeamCity zinc :: lpc17xx Build 41 is now running

@hacknbot
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TeamCity zinc :: lpc17xx Build 41 outcome was SUCCESS
Summary: Running Build time: 00:00:06

@hacknbot
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TeamCity zinc :: k20 Build 5 is now running

@hacknbot
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TeamCity zinc :: k20 Build 5 outcome was SUCCESS
Summary: Running Build time: 00:00:27

@hacknbot
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TeamCity zinc :: lpc17xx Build 43 is now running

@hacknbot
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TeamCity zinc :: lpc17xx Build 43 outcome was SUCCESS
Summary: Running Build time: 00:00:02

@hacknbot
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TeamCity zinc :: stm32f4 Build 5 is now running

@hacknbot
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TeamCity zinc :: stm32f4 Build 5 outcome was SUCCESS
Summary: Running Build time: 00:00:21

Please sign in to comment.